@atlaskit/media-viewer 48.6.2 → 48.6.4

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/compass.yml +5 -4
  3. package/dist/cjs/analytics/index.js +1 -1
  4. package/dist/cjs/analytics/ufoExperiences.js +1 -1
  5. package/dist/cjs/item-viewer.js +2 -1
  6. package/dist/cjs/styleWrappers.js +66 -19
  7. package/dist/cjs/v2/item-viewer-v2.js +11 -9
  8. package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +4 -1
  9. package/dist/cjs/viewers/codeViewer/codeViewerRenderer.js +5 -2
  10. package/dist/cjs/viewers/codeViewer/styles.js +6 -0
  11. package/dist/cjs/viewers/doc/pdfPasswordInput.js +2 -0
  12. package/dist/cjs/viewers/doc/pdfRenderer.js +11 -0
  13. package/dist/cjs/viewers/svg/ImageWrapper.js +1 -0
  14. package/dist/cjs/viewers/svg/errors.js +16 -0
  15. package/dist/cjs/viewers/svg/index.js +17 -12
  16. package/dist/es2019/analytics/index.js +1 -1
  17. package/dist/es2019/analytics/ufoExperiences.js +1 -1
  18. package/dist/es2019/item-viewer.js +4 -1
  19. package/dist/es2019/styleWrappers.js +53 -8
  20. package/dist/es2019/v2/item-viewer-v2.js +11 -9
  21. package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +3 -1
  22. package/dist/es2019/viewers/codeViewer/codeViewerRenderer.js +5 -1
  23. package/dist/es2019/viewers/codeViewer/styles.js +5 -0
  24. package/dist/es2019/viewers/doc/pdfPasswordInput.js +1 -0
  25. package/dist/es2019/viewers/doc/pdfRenderer.js +11 -0
  26. package/dist/es2019/viewers/svg/ImageWrapper.js +1 -0
  27. package/dist/es2019/viewers/svg/errors.js +10 -0
  28. package/dist/es2019/viewers/svg/index.js +17 -12
  29. package/dist/esm/analytics/index.js +1 -1
  30. package/dist/esm/analytics/ufoExperiences.js +1 -1
  31. package/dist/esm/item-viewer.js +2 -1
  32. package/dist/esm/styleWrappers.js +66 -19
  33. package/dist/esm/v2/item-viewer-v2.js +11 -9
  34. package/dist/esm/viewers/archiveSidebar/styleWrappers.js +3 -1
  35. package/dist/esm/viewers/codeViewer/codeViewerRenderer.js +5 -1
  36. package/dist/esm/viewers/codeViewer/styles.js +5 -0
  37. package/dist/esm/viewers/doc/pdfPasswordInput.js +1 -0
  38. package/dist/esm/viewers/doc/pdfRenderer.js +10 -0
  39. package/dist/esm/viewers/svg/ImageWrapper.js +1 -0
  40. package/dist/esm/viewers/svg/errors.js +10 -0
  41. package/dist/esm/viewers/svg/index.js +17 -12
  42. package/dist/types/errors.d.ts +1 -1
  43. package/dist/types/viewers/svg/errors.d.ts +3 -0
  44. package/dist/types/viewers/svg/index.d.ts +1 -1
  45. package/dist/types-ts4.5/errors.d.ts +1 -1
  46. package/dist/types-ts4.5/viewers/svg/errors.d.ts +3 -0
  47. package/dist/types-ts4.5/viewers/svg/index.d.ts +1 -1
  48. package/example-helpers/MainWrapper.tsx +6 -0
  49. package/example-helpers/NativeMediaPreview.tsx +3 -0
  50. package/example-helpers/styles.ts +9 -0
  51. package/generate-cmaps.mjs +16 -13
  52. package/package.json +119 -119
@@ -16,15 +16,18 @@ var _zoomLevel = require("../../domain/zoomLevel");
16
16
  var _zoomControls = require("../../zoomControls");
17
17
  var _closed = require("../../analytics/events/ui/closed");
18
18
  var _mediaSvg = _interopRequireDefault(require("@atlaskit/media-svg"));
