@atlaskit/media-viewer 53.1.1 → 53.2.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 +14 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/viewers/doc/doc-viewer.js +10 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/viewers/doc/doc-viewer.js +10 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/viewers/doc/doc-viewer.js +10 -1
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 53.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`34c40eb233aa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34c40eb233aa4) -
|
|
8
|
+
isUxChange: true
|
|
9
|
+
|
|
10
|
+
Lazy-append document pages for MS Excel previews behind platform_media_excel_lazy_load gate to fix
|
|
11
|
+
initial-render freeze on very large documents
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 53.1.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ exports.packageVersion = exports.packageName = void 0;
|
|
|
10
10
|
var _analytics = require("@atlaskit/media-common/analytics");
|
|
11
11
|
var componentName = exports.component = exports.componentName = 'mediaViewer';
|
|
12
12
|
var packageName = exports.packageName = "@atlaskit/media-viewer";
|
|
13
|
-
var packageVersion = exports.packageVersion = "
|
|
13
|
+
var packageVersion = exports.packageVersion = "53.1.1";
|
|
14
14
|
function getFileAttributes(fileState) {
|
|
15
15
|
if (!fileState) {
|
|
16
16
|
return {
|
|
@@ -13,7 +13,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
var packageName = "@atlaskit/media-viewer";
|
|
16
|
-
var packageVersion = "
|
|
16
|
+
var packageVersion = "53.1.1";
|
|
17
17
|
var ufoExperience;
|
|
18
18
|
var getExperience = function getExperience() {
|
|
19
19
|
if (!ufoExperience) {
|
|
@@ -17,11 +17,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _mediaClient = require("@atlaskit/media-client");
|
|
18
18
|
var _mediaDocumentViewer = require("@atlaskit/media-document-viewer");
|
|
19
19
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _errors = require("../../errors");
|
|
21
22
|
var _zoomControls = require("../../zoomControls");
|
|
22
23
|
var _zoomLevel = require("../../domain/zoomLevel");
|
|
23
24
|
var _passwordInput = require("./passwordInput");
|
|
24
25
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
26
|
+
var _mediaTypeUtils = require("@atlaskit/media-common/mediaTypeUtils");
|
|
25
27
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
26
28
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
29
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -66,6 +68,7 @@ var reducer = function reducer(state, action) {
|
|
|
66
68
|
var documentViewerStyles = null;
|
|
67
69
|
var spinnerStyles = null;
|
|
68
70
|
var DocViewer = exports.DocViewer = function DocViewer(_ref) {
|
|
71
|
+
var _fileState$mimeType;
|
|
69
72
|
var mediaClient = _ref.mediaClient,
|
|
70
73
|
fileState = _ref.fileState,
|
|
71
74
|
collectionName = _ref.collectionName,
|
|
@@ -76,6 +79,11 @@ var DocViewer = exports.DocViewer = function DocViewer(_ref) {
|
|
|
76
79
|
_useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
|
|
77
80
|
state = _useReducer2[0],
|
|
78
81
|
dispatch = _useReducer2[1];
|
|
82
|
+
|
|
83
|
+
// Compute enableLazyPageRendering based on Excel file detection and feature gate
|
|
84
|
+
// Excel files are found to have 60K pages, because excel can have thousand of empty rows, JST-1296681
|
|
85
|
+
var isExcel = fileState.status !== 'error' && (0, _mediaTypeUtils.isExcelFile)((_fileState$mimeType = fileState.mimeType) !== null && _fileState$mimeType !== void 0 ? _fileState$mimeType : '');
|
|
86
|
+
var enableLazyPageRendering = isExcel && (0, _platformFeatureFlags.fg)('platform_media_excel_lazy_load');
|
|
79
87
|
var getContent = (0, _mediaCommon.useStaticCallback)( /*#__PURE__*/function () {
|
|
80
88
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(pageStart, pageEnd) {
|
|
81
89
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -214,7 +222,8 @@ var DocViewer = exports.DocViewer = function DocViewer(_ref) {
|
|
|
214
222
|
getContent: getContent,
|
|
215
223
|
getPageImageUrl: getPageImageUrl,
|
|
216
224
|
zoom: state.zoomLevel.value,
|
|
217
|
-
onSuccess: onSuccessHandler
|
|
225
|
+
onSuccess: onSuccessHandler,
|
|
226
|
+
enableLazyPageRendering: enableLazyPageRendering
|
|
218
227
|
}), /*#__PURE__*/_react.default.createElement(_zoomControls.ZoomControls, {
|
|
219
228
|
onChange: onZoomChange,
|
|
220
229
|
zoomLevel: state.zoomLevel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
const componentName = 'mediaViewer';
|
|
3
3
|
const packageName = "@atlaskit/media-viewer";
|
|
4
|
-
const packageVersion = "
|
|
4
|
+
const packageVersion = "53.1.1";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -3,7 +3,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
3
3
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
const packageName = "@atlaskit/media-viewer";
|
|
6
|
-
const packageVersion = "
|
|
6
|
+
const packageVersion = "53.1.1";
|
|
7
7
|
let ufoExperience;
|
|
8
8
|
const getExperience = () => {
|
|
9
9
|
if (!ufoExperience) {
|
|
@@ -5,11 +5,13 @@ import React, { useReducer } from 'react';
|
|
|
5
5
|
import { isCommonMediaClientError } from '@atlaskit/media-client';
|
|
6
6
|
import { DOCUMENT_SCROLL_ROOT_ID, DocumentViewer } from '@atlaskit/media-document-viewer';
|
|
7
7
|
import { useStaticCallback } from '@atlaskit/media-common';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { MediaViewerError } from '../../errors';
|
|
9
10
|
import { ZoomControls } from '../../zoomControls';
|
|
10
11
|
import { ZoomLevel } from '../../domain/zoomLevel';
|
|
11
12
|
import { PasswordInput } from './passwordInput';
|
|
12
13
|
import Spinner from '@atlaskit/spinner';
|
|
14
|
+
import { isExcelFile } from '@atlaskit/media-common/mediaTypeUtils';
|
|
13
15
|
const initialState = {
|
|
14
16
|
isMissingPassword: false,
|
|
15
17
|
hasPasswordError: false,
|
|
@@ -64,7 +66,13 @@ export const DocViewer = ({
|
|
|
64
66
|
onSuccess,
|
|
65
67
|
traceContext
|
|
66
68
|
}) => {
|
|
69
|
+
var _fileState$mimeType;
|
|
67
70
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
71
|
+
|
|
72
|
+
// Compute enableLazyPageRendering based on Excel file detection and feature gate
|
|
73
|
+
// Excel files are found to have 60K pages, because excel can have thousand of empty rows, JST-1296681
|
|
74
|
+
const isExcel = fileState.status !== 'error' && isExcelFile((_fileState$mimeType = fileState.mimeType) !== null && _fileState$mimeType !== void 0 ? _fileState$mimeType : '');
|
|
75
|
+
const enableLazyPageRendering = isExcel && fg('platform_media_excel_lazy_load');
|
|
68
76
|
const getContent = useStaticCallback(async (pageStart, pageEnd) => {
|
|
69
77
|
try {
|
|
70
78
|
return await mediaClient.mediaStore.getDocumentContent(fileState.id, {
|
|
@@ -152,7 +160,8 @@ export const DocViewer = ({
|
|
|
152
160
|
getContent: getContent,
|
|
153
161
|
getPageImageUrl: getPageImageUrl,
|
|
154
162
|
zoom: state.zoomLevel.value,
|
|
155
|
-
onSuccess: onSuccessHandler
|
|
163
|
+
onSuccess: onSuccessHandler,
|
|
164
|
+
enableLazyPageRendering: enableLazyPageRendering
|
|
156
165
|
}), /*#__PURE__*/React.createElement(ZoomControls, {
|
|
157
166
|
onChange: onZoomChange,
|
|
158
167
|
zoomLevel: state.zoomLevel
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
var componentName = 'mediaViewer';
|
|
3
3
|
var packageName = "@atlaskit/media-viewer";
|
|
4
|
-
var packageVersion = "
|
|
4
|
+
var packageVersion = "53.1.1";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -6,7 +6,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
6
6
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
var packageName = "@atlaskit/media-viewer";
|
|
9
|
-
var packageVersion = "
|
|
9
|
+
var packageVersion = "53.1.1";
|
|
10
10
|
var ufoExperience;
|
|
11
11
|
var getExperience = function getExperience() {
|
|
12
12
|
if (!ufoExperience) {
|
|
@@ -11,11 +11,13 @@ import React, { useReducer } from 'react';
|
|
|
11
11
|
import { isCommonMediaClientError } from '@atlaskit/media-client';
|
|
12
12
|
import { DOCUMENT_SCROLL_ROOT_ID, DocumentViewer } from '@atlaskit/media-document-viewer';
|
|
13
13
|
import { useStaticCallback } from '@atlaskit/media-common';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { MediaViewerError } from '../../errors';
|
|
15
16
|
import { ZoomControls } from '../../zoomControls';
|
|
16
17
|
import { ZoomLevel } from '../../domain/zoomLevel';
|
|
17
18
|
import { PasswordInput } from './passwordInput';
|
|
18
19
|
import Spinner from '@atlaskit/spinner';
|
|
20
|
+
import { isExcelFile } from '@atlaskit/media-common/mediaTypeUtils';
|
|
19
21
|
var initialState = {
|
|
20
22
|
isMissingPassword: false,
|
|
21
23
|
hasPasswordError: false,
|
|
@@ -57,6 +59,7 @@ var reducer = function reducer(state, action) {
|
|
|
57
59
|
var documentViewerStyles = null;
|
|
58
60
|
var spinnerStyles = null;
|
|
59
61
|
export var DocViewer = function DocViewer(_ref) {
|
|
62
|
+
var _fileState$mimeType;
|
|
60
63
|
var mediaClient = _ref.mediaClient,
|
|
61
64
|
fileState = _ref.fileState,
|
|
62
65
|
collectionName = _ref.collectionName,
|
|
@@ -67,6 +70,11 @@ export var DocViewer = function DocViewer(_ref) {
|
|
|
67
70
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
68
71
|
state = _useReducer2[0],
|
|
69
72
|
dispatch = _useReducer2[1];
|
|
73
|
+
|
|
74
|
+
// Compute enableLazyPageRendering based on Excel file detection and feature gate
|
|
75
|
+
// Excel files are found to have 60K pages, because excel can have thousand of empty rows, JST-1296681
|
|
76
|
+
var isExcel = fileState.status !== 'error' && isExcelFile((_fileState$mimeType = fileState.mimeType) !== null && _fileState$mimeType !== void 0 ? _fileState$mimeType : '');
|
|
77
|
+
var enableLazyPageRendering = isExcel && fg('platform_media_excel_lazy_load');
|
|
70
78
|
var getContent = useStaticCallback( /*#__PURE__*/function () {
|
|
71
79
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(pageStart, pageEnd) {
|
|
72
80
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -205,7 +213,8 @@ export var DocViewer = function DocViewer(_ref) {
|
|
|
205
213
|
getContent: getContent,
|
|
206
214
|
getPageImageUrl: getPageImageUrl,
|
|
207
215
|
zoom: state.zoomLevel.value,
|
|
208
|
-
onSuccess: onSuccessHandler
|
|
216
|
+
onSuccess: onSuccessHandler,
|
|
217
|
+
enableLazyPageRendering: enableLazyPageRendering
|
|
209
218
|
}), /*#__PURE__*/React.createElement(ZoomControls, {
|
|
210
219
|
onChange: onZoomChange,
|
|
211
220
|
zoomLevel: state.zoomLevel
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "53.
|
|
3
|
+
"version": "53.2.0",
|
|
4
4
|
"description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@atlaskit/css": "^0.19.0",
|
|
38
38
|
"@atlaskit/form": "^15.5.0",
|
|
39
39
|
"@atlaskit/heading": "^5.4.0",
|
|
40
|
-
"@atlaskit/icon": "^34.
|
|
40
|
+
"@atlaskit/icon": "^34.4.0",
|
|
41
41
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
42
|
-
"@atlaskit/icon-lab": "^6.
|
|
42
|
+
"@atlaskit/icon-lab": "^6.7.0",
|
|
43
43
|
"@atlaskit/media-client": "^36.1.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^5.1.0",
|
|
45
|
-
"@atlaskit/media-common": "^13.
|
|
46
|
-
"@atlaskit/media-document-viewer": "^0.
|
|
45
|
+
"@atlaskit/media-common": "^13.3.0",
|
|
46
|
+
"@atlaskit/media-document-viewer": "^0.7.0",
|
|
47
47
|
"@atlaskit/media-svg": "^2.3.0",
|
|
48
|
-
"@atlaskit/media-ui": "^29.
|
|
48
|
+
"@atlaskit/media-ui": "^29.2.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/portal": "^5.5.0",
|
|
51
51
|
"@atlaskit/primitives": "^19.0.0",
|
|
@@ -136,6 +136,9 @@
|
|
|
136
136
|
},
|
|
137
137
|
"platform_media_a11y_suppression_fixes": {
|
|
138
138
|
"type": "boolean"
|
|
139
|
+
},
|
|
140
|
+
"platform_media_excel_lazy_load": {
|
|
141
|
+
"type": "boolean"
|
|
139
142
|
}
|
|
140
143
|
},
|
|
141
144
|
"techstack": {
|