@atlaskit/media-viewer 49.5.3 → 49.6.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 +15 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/components/media-viewer-loader.js +5 -0
- package/dist/cjs/components/portal.js +21 -0
- package/dist/cjs/download.js +64 -37
- package/dist/cjs/errorMessage.js +7 -3
- package/dist/cjs/index.js +10 -2
- package/dist/cjs/styleWrappers.js +2 -0
- package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +1 -0
- package/dist/cjs/viewers/doc/pdfRenderer.js +1 -0
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/components/media-viewer-loader.js +4 -0
- package/dist/es2019/components/portal.js +12 -0
- package/dist/es2019/download.js +60 -34
- package/dist/es2019/errorMessage.js +4 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/styleWrappers.js +2 -0
- package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +1 -0
- package/dist/es2019/viewers/doc/pdfRenderer.js +1 -0
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/components/media-viewer-loader.js +4 -0
- package/dist/esm/components/portal.js +14 -0
- package/dist/esm/download.js +65 -38
- package/dist/esm/errorMessage.js +7 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/styleWrappers.js +2 -0
- package/dist/esm/viewers/archiveSidebar/styleWrappers.js +1 -0
- package/dist/esm/viewers/doc/pdfRenderer.js +1 -0
- package/dist/types/components/media-viewer-loader.d.ts +1 -0
- package/dist/types/components/portal.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/components/media-viewer-loader.d.ts +1 -0
- package/dist/types-ts4.5/components/portal.d.ts +4 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 49.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#97492](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97492)
|
|
8
|
+
[`5195c4fd974a3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5195c4fd974a3) -
|
|
9
|
+
Integrated warning modal dialog to prevent against abuse-classified file downloads.
|
|
10
|
+
|
|
11
|
+
Exported MediaViewerWithPortal implementing internal DS Portal, for correct integration with DS
|
|
12
|
+
Modal.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 49.5.3
|
|
4
19
|
|
|
5
20
|
### 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 = "49.
|
|
13
|
+
var packageVersion = exports.packageVersion = "49.6.0";
|
|
14
14
|
function getFileAttributes(fileState) {
|
|
15
15
|
if (!fileState) {
|
|
16
16
|
return {
|
|
@@ -12,7 +12,7 @@ var _mediaCommon = require("@atlaskit/media-common");
|
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
var packageName = "@atlaskit/media-viewer";
|
|
15
|
-
var packageVersion = "49.
|
|
15
|
+
var packageVersion = "49.6.0";
|
|
16
16
|
var ufoExperience;
|
|
17
17
|
var getExperience = function getExperience() {
|
|
18
18
|
if (!ufoExperience) {
|
|
@@ -4,10 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.MediaViewerWithPortal = MediaViewerWithPortal;
|
|
7
8
|
exports.default = AsyncMediaViewer;
|
|
8
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _modalSpinner = _interopRequireDefault(require("../viewers/modalSpinner"));
|
|
12
|
+
var _portal = require("./portal");
|
|
11
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
15
|
var MediaViewer = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
@@ -24,4 +26,7 @@ function AsyncMediaViewer(props) {
|
|
|
24
26
|
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
25
27
|
fallback: /*#__PURE__*/_react.default.createElement(_modalSpinner.default, null)
|
|
26
28
|
}, /*#__PURE__*/_react.default.createElement(MediaViewer, props));
|
|
29
|
+
}
|
|
30
|
+
function MediaViewerWithPortal(props) {
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_portal.MediaViewerPortal, null, /*#__PURE__*/_react.default.createElement(AsyncMediaViewer, props));
|
|
27
32
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.MediaViewerPortal = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _portal = _interopRequireDefault(require("@atlaskit/portal"));
|
|
10
|
+
var MediaViewerPortal = exports.MediaViewerPortal = function MediaViewerPortal(_ref) {
|
|
11
|
+
var children = _ref.children;
|
|
12
|
+
return (
|
|
13
|
+
/*#__PURE__*/
|
|
14
|
+
// This zIndex matches with zIndex used by DS Modal and Jira Issue View Modal.
|
|
15
|
+
// This value makes layers stack work correctly:
|
|
16
|
+
// -> Issue View -> Media Viewer -> DS Modal
|
|
17
|
+
_react.default.createElement(_portal.default, {
|
|
18
|
+
zIndex: 510
|
|
19
|
+
}, children)
|
|
20
|
+
);
|
|
21
|
+
};
|
package/dist/cjs/download.js
CHANGED
|
@@ -23,6 +23,7 @@ var _failedPreviewDownloadButtonClicked = require("./analytics/events/ui/failedP
|
|
|
23
23
|
var _styleWrappers = require("./styleWrappers");
|
|
24
24
|
var _errors = require("./errors");
|
|
25
25
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
26
|
+
var _abuseModal = require("@atlaskit/media-ui/abuseModal");
|
|
26
27
|
var _excluded = ["analyticspayload", "onClick", "tooltip"];
|
|
27
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -84,59 +85,85 @@ var useDownloadButtonDisabledProps = function useDownloadButtonDisabledProps(med
|
|
|
84
85
|
tooltip: tooltip
|
|
85
86
|
};
|
|
86
87
|
};
|
|
87
|
-
var
|
|
88
|
-
var
|
|
88
|
+
var DownloadItem = function DownloadItem(_ref3) {
|
|
89
|
+
var testId = _ref3.testId,
|
|
90
|
+
fileState = _ref3.fileState,
|
|
89
91
|
mediaClient = _ref3.mediaClient,
|
|
90
|
-
|
|
92
|
+
collectionName = _ref3.collectionName,
|
|
93
|
+
appearance = _ref3.appearance,
|
|
94
|
+
analyticspayload = _ref3.analyticspayload,
|
|
91
95
|
traceContext = _ref3.traceContext,
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
iconBefore = _ref3.iconBefore,
|
|
97
|
+
children = _ref3.children;
|
|
98
|
+
var openModalRef = /*#__PURE__*/(0, _react.createRef)();
|
|
94
99
|
var _useAnalyticsEvents2 = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
95
100
|
createAnalyticsEvent = _useAnalyticsEvents2.createAnalyticsEvent;
|
|
96
101
|
var _useDownloadButtonDis = useDownloadButtonDisabledProps(mediaClient),
|
|
97
102
|
isDisabled = _useDownloadButtonDis.isDisabled,
|
|
98
103
|
tooltip = _useDownloadButtonDis.tooltip;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
var shouldRenderAbuseModal = !(0, _mediaClient.isErrorFileState)(fileState) && !!fileState.abuseClassification;
|
|
105
|
+
var itemDownloader = createItemDownloader(fileState, mediaClient, {
|
|
106
|
+
collectionName: collectionName,
|
|
107
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
108
|
+
traceContext: traceContext
|
|
109
|
+
});
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_abuseModal.AbuseModal, {
|
|
111
|
+
ref: openModalRef,
|
|
112
|
+
shouldMount: shouldRenderAbuseModal,
|
|
113
|
+
onConfirm: itemDownloader
|
|
114
|
+
}), /*#__PURE__*/_react.default.createElement(DownloadButton, {
|
|
115
|
+
testId: testId,
|
|
116
|
+
appearance: appearance,
|
|
117
|
+
analyticspayload: analyticspayload,
|
|
105
118
|
isDisabled: isDisabled,
|
|
106
119
|
tooltip: tooltip,
|
|
107
|
-
onClick:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
onClick: function onClick() {
|
|
121
|
+
if (shouldRenderAbuseModal) {
|
|
122
|
+
var _openModalRef$current;
|
|
123
|
+
(_openModalRef$current = openModalRef.current) === null || _openModalRef$current === void 0 || _openModalRef$current.call(openModalRef);
|
|
124
|
+
} else {
|
|
125
|
+
itemDownloader();
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
iconBefore: iconBefore
|
|
129
|
+
}, children));
|
|
113
130
|
};
|
|
114
|
-
var
|
|
115
|
-
var
|
|
131
|
+
var ErrorViewDownloadButton = exports.ErrorViewDownloadButton = function ErrorViewDownloadButton(_ref4) {
|
|
132
|
+
var fileState = _ref4.fileState,
|
|
116
133
|
mediaClient = _ref4.mediaClient,
|
|
117
|
-
|
|
118
|
-
traceContext = _ref4.traceContext
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
error = _ref4.error,
|
|
135
|
+
traceContext = _ref4.traceContext,
|
|
136
|
+
collectionName = _ref4.collectionName;
|
|
137
|
+
var downloadEvent = (0, _failedPreviewDownloadButtonClicked.createFailedPreviewDownloadButtonClickedEvent)(fileState, error);
|
|
138
|
+
var testId = 'media-viewer-error-download-button';
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement(_styleWrappers.DownloadButtonWrapper, null, /*#__PURE__*/_react.default.createElement(DownloadItem, {
|
|
140
|
+
testId: testId,
|
|
141
|
+
analyticspayload: downloadEvent,
|
|
142
|
+
appearance: "primary",
|
|
143
|
+
fileState: fileState,
|
|
144
|
+
mediaClient: mediaClient,
|
|
145
|
+
collectionName: collectionName,
|
|
146
|
+
traceContext: traceContext
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _mediaUi.messages.download)));
|
|
148
|
+
};
|
|
149
|
+
var ToolbarDownloadButton = exports.ToolbarDownloadButton = function ToolbarDownloadButton(_ref5) {
|
|
150
|
+
var state = _ref5.state,
|
|
151
|
+
mediaClient = _ref5.mediaClient,
|
|
152
|
+
identifier = _ref5.identifier,
|
|
153
|
+
traceContext = _ref5.traceContext;
|
|
126
154
|
// TODO [MS-1731]: make it work for external files as well
|
|
127
155
|
if ((0, _mediaClient.isExternalImageIdentifier)(identifier)) {
|
|
128
156
|
return null;
|
|
129
157
|
}
|
|
130
|
-
|
|
131
|
-
|
|
158
|
+
var downloadEvent = (0, _downloadButtonClicked.createDownloadButtonClickedEvent)(state);
|
|
159
|
+
var testId = 'media-viewer-download-button';
|
|
160
|
+
return /*#__PURE__*/_react.default.createElement(DownloadItem, {
|
|
161
|
+
testId: testId,
|
|
132
162
|
analyticspayload: downloadEvent,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
138
|
-
traceContext: traceContext
|
|
139
|
-
}),
|
|
163
|
+
fileState: state,
|
|
164
|
+
mediaClient: mediaClient,
|
|
165
|
+
collectionName: identifier.collectionName,
|
|
166
|
+
traceContext: traceContext,
|
|
140
167
|
iconBefore: downloadIcon
|
|
141
168
|
});
|
|
142
169
|
};
|
package/dist/cjs/errorMessage.js
CHANGED
|
@@ -92,9 +92,13 @@ var ErrorMessage = exports.ErrorMessage = /*#__PURE__*/function (_React$Componen
|
|
|
92
92
|
return /*#__PURE__*/_react.default.createElement(_styleWrappers.ErrorMessageWrapper, {
|
|
93
93
|
"data-testid": "media-viewer-error"
|
|
94
94
|
}, /*#__PURE__*/_react.default.createElement("div", null, errorInfo.icon, errorInfo.messages.map(function (formatMessage, i) {
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
return (
|
|
96
|
+
/*#__PURE__*/
|
|
97
|
+
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
98
|
+
_react.default.createElement("p", {
|
|
99
|
+
key: "p".concat(i)
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, formatMessage))
|
|
101
|
+
);
|
|
98
102
|
})), this.props.children);
|
|
99
103
|
}
|
|
100
104
|
}], [{
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -10,4 +10,12 @@ Object.defineProperty(exports, "MediaViewer", {
|
|
|
10
10
|
return _mediaViewerLoader.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
Object.defineProperty(exports, "MediaViewerWithPortal", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _mediaViewerLoader.MediaViewerWithPortal;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _mediaViewerLoader = _interopRequireWildcard(require("./components/media-viewer-loader"));
|
|
20
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -117,6 +117,7 @@ var zoomRightControlsStyles = (0, _react.css)({
|
|
|
117
117
|
});
|
|
118
118
|
var zoomLevelIndicatorStyles = (0, _react.css)({
|
|
119
119
|
height: '32px',
|
|
120
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
120
121
|
lineHeight: '32px',
|
|
121
122
|
verticalAlign: 'middle'
|
|
122
123
|
});
|
|
@@ -137,6 +138,7 @@ var errorMessageWrapperStyles = (0, _react.css)({
|
|
|
137
138
|
color: '#c7d1db',
|
|
138
139
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
139
140
|
p: {
|
|
141
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
140
142
|
lineHeight: '100%'
|
|
141
143
|
}
|
|
142
144
|
});
|
|
@@ -111,6 +111,7 @@ var sidebarHeaderEntryStyles = (0, _react.css)({
|
|
|
111
111
|
overflow: 'hidden',
|
|
112
112
|
textOverflow: 'ellipsis',
|
|
113
113
|
whiteSpace: 'nowrap',
|
|
114
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
114
115
|
lineHeight: 1.14286,
|
|
115
116
|
color: "var(--ds-text, ".concat(_colors.DN500, ")")
|
|
116
117
|
});
|
|
@@ -62,6 +62,7 @@ var globalStyles = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat
|
|
|
62
62
|
bottom: 0,
|
|
63
63
|
overflow: 'hidden',
|
|
64
64
|
opacity: 0.2,
|
|
65
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
65
66
|
lineHeight: 1
|
|
66
67
|
},
|
|
67
68
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -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 = "49.
|
|
4
|
+
const packageVersion = "49.6.0";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -2,7 +2,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
2
2
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
3
3
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
4
4
|
const packageName = "@atlaskit/media-viewer";
|
|
5
|
-
const packageVersion = "49.
|
|
5
|
+
const packageVersion = "49.6.0";
|
|
6
6
|
let ufoExperience;
|
|
7
7
|
const getExperience = () => {
|
|
8
8
|
if (!ufoExperience) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import ModalSpinner from '../viewers/modalSpinner';
|
|
3
|
+
import { MediaViewerPortal } from './portal';
|
|
3
4
|
const MediaViewer = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-internal_media-viewer" */'./media-viewer-error-boundary').then(({
|
|
4
5
|
MediaViewerWithErrorBoundary
|
|
5
6
|
}) => ({
|
|
@@ -9,4 +10,7 @@ export default function AsyncMediaViewer(props) {
|
|
|
9
10
|
return /*#__PURE__*/React.createElement(Suspense, {
|
|
10
11
|
fallback: /*#__PURE__*/React.createElement(ModalSpinner, null)
|
|
11
12
|
}, /*#__PURE__*/React.createElement(MediaViewer, props));
|
|
13
|
+
}
|
|
14
|
+
export function MediaViewerWithPortal(props) {
|
|
15
|
+
return /*#__PURE__*/React.createElement(MediaViewerPortal, null, /*#__PURE__*/React.createElement(AsyncMediaViewer, props));
|
|
12
16
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Portal from '@atlaskit/portal';
|
|
3
|
+
export const MediaViewerPortal = ({
|
|
4
|
+
children
|
|
5
|
+
}) =>
|
|
6
|
+
/*#__PURE__*/
|
|
7
|
+
// This zIndex matches with zIndex used by DS Modal and Jira Issue View Modal.
|
|
8
|
+
// This value makes layers stack work correctly:
|
|
9
|
+
// -> Issue View -> Media Viewer -> DS Modal
|
|
10
|
+
React.createElement(Portal, {
|
|
11
|
+
zIndex: 510
|
|
12
|
+
}, children);
|
package/dist/es2019/download.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
4
4
|
import { isErrorFileState, isExternalImageIdentifier } from '@atlaskit/media-client';
|
|
5
5
|
import { MediaButton, messages } from '@atlaskit/media-ui';
|
|
6
|
-
import React, { useCallback } from 'react';
|
|
6
|
+
import React, { createRef, useCallback } from 'react';
|
|
7
7
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
8
8
|
import { createDownloadButtonClickedEvent } from './analytics/events/ui/downloadButtonClicked';
|
|
9
9
|
import { createDownloadFailedEventPayload, createDownloadSucceededEventPayload } from './analytics/events/operational/download';
|
|
@@ -12,6 +12,7 @@ import { createFailedPreviewDownloadButtonClickedEvent } from './analytics/event
|
|
|
12
12
|
import { DownloadButtonWrapper } from './styleWrappers';
|
|
13
13
|
import { MediaViewerError } from './errors';
|
|
14
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
|
+
import { AbuseModal } from '@atlaskit/media-ui/abuseModal';
|
|
15
16
|
const downloadIcon = /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
16
17
|
color: "currentColor",
|
|
17
18
|
spacing: "spacious",
|
|
@@ -65,14 +66,18 @@ const useDownloadButtonDisabledProps = mediaClient => {
|
|
|
65
66
|
tooltip
|
|
66
67
|
};
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
+
const DownloadItem = ({
|
|
70
|
+
testId,
|
|
69
71
|
fileState,
|
|
70
72
|
mediaClient,
|
|
71
|
-
|
|
73
|
+
collectionName,
|
|
74
|
+
appearance,
|
|
75
|
+
analyticspayload,
|
|
72
76
|
traceContext,
|
|
73
|
-
|
|
77
|
+
iconBefore,
|
|
78
|
+
children
|
|
74
79
|
}) => {
|
|
75
|
-
const
|
|
80
|
+
const openModalRef = /*#__PURE__*/createRef();
|
|
76
81
|
const {
|
|
77
82
|
createAnalyticsEvent
|
|
78
83
|
} = useAnalyticsEvents();
|
|
@@ -80,19 +85,50 @@ export const ErrorViewDownloadButton = ({
|
|
|
80
85
|
isDisabled,
|
|
81
86
|
tooltip
|
|
82
87
|
} = useDownloadButtonDisabledProps(mediaClient);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
const shouldRenderAbuseModal = !isErrorFileState(fileState) && !!fileState.abuseClassification;
|
|
89
|
+
const itemDownloader = createItemDownloader(fileState, mediaClient, {
|
|
90
|
+
collectionName: collectionName,
|
|
91
|
+
createAnalyticsEvent,
|
|
92
|
+
traceContext
|
|
93
|
+
});
|
|
94
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AbuseModal, {
|
|
95
|
+
ref: openModalRef,
|
|
96
|
+
shouldMount: shouldRenderAbuseModal,
|
|
97
|
+
onConfirm: itemDownloader
|
|
98
|
+
}), /*#__PURE__*/React.createElement(DownloadButton, {
|
|
99
|
+
testId: testId,
|
|
100
|
+
appearance: appearance,
|
|
101
|
+
analyticspayload: analyticspayload,
|
|
89
102
|
isDisabled: isDisabled,
|
|
90
103
|
tooltip: tooltip,
|
|
91
|
-
onClick:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
onClick: () => {
|
|
105
|
+
if (shouldRenderAbuseModal) {
|
|
106
|
+
var _openModalRef$current;
|
|
107
|
+
(_openModalRef$current = openModalRef.current) === null || _openModalRef$current === void 0 ? void 0 : _openModalRef$current.call(openModalRef);
|
|
108
|
+
} else {
|
|
109
|
+
itemDownloader();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
iconBefore: iconBefore
|
|
113
|
+
}, children));
|
|
114
|
+
};
|
|
115
|
+
export const ErrorViewDownloadButton = ({
|
|
116
|
+
fileState,
|
|
117
|
+
mediaClient,
|
|
118
|
+
error,
|
|
119
|
+
traceContext,
|
|
120
|
+
collectionName
|
|
121
|
+
}) => {
|
|
122
|
+
const downloadEvent = createFailedPreviewDownloadButtonClickedEvent(fileState, error);
|
|
123
|
+
const testId = 'media-viewer-error-download-button';
|
|
124
|
+
return /*#__PURE__*/React.createElement(DownloadButtonWrapper, null, /*#__PURE__*/React.createElement(DownloadItem, {
|
|
125
|
+
testId: testId,
|
|
126
|
+
analyticspayload: downloadEvent,
|
|
127
|
+
appearance: "primary",
|
|
128
|
+
fileState: fileState,
|
|
129
|
+
mediaClient: mediaClient,
|
|
130
|
+
collectionName: collectionName,
|
|
131
|
+
traceContext: traceContext
|
|
96
132
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.download)));
|
|
97
133
|
};
|
|
98
134
|
export const ToolbarDownloadButton = ({
|
|
@@ -101,29 +137,19 @@ export const ToolbarDownloadButton = ({
|
|
|
101
137
|
identifier,
|
|
102
138
|
traceContext
|
|
103
139
|
}) => {
|
|
104
|
-
const {
|
|
105
|
-
createAnalyticsEvent
|
|
106
|
-
} = useAnalyticsEvents();
|
|
107
|
-
const downloadEvent = createDownloadButtonClickedEvent(state);
|
|
108
|
-
const {
|
|
109
|
-
isDisabled,
|
|
110
|
-
tooltip
|
|
111
|
-
} = useDownloadButtonDisabledProps(mediaClient);
|
|
112
|
-
|
|
113
140
|
// TODO [MS-1731]: make it work for external files as well
|
|
114
141
|
if (isExternalImageIdentifier(identifier)) {
|
|
115
142
|
return null;
|
|
116
143
|
}
|
|
117
|
-
|
|
118
|
-
|
|
144
|
+
const downloadEvent = createDownloadButtonClickedEvent(state);
|
|
145
|
+
const testId = 'media-viewer-download-button';
|
|
146
|
+
return /*#__PURE__*/React.createElement(DownloadItem, {
|
|
147
|
+
testId: testId,
|
|
119
148
|
analyticspayload: downloadEvent,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
createAnalyticsEvent,
|
|
125
|
-
traceContext
|
|
126
|
-
}),
|
|
149
|
+
fileState: state,
|
|
150
|
+
mediaClient: mediaClient,
|
|
151
|
+
collectionName: identifier.collectionName,
|
|
152
|
+
traceContext: traceContext,
|
|
127
153
|
iconBefore: downloadIcon
|
|
128
154
|
});
|
|
129
155
|
};
|
|
@@ -75,7 +75,10 @@ export class ErrorMessage extends React.Component {
|
|
|
75
75
|
const errorInfo = this.getErrorInfo();
|
|
76
76
|
return /*#__PURE__*/React.createElement(ErrorMessageWrapper, {
|
|
77
77
|
"data-testid": "media-viewer-error"
|
|
78
|
-
}, /*#__PURE__*/React.createElement("div", null, errorInfo.icon, errorInfo.messages.map((formatMessage, i) =>
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", null, errorInfo.icon, errorInfo.messages.map((formatMessage, i) =>
|
|
79
|
+
/*#__PURE__*/
|
|
80
|
+
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
81
|
+
React.createElement("p", {
|
|
79
82
|
key: `p${i}`
|
|
80
83
|
}, /*#__PURE__*/React.createElement(FormattedMessage, formatMessage)))), this.props.children);
|
|
81
84
|
}
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as MediaViewer } from './components/media-viewer-loader';
|
|
1
|
+
export { default as MediaViewer, MediaViewerWithPortal } from './components/media-viewer-loader';
|
|
@@ -106,6 +106,7 @@ const zoomRightControlsStyles = css({
|
|
|
106
106
|
});
|
|
107
107
|
const zoomLevelIndicatorStyles = css({
|
|
108
108
|
height: '32px',
|
|
109
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
109
110
|
lineHeight: '32px',
|
|
110
111
|
verticalAlign: 'middle'
|
|
111
112
|
});
|
|
@@ -126,6 +127,7 @@ const errorMessageWrapperStyles = css({
|
|
|
126
127
|
color: '#c7d1db',
|
|
127
128
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
128
129
|
p: {
|
|
130
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
129
131
|
lineHeight: '100%'
|
|
130
132
|
}
|
|
131
133
|
});
|
|
@@ -104,6 +104,7 @@ const sidebarHeaderEntryStyles = css({
|
|
|
104
104
|
overflow: 'hidden',
|
|
105
105
|
textOverflow: 'ellipsis',
|
|
106
106
|
whiteSpace: 'nowrap',
|
|
107
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
107
108
|
lineHeight: 1.14286,
|
|
108
109
|
color: `var(--ds-text, ${DN500})`
|
|
109
110
|
});
|
|
@@ -47,6 +47,7 @@ const globalStyles = css({
|
|
|
47
47
|
bottom: 0,
|
|
48
48
|
overflow: 'hidden',
|
|
49
49
|
opacity: 0.2,
|
|
50
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
50
51
|
lineHeight: 1
|
|
51
52
|
},
|
|
52
53
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -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 = "49.
|
|
4
|
+
var packageVersion = "49.6.0";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -5,7 +5,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
7
7
|
var packageName = "@atlaskit/media-viewer";
|
|
8
|
-
var packageVersion = "49.
|
|
8
|
+
var packageVersion = "49.6.0";
|
|
9
9
|
var ufoExperience;
|
|
10
10
|
var getExperience = function getExperience() {
|
|
11
11
|
if (!ufoExperience) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import ModalSpinner from '../viewers/modalSpinner';
|
|
3
|
+
import { MediaViewerPortal } from './portal';
|
|
3
4
|
var MediaViewer = /*#__PURE__*/lazy(function () {
|
|
4
5
|
return import( /* webpackChunkName: "@atlaskit-internal_media-viewer" */'./media-viewer-error-boundary').then(function (_ref) {
|
|
5
6
|
var MediaViewerWithErrorBoundary = _ref.MediaViewerWithErrorBoundary;
|
|
@@ -12,4 +13,7 @@ export default function AsyncMediaViewer(props) {
|
|
|
12
13
|
return /*#__PURE__*/React.createElement(Suspense, {
|
|
13
14
|
fallback: /*#__PURE__*/React.createElement(ModalSpinner, null)
|
|
14
15
|
}, /*#__PURE__*/React.createElement(MediaViewer, props));
|
|
16
|
+
}
|
|
17
|
+
export function MediaViewerWithPortal(props) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(MediaViewerPortal, null, /*#__PURE__*/React.createElement(AsyncMediaViewer, props));
|
|
15
19
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Portal from '@atlaskit/portal';
|
|
3
|
+
export var MediaViewerPortal = function MediaViewerPortal(_ref) {
|
|
4
|
+
var children = _ref.children;
|
|
5
|
+
return (
|
|
6
|
+
/*#__PURE__*/
|
|
7
|
+
// This zIndex matches with zIndex used by DS Modal and Jira Issue View Modal.
|
|
8
|
+
// This value makes layers stack work correctly:
|
|
9
|
+
// -> Issue View -> Media Viewer -> DS Modal
|
|
10
|
+
React.createElement(Portal, {
|
|
11
|
+
zIndex: 510
|
|
12
|
+
}, children)
|
|
13
|
+
);
|
|
14
|
+
};
|
package/dist/esm/download.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
7
7
|
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
8
8
|
import { isErrorFileState, isExternalImageIdentifier } from '@atlaskit/media-client';
|
|
9
9
|
import { MediaButton, messages } from '@atlaskit/media-ui';
|
|
10
|
-
import React, { useCallback } from 'react';
|
|
10
|
+
import React, { createRef, useCallback } from 'react';
|
|
11
11
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
12
12
|
import { createDownloadButtonClickedEvent } from './analytics/events/ui/downloadButtonClicked';
|
|
13
13
|
import { createDownloadFailedEventPayload, createDownloadSucceededEventPayload } from './analytics/events/operational/download';
|
|
@@ -16,6 +16,7 @@ import { createFailedPreviewDownloadButtonClickedEvent } from './analytics/event
|
|
|
16
16
|
import { DownloadButtonWrapper } from './styleWrappers';
|
|
17
17
|
import { MediaViewerError } from './errors';
|
|
18
18
|
import Tooltip from '@atlaskit/tooltip';
|
|
19
|
+
import { AbuseModal } from '@atlaskit/media-ui/abuseModal';
|
|
19
20
|
var downloadIcon = /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
20
21
|
color: "currentColor",
|
|
21
22
|
spacing: "spacious",
|
|
@@ -74,59 +75,85 @@ var useDownloadButtonDisabledProps = function useDownloadButtonDisabledProps(med
|
|
|
74
75
|
tooltip: tooltip
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
-
var
|
|
78
|
+
var DownloadItem = function DownloadItem(_ref3) {
|
|
79
|
+
var testId = _ref3.testId,
|
|
80
|
+
fileState = _ref3.fileState,
|
|
79
81
|
mediaClient = _ref3.mediaClient,
|
|
80
|
-
|
|
82
|
+
collectionName = _ref3.collectionName,
|
|
83
|
+
appearance = _ref3.appearance,
|
|
84
|
+
analyticspayload = _ref3.analyticspayload,
|
|
81
85
|
traceContext = _ref3.traceContext,
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
iconBefore = _ref3.iconBefore,
|
|
87
|
+
children = _ref3.children;
|
|
88
|
+
var openModalRef = /*#__PURE__*/createRef();
|
|
84
89
|
var _useAnalyticsEvents2 = useAnalyticsEvents(),
|
|
85
90
|
createAnalyticsEvent = _useAnalyticsEvents2.createAnalyticsEvent;
|
|
86
91
|
var _useDownloadButtonDis = useDownloadButtonDisabledProps(mediaClient),
|
|
87
92
|
isDisabled = _useDownloadButtonDis.isDisabled,
|
|
88
93
|
tooltip = _useDownloadButtonDis.tooltip;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
var shouldRenderAbuseModal = !isErrorFileState(fileState) && !!fileState.abuseClassification;
|
|
95
|
+
var itemDownloader = createItemDownloader(fileState, mediaClient, {
|
|
96
|
+
collectionName: collectionName,
|
|
97
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
98
|
+
traceContext: traceContext
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AbuseModal, {
|
|
101
|
+
ref: openModalRef,
|
|
102
|
+
shouldMount: shouldRenderAbuseModal,
|
|
103
|
+
onConfirm: itemDownloader
|
|
104
|
+
}), /*#__PURE__*/React.createElement(DownloadButton, {
|
|
105
|
+
testId: testId,
|
|
106
|
+
appearance: appearance,
|
|
107
|
+
analyticspayload: analyticspayload,
|
|
95
108
|
isDisabled: isDisabled,
|
|
96
109
|
tooltip: tooltip,
|
|
97
|
-
onClick:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
onClick: function onClick() {
|
|
111
|
+
if (shouldRenderAbuseModal) {
|
|
112
|
+
var _openModalRef$current;
|
|
113
|
+
(_openModalRef$current = openModalRef.current) === null || _openModalRef$current === void 0 || _openModalRef$current.call(openModalRef);
|
|
114
|
+
} else {
|
|
115
|
+
itemDownloader();
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
iconBefore: iconBefore
|
|
119
|
+
}, children));
|
|
103
120
|
};
|
|
104
|
-
export var
|
|
105
|
-
var
|
|
121
|
+
export var ErrorViewDownloadButton = function ErrorViewDownloadButton(_ref4) {
|
|
122
|
+
var fileState = _ref4.fileState,
|
|
106
123
|
mediaClient = _ref4.mediaClient,
|
|
107
|
-
|
|
108
|
-
traceContext = _ref4.traceContext
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
124
|
+
error = _ref4.error,
|
|
125
|
+
traceContext = _ref4.traceContext,
|
|
126
|
+
collectionName = _ref4.collectionName;
|
|
127
|
+
var downloadEvent = createFailedPreviewDownloadButtonClickedEvent(fileState, error);
|
|
128
|
+
var testId = 'media-viewer-error-download-button';
|
|
129
|
+
return /*#__PURE__*/React.createElement(DownloadButtonWrapper, null, /*#__PURE__*/React.createElement(DownloadItem, {
|
|
130
|
+
testId: testId,
|
|
131
|
+
analyticspayload: downloadEvent,
|
|
132
|
+
appearance: "primary",
|
|
133
|
+
fileState: fileState,
|
|
134
|
+
mediaClient: mediaClient,
|
|
135
|
+
collectionName: collectionName,
|
|
136
|
+
traceContext: traceContext
|
|
137
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.download)));
|
|
138
|
+
};
|
|
139
|
+
export var ToolbarDownloadButton = function ToolbarDownloadButton(_ref5) {
|
|
140
|
+
var state = _ref5.state,
|
|
141
|
+
mediaClient = _ref5.mediaClient,
|
|
142
|
+
identifier = _ref5.identifier,
|
|
143
|
+
traceContext = _ref5.traceContext;
|
|
116
144
|
// TODO [MS-1731]: make it work for external files as well
|
|
117
145
|
if (isExternalImageIdentifier(identifier)) {
|
|
118
146
|
return null;
|
|
119
147
|
}
|
|
120
|
-
|
|
121
|
-
|
|
148
|
+
var downloadEvent = createDownloadButtonClickedEvent(state);
|
|
149
|
+
var testId = 'media-viewer-download-button';
|
|
150
|
+
return /*#__PURE__*/React.createElement(DownloadItem, {
|
|
151
|
+
testId: testId,
|
|
122
152
|
analyticspayload: downloadEvent,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
128
|
-
traceContext: traceContext
|
|
129
|
-
}),
|
|
153
|
+
fileState: state,
|
|
154
|
+
mediaClient: mediaClient,
|
|
155
|
+
collectionName: identifier.collectionName,
|
|
156
|
+
traceContext: traceContext,
|
|
130
157
|
iconBefore: downloadIcon
|
|
131
158
|
});
|
|
132
159
|
};
|
package/dist/esm/errorMessage.js
CHANGED
|
@@ -85,9 +85,13 @@ export var ErrorMessage = /*#__PURE__*/function (_React$Component) {
|
|
|
85
85
|
return /*#__PURE__*/React.createElement(ErrorMessageWrapper, {
|
|
86
86
|
"data-testid": "media-viewer-error"
|
|
87
87
|
}, /*#__PURE__*/React.createElement("div", null, errorInfo.icon, errorInfo.messages.map(function (formatMessage, i) {
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return (
|
|
89
|
+
/*#__PURE__*/
|
|
90
|
+
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
91
|
+
React.createElement("p", {
|
|
92
|
+
key: "p".concat(i)
|
|
93
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, formatMessage))
|
|
94
|
+
);
|
|
91
95
|
})), this.props.children);
|
|
92
96
|
}
|
|
93
97
|
}], [{
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as MediaViewer } from './components/media-viewer-loader';
|
|
1
|
+
export { default as MediaViewer, MediaViewerWithPortal } from './components/media-viewer-loader';
|
|
@@ -109,6 +109,7 @@ var zoomRightControlsStyles = css({
|
|
|
109
109
|
});
|
|
110
110
|
var zoomLevelIndicatorStyles = css({
|
|
111
111
|
height: '32px',
|
|
112
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
112
113
|
lineHeight: '32px',
|
|
113
114
|
verticalAlign: 'middle'
|
|
114
115
|
});
|
|
@@ -129,6 +130,7 @@ var errorMessageWrapperStyles = css({
|
|
|
129
130
|
color: '#c7d1db',
|
|
130
131
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
131
132
|
p: {
|
|
133
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
132
134
|
lineHeight: '100%'
|
|
133
135
|
}
|
|
134
136
|
});
|
|
@@ -104,6 +104,7 @@ var sidebarHeaderEntryStyles = css({
|
|
|
104
104
|
overflow: 'hidden',
|
|
105
105
|
textOverflow: 'ellipsis',
|
|
106
106
|
whiteSpace: 'nowrap',
|
|
107
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
107
108
|
lineHeight: 1.14286,
|
|
108
109
|
color: "var(--ds-text, ".concat(DN500, ")")
|
|
109
110
|
});
|
|
@@ -51,6 +51,7 @@ var globalStyles = css(_defineProperty({}, ".".concat(pdfViewerClassName), {
|
|
|
51
51
|
bottom: 0,
|
|
52
52
|
overflow: 'hidden',
|
|
53
53
|
opacity: 0.2,
|
|
54
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
54
55
|
lineHeight: 1
|
|
55
56
|
},
|
|
56
57
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { MediaViewerWithMediaClientConfigProps } from './types';
|
|
3
3
|
export default function AsyncMediaViewer(props: MediaViewerWithMediaClientConfigProps): JSX.Element;
|
|
4
|
+
export declare function MediaViewerWithPortal(props: MediaViewerWithMediaClientConfigProps): JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as MediaViewer } from './components/media-viewer-loader';
|
|
1
|
+
export { default as MediaViewer, MediaViewerWithPortal } from './components/media-viewer-loader';
|
|
2
2
|
export type { MediaViewerExtensions, MediaViewerExtensionsActions, MediaViewerProps, MediaMessage, } from './components/types';
|
|
3
3
|
export type { ViewerOptionsProps, CustomRendererConfig, CustomRendererStateProps, CustomRendererProps, ArchiveFileItem, } from './viewerOptions';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { MediaViewerWithMediaClientConfigProps } from './types';
|
|
3
3
|
export default function AsyncMediaViewer(props: MediaViewerWithMediaClientConfigProps): JSX.Element;
|
|
4
|
+
export declare function MediaViewerWithPortal(props: MediaViewerWithMediaClientConfigProps): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as MediaViewer } from './components/media-viewer-loader';
|
|
1
|
+
export { default as MediaViewer, MediaViewerWithPortal } from './components/media-viewer-loader';
|
|
2
2
|
export type { MediaViewerExtensions, MediaViewerExtensionsActions, MediaViewerProps, MediaMessage, } from './components/types';
|
|
3
3
|
export type { ViewerOptionsProps, CustomRendererConfig, CustomRendererStateProps, CustomRendererProps, ArchiveFileItem, } from './viewerOptions';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "49.
|
|
3
|
+
"version": "49.6.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/"
|
|
@@ -38,14 +38,15 @@
|
|
|
38
38
|
"@atlaskit/button": "^20.3.0",
|
|
39
39
|
"@atlaskit/code": "^15.6.0",
|
|
40
40
|
"@atlaskit/form": "^11.0.0",
|
|
41
|
-
"@atlaskit/icon": "^23.
|
|
41
|
+
"@atlaskit/icon": "^23.2.0",
|
|
42
42
|
"@atlaskit/icon-file-type": "^6.8.0",
|
|
43
43
|
"@atlaskit/media-client": "^29.0.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.5.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.7.0",
|
|
46
46
|
"@atlaskit/media-svg": "^1.0.0",
|
|
47
|
-
"@atlaskit/media-ui": "^27.
|
|
47
|
+
"@atlaskit/media-ui": "^27.3.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
|
+
"@atlaskit/portal": "^4.10.0",
|
|
49
50
|
"@atlaskit/primitives": "^13.3.0",
|
|
50
51
|
"@atlaskit/side-navigation": "^3.6.0",
|
|
51
52
|
"@atlaskit/spinner": "^16.3.0",
|
|
@@ -78,8 +79,8 @@
|
|
|
78
79
|
"@af/visual-regression": "*",
|
|
79
80
|
"@atlaskit/media-core": "^34.4.0",
|
|
80
81
|
"@atlaskit/media-integration-test-helpers": "^3.1.0",
|
|
81
|
-
"@atlaskit/media-state": "^1.
|
|
82
|
-
"@atlaskit/media-test-data": "^2.
|
|
82
|
+
"@atlaskit/media-state": "^1.3.0",
|
|
83
|
+
"@atlaskit/media-test-data": "^2.8.0",
|
|
83
84
|
"@atlaskit/media-test-helpers": "^34.7.0",
|
|
84
85
|
"@atlaskit/ssr": "*",
|
|
85
86
|
"@atlaskit/toggle": "14.0.1",
|