19
+ var _errors = require("../../errors");
19
20
  var _utils = require("./utils");
20
21
  var _ImageWrapper = require("./ImageWrapper");
22
+ var _errors2 = require("./errors");
21
23
  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); }
22
24
  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 && Object.prototype.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; }
23
25
  var SvgViewerBase = function SvgViewerBase(_ref) {
24
26
  var identifier = _ref.identifier,
25
27
  onLoad = _ref.onLoad,
26
28
  onClose = _ref.onClose,
27
- onBlanketClicked = _ref.onBlanketClicked;
29
+ onBlanketClicked = _ref.onBlanketClicked,
30
+ onError = _ref.onError;
28
31
  var _useState = (0, _react.useState)(new _zoomLevel.ZoomLevel(1)),
29
32
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
30
33
  zoomLevel = _useState2[0],
@@ -79,7 +82,7 @@ var SvgViewerBase = function SvgViewerBase(_ref) {
79
82
  document.removeEventListener('mouseup', stopDragging);
80
83
  };
81
84
  }, [onResize, panImage, stopDragging]);
82
- var onImgLoad = function onImgLoad(ev) {
85
+ var onSvgLoad = function onSvgLoad(ev) {
83
86
  onLoad === null || onLoad === void 0 || onLoad();
84
87
  if (!wrapperRef.current) {
85
88
  return;
@@ -91,7 +94,11 @@ var SvgViewerBase = function SvgViewerBase(_ref) {
91
94
  setCamera(newCamera);
92
95
  setZoomLevel(newZoomLevel);
93
96
  };
94
- var onImgClicked = function onImgClicked(e) {
97
+ var onSvgError = function onSvgError(err) {
98
+ var error = new _errors.MediaViewerError((0, _errors2.getErrorReason)(err.primaryReason), err instanceof Error ? err : undefined);
99
+ onError(error);
100
+ };
101
+ var onSvgClicked = function onSvgClicked(e) {
95
102
  if (e.target === e.currentTarget) {
96
103
  onBlanketClicked === null || onBlanketClicked === void 0 || onBlanketClicked();
97
104
  onClose === null || onClose === void 0 || onClose();
@@ -153,21 +160,19 @@ var SvgViewerBase = function SvgViewerBase(_ref) {
153
160
  };
154
161
  var imgDimensions = camera === null || camera === void 0 ? void 0 : camera.scaledImg(zoomLevel.value);
155
162
  return /*#__PURE__*/_react.default.createElement(_ImageWrapper.ImageWrapper, {
156
- onClick: onImgClicked,
163
+ onClick: onSvgClicked,
157
164
  ref: wrapperRef,
158
165
  isHidden: isHidden
159
166
  }, /*#__PURE__*/_react.default.createElement(_mediaSvg.default, {
160
167
  testId: 'media-viewer-svg',
161
168
  identifier: identifier,
162
- dimensions: imgDimensions,
163
- style: imgStyles,
164
- onLoad: onImgLoad,
165
- onMouseDown: startDragging
166
- // TODO HANDLE ERRORS
169
+ dimensions: imgDimensions
170
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
167
171
  ,
168
- onError: function onError() {
169
- // onError();
170
- }
172
+ style: imgStyles,
173
+ onLoad: onSvgLoad,
174
+ onMouseDown: startDragging,
175
+ onError: onSvgError
171
176
  }), /*#__PURE__*/_react.default.createElement(_styleWrappers.BaselineExtend, null), /*#__PURE__*/_react.default.createElement(_zoomControls.ZoomControls, {
172
177
  zoomLevel: zoomLevel,
173
178
  onChange: onZoomChange
@@ -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 = "48.6.2";
4
+ const packageVersion = "48.6.4";
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 = "48.6.2";
5
+ const packageVersion = "48.6.4";
6
6
  let ufoExperience;
7
7
  const getExperience = () => {
8
8
  if (!ufoExperience) {
@@ -85,8 +85,11 @@ export class ItemViewerBase extends React.Component {
85
85
  });
86
86
  });
87
87
  _defineProperty(this, "onLoadFail", (mediaViewerError, data) => {
88
+ const {
89
+ item
90
+ } = this.state;
88
91
  this.safeSetState({
89
- item: Outcome.failed(mediaViewerError, data)
92
+ item: Outcome.failed(mediaViewerError, data || item.data)
90
93
  });
91
94
  });
92
95
  _defineProperty(this, "onExternalImgSuccess", () => {
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
4
  import { jsx, css } from '@emotion/react';
4
5
  import { forwardRef, useMemo } from 'react';
5
6
  import { blanketColor, overlayZindex } from './styles';
@@ -17,7 +18,9 @@ const blanketStyles = css({
17
18
  left: 0,
18
19
  bottom: 0,
19
20
  right: 0,
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
20
22
  backgroundColor: blanketColor,
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
21
24
  zIndex: overlayZindex,
22
25
  display: 'flex'
23
26
  });
@@ -30,7 +33,9 @@ const headerWrapperStyles = ({
30
33
  width: '100%',
31
34
  height: '98px',
32
35
  opacity: 0.85,
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
33
37
  background: `linear-gradient( to bottom, ${headerAndSidebarBackgroundColor}, rgba(14, 22, 36, 0) ) no-repeat`,
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
34
39
  backgroundPosition: isArchiveSideBarVisible ? `${ArchiveSideBarWidth}px 0` : '0',
35
40
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
41
  color: '#c7d1db',
@@ -38,6 +43,7 @@ const headerWrapperStyles = ({
38
43
  padding: "var(--ds-space-300, 24px)",
39
44
  boxSizing: 'border-box',
40
45
  pointerEvents: 'none',
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
41
47
  zIndex: overlayZindex + 1
42
48
  });
43
49
  const listWrapperStyles = css({
@@ -52,11 +58,13 @@ const closeButtonWrapperStyles = css({
52
58
  position: 'absolute',
53
59
  top: "var(--ds-space-300, 24px)",
54
60
  right: "var(--ds-space-250, 20px)",
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
55
62
  zIndex: overlayZindex + 2
56
63
  });
57
64
  const contentWrapperStyles = ({
58
65
  isSidebarVisible
59
66
  }) => css({
67
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
60
68
  width: isSidebarVisible ? `calc(100% - ${SIDEBAR_WIDTH}px)` : '100%'
61
69
  });
62
70
  const zoomWrapperStyles = css({
@@ -64,6 +72,7 @@ const zoomWrapperStyles = css({
64
72
  position: 'absolute',
65
73
  bottom: '0px',
66
74
  height: '98px',
75
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
67
76
  backgroundImage: `linear-gradient( to top, ${headerAndSidebarBackgroundColor}, rgba(14, 22, 36, 0) )`,
68
77
  opacity: 0.85,
69
78
  pointerEvents: 'none',
@@ -77,6 +86,7 @@ const zoomCenterControlsStyles = css({
77
86
  display: 'flex',
78
87
  justifyContent: 'center',
79
88
  gap: "var(--ds-space-100, 10px)",
89
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
80
90
  '> *': {
81
91
  pointerEvents: 'all'
82
92
  }
@@ -102,6 +112,7 @@ const hdIconGroupWrapperStyles = css({
102
112
  gap: "var(--ds-space-100, 10px)",
103
113
  position: 'relative',
104
114
  width: '24px',
115
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
105
116
  '> *': {
106
117
  position: 'absolute'
107
118
  }
@@ -110,6 +121,7 @@ const errorMessageWrapperStyles = css({
110
121
  textAlign: 'center',
111
122
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
112
123
  color: '#c7d1db',
124
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
113
125
  p: {
114
126
  lineHeight: '100%'
115
127
  }
@@ -129,25 +141,30 @@ const pdfWrapperStyles = css({
129
141
  left: 0,
130
142
  bottom: 0,
131
143
  right: 0,
144
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
132
145
  [`.${hideControlsClassName}`]: {
133
146
  position: 'fixed'
134
147
  }
135
148
  });
136
149
  const arrowStyles = css({
137
150
  cursor: 'pointer',
151
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
138
152
  svg: {
139
153
  filter: 'drop-shadow(0px 1px 1px rgb(9 30 66 / 25%)) drop-shadow(0px 0px 1px rgb(9 30 66 / 31%))'
140
154
  },
155
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
141
156
  '&& button': {
142
157
  height: 'inherit',
143
158
  background: 'none',
144
159
  '&:hover': {
160
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
145
161
  svg: {
146
162
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
147
163
  color: '#b6c2cf'
148
164
  }
149
165
  },
150
166
  '&:active': {
167
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
151
168
  svg: {
152
169
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
153
170
  color: '#c7d1db'
@@ -171,10 +188,15 @@ const arrowsWrapperStyles = css({
171
188
  });
172
189
  const leftWrapperStyles = ({
173
190
  isArchiveSideBarVisible
174
- }) => css(arrowWrapperStyles, {
191
+ }) =>
192
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
193
+ css(arrowWrapperStyles, {
175
194
  textAlign: 'left',
195
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
176
196
  left: isArchiveSideBarVisible ? `${ArchiveSideBarWidth}px` : '0'
177
197
  });
198
+
199
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
178
200
  const rightWrapperStyles = css(arrowWrapperStyles, {
179
201
  textAlign: 'right',
180
202
  right: 0
@@ -183,11 +205,13 @@ const headerStyles = ({
183
205
  isArchiveSideBarVisible
184
206
  }) => css({
185
207
  display: 'flex',
208
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
186
209
  paddingLeft: isArchiveSideBarVisible ? `${ArchiveSideBarWidth}px` : '0'
187
210
  });
188
211
  const leftHeaderStyles = css({
189
212
  flex: 1,
190
213
  overflow: 'hidden',
214
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
191
215
  '> *': {
192
216
  pointerEvents: 'all'
193
217
  }
@@ -212,8 +236,11 @@ const imgStyles = ({
212
236
  display: 'inline-block',
213
237
  verticalAlign: 'middle',
214
238
  position: 'relative',
239
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
215
240
  cursor: cursor
216
- }, shouldPixelate ? `/* Prevent images from being smoothed when scaled up */
241
+ },
242
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
243
+ shouldPixelate ? `/* Prevent images from being smoothed when scaled up */
217
244
  image-rendering: optimizeSpeed; /* Legal fallback */
218
245
  image-rendering: -moz-crisp-edges; /* Firefox */
219
246
  image-rendering: -o-crisp-edges; /* Opera */
@@ -228,11 +255,15 @@ const medatadataTextWrapperStyles = css({
228
255
  const metadataWrapperStyles = css({
229
256
  display: 'flex'
230
257
  });
258
+
259
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
231
260
  const metadataFileNameStyles = css(ellipsis());
232
261
  const metadataSubTextStyles = css({
233
262
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
234
263
  color: '#c7d1db'
235
- }, ellipsis());
264
+ },
265
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
266
+ ellipsis());
236
267
  const metadataIconWrapperStyles = xcss({
237
268
  paddingTop: 'space.050',
238
269
  paddingRight: 'space.150'
@@ -241,6 +272,7 @@ const rightHeaderStyles = css({
241
272
  textAlign: 'right',
242
273
  marginRight: "var(--ds-space-500, 40px)",
243
274
  minWidth: '200px',
275
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
244
276
  '> *': {
245
277
  pointerEvents: 'all'
246
278
  }
@@ -252,7 +284,9 @@ const customAudioPlayerWrapperStyles = css({
252
284
  width: '100%'
253
285
  });
254
286
  const audioPlayerStyles = css({
287
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
255
288
  backgroundColor: blanketColor,
289
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
256
290
  borderRadius: borderRadius(),
257
291
  alignItems: 'center',
258
292
  justifyContent: 'center',
@@ -282,6 +316,7 @@ const defaultCoverWrapperStyles = css({
282
316
  display: 'flex',
283
317
  alignItems: 'center',
284
318
  justifyContent: 'center',
319
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
285
320
  '> *': {
286
321
  transform: 'scale(2)'
287
322
  }
@@ -289,14 +324,16 @@ const defaultCoverWrapperStyles = css({
289
324
  const downloadButtonWrapperStyles = css({
290
325
  marginTop: "var(--ds-space-300, 28px)",
291
326
  textAlign: 'center',
327
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
292
328
  button: {
293
329
  '&:hover, &:active': {
294
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
330
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
295
331
  color: '#161a1d !important'
296
332
  }
297
333
  }
298
334
  });
299
335
  const customVideoPlayerWrapperStyles = css({
336
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
300
337
  video: {
301
338
  flex: 1,
302
339
  width: '100vw',
@@ -310,6 +347,7 @@ const sidebarWrapperStyles = css({
310
347
  width: `${SIDEBAR_WIDTH}px`,
311
348
  height: '100vh',
312
349
  overflow: 'hidden auto',
350
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
313
351
  backgroundColor: `var(--ds-surface, ${headerAndSidebarBackgroundColor})`,
314
352
  color: "var(--ds-text, #c7d1db)"
315
353
  });
@@ -338,6 +376,7 @@ export const HeaderWrapper = ({
338
376
  isArchiveSideBarVisible
339
377
  }) => {
340
378
  return jsx("div", {
379
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
341
380
  css: headerWrapperStyles({
342
381
  isArchiveSideBarVisible
343
382
  })
@@ -371,7 +410,9 @@ jsx("div", {
371
410
  export const ContentWrapper = ({
372
411
  isSidebarVisible,
373
412
  children
374
- }) => jsx("div", {
413
+ }) =>
414
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
415
+ jsx("div", {
375
416
  css: contentWrapperStyles({
376
417
  isSidebarVisible
377
418
  })
@@ -465,7 +506,9 @@ jsx("span", {
465
506
  export const LeftWrapper = ({
466
507
  children,
467
508
  isArchiveSideBarVisible
468
- }) => jsx("div", {
509
+ }) =>
510
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
511
+ jsx("div", {
469
512
  css: leftWrapperStyles({
470
513
  isArchiveSideBarVisible
471
514
  })
@@ -483,7 +526,7 @@ export const Header = ({
483
526
  isArchiveSideBarVisible,
484
527
  className
485
528
  }) =>
486
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
529
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
487
530
  jsx("div", {
488
531
  css: headerStyles({
489
532
  isArchiveSideBarVisible
@@ -539,7 +582,9 @@ export const Img = ({
539
582
  }, [canDrag, isDragging]);
540
583
  return jsx("img", {
541
584
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
542
- className: className,
585
+ className: className
586
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
587
+ ,
543
588
  css: imgStyles({
544
589
  cursor,
545
590
  shouldPixelate
@@ -88,6 +88,13 @@ export const ItemViewerV2Base = ({
88
88
 
89
89
  // Did mount
90
90
 
91
+ useEffect(() => {
92
+ if (isExternalImageIdentifier(identifier)) {
93
+ return;
94
+ }
95
+ fireAnalytics(createCommencedEvent(identifier === null || identifier === void 0 ? void 0 : identifier.id, traceContext.current), createAnalyticsEventRef.current);
96
+ startMediaFileUfoExperience();
97
+ }, [identifier]);
91
98
  useEffect(() => {
92
99
  if (isExternalImageIdentifier(identifier)) {
93
100
  // external images do not need to talk to our backend,
@@ -96,11 +103,8 @@ export const ItemViewerV2Base = ({
96
103
  setItem(Outcome.successful('external-image'));
97
104
  return;
98
105
  }
99
- fireAnalytics(createCommencedEvent(identifier === null || identifier === void 0 ? void 0 : identifier.id, traceContext.current), createAnalyticsEventRef.current);
100
- startMediaFileUfoExperience();
101
106
 
102
107
  // File Subscription
103
-
104
108
  if (fileState) {
105
109
  const {
106
110
  status
@@ -132,9 +136,9 @@ export const ItemViewerV2Base = ({
132
136
  }
133
137
  });
134
138
  }, [item]);
135
- const onLoadFail = useCallback((mediaViewerError, data) => {
136
- setItem(Outcome.failed(mediaViewerError, data));
137
- }, []);
139
+ const onLoadFail = useCallback(mediaViewerError => {
140
+ setItem(Outcome.failed(mediaViewerError, fileState));
141
+ }, [fileState]);
138
142
  const renderItem = fileItem => {
139
143
  const collectionName = isFileIdentifier(identifier) ? identifier.collectionName : undefined;
140
144
  const viewerProps = {
@@ -193,9 +197,7 @@ export const ItemViewerV2Base = ({
193
197
  case 'doc':
194
198
  return /*#__PURE__*/React.createElement(DocViewerV2, _extends({
195
199
  onSuccess: onSuccess,
196
- onError: err => {
197
- onLoadFail(err, fileState);
198
- }
200
+ onError: onLoadFail
199
201
  }, viewerProps));
200
202
  case 'archive':
201
203
  return /*#__PURE__*/React.createElement(ArchiveViewerLoader, _extends({
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
 
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
4
  import { jsx, css, keyframes } from '@emotion/react';
4
5
  import { ArchiveSideBarWidth } from './styles';
5
6
  import { DN500 } from '@atlaskit/theme/colors';
@@ -15,6 +16,7 @@ const archiveSideBarStyles = css({
15
16
  position: 'absolute',
16
17
  left: 0,
17
18
  top: 0,
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
18
20
  width: `${ArchiveSideBarWidth}px`,
19
21
  bottom: 0,
20
22
  boxSizing: 'border-box',
@@ -69,7 +71,7 @@ const archiveLayoutStyles = css({
69
71
  const archiveViewerWrapperStyles = css({
70
72
  position: 'absolute',
71
73
  top: 0,
72
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
74
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
73
75
  left: `${ArchiveSideBarWidth}px`,
74
76
  right: 0,
75
77
  bottom: 0,
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
4
  import { jsx } from '@emotion/react';
4
5
  import { Component } from 'react';
5
6
  import { Outcome } from '../../domain';
@@ -28,6 +29,7 @@ export const CodeViewWrapper = ({
28
29
  }, children));
29
30
  };
30
31
  export const CodeViewerHeaderBar = () => {
32
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
31
33
  return jsx("div", {
32
34
  css: codeViewerHeaderBarStyles
33
35
  });
@@ -77,7 +79,9 @@ export class CodeViewRenderer extends Component {
77
79
  //Use src to measure the real file size
78
80
  //item.size is incorrect for archives with mutiple docs inside.
79
81
  const fileSize = new Blob([src]).size;
80
- const codeViewer = lineCount(src) > MAX_FORMATTED_LINES || fileSize > MAX_FILE_SIZE_USE_CODE_VIEWER ? jsx("code", {
82
+ const codeViewer = lineCount(src) > MAX_FORMATTED_LINES || fileSize > MAX_FILE_SIZE_USE_CODE_VIEWER ?
83
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
84
+ jsx("code", {
81
85
  css: codeViewerHTMLStyles,
82
86
  "data-testid": "code-block"
83
87
  }, src) : jsx(CodeBlock, {
@@ -1,24 +1,29 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
1
2
  import { css } from '@emotion/react';
2
3
  // AFP-2532 TODO: Fix automatic suppressions below
3
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
4
5
  import { colors } from '@atlaskit/theme';
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
5
7
  export const codeViewWrapperStyles = css({
6
8
  position: 'absolute',
7
9
  left: 0,
8
10
  top: 0,
9
11
  right: 0,
10
12
  bottom: 0,
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
11
14
  backgroundColor: `var(--ds-surface, ${colors.N20})`,
12
15
  overflow: 'auto'
13
16
  });
14
17
 
15
18
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
16
20
  export const codeViewerHeaderBarStyles = css({
17
21
  height: '75px',
18
22
  backgroundColor: '#1d2125'
19
23
  });
20
24
  /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
21
25
 
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
22
27
  export const codeViewerHTMLStyles = css({
23
28
  display: 'flex',
24
29
  lineHeight: '20px',
@@ -8,6 +8,7 @@ import Form, { Field } from '@atlaskit/form';
8
8
  import { FormattedMessage, useIntl } from 'react-intl-next';
9
9
  import { messages } from '@atlaskit/media-ui';
10
10
  import { xcss, Box, Flex } from '@atlaskit/primitives';
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
12
  import { jsx, css } from '@emotion/react';
12
13
  import ErrorIcon from '@atlaskit/icon/glyph/error';
13
14
  const COLOR_SHADE = '#b6c2cf';
@@ -3,6 +3,7 @@ import { PDFViewer, EventBus, PDFLinkService, NullL10n } from 'pdfjs-dist/legacy
3
3
  import { getDocument, GlobalWorkerOptions, CMapCompressionType, PasswordResponses } from 'pdfjs-dist/legacy/build/pdf';
4
4
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
5
5
  import { cmap } from './cmaps';
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
7
  import { css, Global } from '@emotion/react';
7
8
  import { ZoomControls } from '../../zoomControls';
8
9
  import { PDFWrapper } from '../../styleWrappers';
@@ -24,17 +25,21 @@ export const pdfViewerClassName = 'pdfViewer';
24
25
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
25
26
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage/preview */
26
27
  const globalStyles = css({
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
27
29
  [`.${pdfViewerClassName}`]: {
28
30
  marginTop: "var(--ds-space-800, 64px)",
29
31
  marginBottom: "var(--ds-space-800, 64px)",
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
30
33
  '.page': {
31
34
  margin: `1px auto ${"var(--ds-space-negative-100, -8px)"} auto`,
32
35
  border: '9px solid transparent',
33
36
  position: 'relative'
34
37
  },
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
35
39
  '.canvasWrapper': {
36
40
  overflow: 'hidden'
37
41
  },
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
38
43
  '.textLayer': {
39
44
  position: 'absolute',
40
45
  left: 0,
@@ -45,6 +50,7 @@ const globalStyles = css({
45
50
  opacity: 0.2,
46
51
  lineHeight: 1
47
52
  },
53
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
48
54
  '.textLayer span, .textLayer br': {
49
55
  color: 'transparent',
50
56
  position: 'absolute',
@@ -52,16 +58,20 @@ const globalStyles = css({
52
58
  cursor: 'text',
53
59
  transformOrigin: '0% 0%'
54
60
  },
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
55
62
  '.textLayer ::-moz-selection': {
56
63
  background: 'rgba(0, 0, 255, 1)'
57
64
  },
65
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
58
66
  '.textLayer ::selection': {
59
67
  background: 'rgba(0, 0, 255, 1)'
60
68
  },
69
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
61
70
  '.annotationLayer section': {
62
71
  position: 'absolute',
63
72
  textAlign: 'initial'
64
73
  },
74
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
65
75
  '.annotationLayer .linkAnnotation > a, .annotationLayer .buttonWidgetAnnotation.pushButton > a': {
66
76
  position: 'absolute',
67
77
  fontSize: '1em',
@@ -70,6 +80,7 @@ const globalStyles = css({
70
80
  width: '100%',
71
81
  height: '100%'
72
82
  },
83
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
73
84
  '.annotationLayer .linkAnnotation > a:hover, .annotationLayer .buttonWidgetAnnotation.pushButton > a:hover': {
74
85
  opacity: 0.2,
75
86
  background: 'rgba(255, 255, 0, 1)',
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
3
  import { css, jsx } from '@emotion/react';
3
4
  import { forwardRef } from 'react';
4
5
  const imageWrapperStyles = css({
@@ -0,0 +1,10 @@
1
+ export const getErrorReason = svgReason => {
2
+ switch (svgReason) {
3
+ case 'img-error':
4
+ return 'svg-img-error';
5
+ case 'binary-fetch':
6
+ return 'svg-binary-fetch';
7
+ default:
8
+ return 'svg-unknown-error';
9
+ }
10
+ };