@atlaskit/media-viewer 48.6.2 → 48.6.3

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 (37) hide show
  1. package/CHANGELOG.md +9 -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 +65 -19
  7. package/dist/cjs/v2/item-viewer-v2.js +4 -6
  8. package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +2 -1
  9. package/dist/cjs/viewers/codeViewer/codeViewerRenderer.js +4 -1
  10. package/dist/cjs/viewers/codeViewer/styles.js +4 -0
  11. package/dist/cjs/viewers/doc/pdfRenderer.js +11 -0
  12. package/dist/cjs/viewers/svg/index.js +3 -1
  13. package/dist/es2019/analytics/index.js +1 -1
  14. package/dist/es2019/analytics/ufoExperiences.js +1 -1
  15. package/dist/es2019/item-viewer.js +4 -1
  16. package/dist/es2019/styleWrappers.js +52 -8
  17. package/dist/es2019/v2/item-viewer-v2.js +4 -6
  18. package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +2 -1
  19. package/dist/es2019/viewers/codeViewer/codeViewerRenderer.js +4 -1
  20. package/dist/es2019/viewers/codeViewer/styles.js +4 -0
  21. package/dist/es2019/viewers/doc/pdfRenderer.js +11 -0
  22. package/dist/es2019/viewers/svg/index.js +3 -1
  23. package/dist/esm/analytics/index.js +1 -1
  24. package/dist/esm/analytics/ufoExperiences.js +1 -1
  25. package/dist/esm/item-viewer.js +2 -1
  26. package/dist/esm/styleWrappers.js +65 -19
  27. package/dist/esm/v2/item-viewer-v2.js +4 -6
  28. package/dist/esm/viewers/archiveSidebar/styleWrappers.js +2 -1
  29. package/dist/esm/viewers/codeViewer/codeViewerRenderer.js +4 -1
  30. package/dist/esm/viewers/codeViewer/styles.js +4 -0
  31. package/dist/esm/viewers/doc/pdfRenderer.js +10 -0
  32. package/dist/esm/viewers/svg/index.js +3 -1
  33. package/example-helpers/MainWrapper.tsx +5 -0
  34. package/example-helpers/NativeMediaPreview.tsx +2 -0
  35. package/example-helpers/styles.ts +8 -0
  36. package/generate-cmaps.mjs +16 -13
  37. package/package.json +119 -119
@@ -17,7 +17,9 @@ const blanketStyles = css({
17
17
  left: 0,
18
18
  bottom: 0,
19
19
  right: 0,
20
+ // 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
21
  backgroundColor: blanketColor,
22
+ // 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
23
  zIndex: overlayZindex,
22
24
  display: 'flex'
23
25
  });
@@ -30,7 +32,9 @@ const headerWrapperStyles = ({
30
32
  width: '100%',
31
33
  height: '98px',
32
34
  opacity: 0.85,
35
+ // 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
36
  background: `linear-gradient( to bottom, ${headerAndSidebarBackgroundColor}, rgba(14, 22, 36, 0) ) no-repeat`,
37
+ // 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
38
  backgroundPosition: isArchiveSideBarVisible ? `${ArchiveSideBarWidth}px 0` : '0',
35
39
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
40
  color: '#c7d1db',
@@ -38,6 +42,7 @@ const headerWrapperStyles = ({
38
42
  padding: "var(--ds-space-300, 24px)",
39
43
  boxSizing: 'border-box',
40
44
  pointerEvents: 'none',
45
+ // 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
46
  zIndex: overlayZindex + 1
42
47
  });
43
48
  const listWrapperStyles = css({
@@ -52,11 +57,13 @@ const closeButtonWrapperStyles = css({
52
57
  position: 'absolute',
53
58
  top: "var(--ds-space-300, 24px)",
54
59
  right: "var(--ds-space-250, 20px)",
60
+ // 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
61
  zIndex: overlayZindex + 2
56
62
  });
57
63
  const contentWrapperStyles = ({
58
64
  isSidebarVisible
59
65
  }) => css({
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
60
67
  width: isSidebarVisible ? `calc(100% - ${SIDEBAR_WIDTH}px)` : '100%'
61
68
  });
62
69
  const zoomWrapperStyles = css({
@@ -64,6 +71,7 @@ const zoomWrapperStyles = css({
64
71
  position: 'absolute',
65
72
  bottom: '0px',
66
73
  height: '98px',
74
+ // 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
75
  backgroundImage: `linear-gradient( to top, ${headerAndSidebarBackgroundColor}, rgba(14, 22, 36, 0) )`,
68
76
  opacity: 0.85,
69
77
  pointerEvents: 'none',
@@ -77,6 +85,7 @@ const zoomCenterControlsStyles = css({
77
85
  display: 'flex',
78
86
  justifyContent: 'center',
79
87
  gap: "var(--ds-space-100, 10px)",
88
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
80
89
  '> *': {
81
90
  pointerEvents: 'all'
82
91
  }
@@ -102,6 +111,7 @@ const hdIconGroupWrapperStyles = css({
102
111
  gap: "var(--ds-space-100, 10px)",
103
112
  position: 'relative',
104
113
  width: '24px',
114
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
105
115
  '> *': {
106
116
  position: 'absolute'
107
117
  }
@@ -110,6 +120,7 @@ const errorMessageWrapperStyles = css({
110
120
  textAlign: 'center',
111
121
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
112
122
  color: '#c7d1db',
123
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
113
124
  p: {
114
125
  lineHeight: '100%'
115
126
  }
@@ -129,25 +140,30 @@ const pdfWrapperStyles = css({
129
140
  left: 0,
130
141
  bottom: 0,
131
142
  right: 0,
143
+ // 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
144
  [`.${hideControlsClassName}`]: {
133
145
  position: 'fixed'
134
146
  }
135
147
  });
136
148
  const arrowStyles = css({
137
149
  cursor: 'pointer',
150
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
138
151
  svg: {
139
152
  filter: 'drop-shadow(0px 1px 1px rgb(9 30 66 / 25%)) drop-shadow(0px 0px 1px rgb(9 30 66 / 31%))'
140
153
  },
154
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
141
155
  '&& button': {
142
156
  height: 'inherit',
143
157
  background: 'none',
144
158
  '&:hover': {
159
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
145
160
  svg: {
146
161
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
147
162
  color: '#b6c2cf'
148
163
  }
149
164
  },
150
165
  '&:active': {
166
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
151
167
  svg: {
152
168
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
153
169
  color: '#c7d1db'
@@ -171,10 +187,15 @@ const arrowsWrapperStyles = css({
171
187
  });
172
188
  const leftWrapperStyles = ({
173
189
  isArchiveSideBarVisible
174
- }) => css(arrowWrapperStyles, {
190
+ }) =>
191
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
192
+ css(arrowWrapperStyles, {
175
193
  textAlign: 'left',
194
+ // 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
195
  left: isArchiveSideBarVisible ? `${ArchiveSideBarWidth}px` : '0'
177
196
  });
197
+
198
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
178
199
  const rightWrapperStyles = css(arrowWrapperStyles, {
179
200
  textAlign: 'right',
180
201
  right: 0
@@ -183,11 +204,13 @@ const headerStyles = ({
183
204
  isArchiveSideBarVisible
184
205
  }) => css({
185
206
  display: 'flex',
207
+ // 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
208
  paddingLeft: isArchiveSideBarVisible ? `${ArchiveSideBarWidth}px` : '0'
187
209
  });
188
210
  const leftHeaderStyles = css({
189
211
  flex: 1,
190
212
  overflow: 'hidden',
213
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
191
214
  '> *': {
192
215
  pointerEvents: 'all'
193
216
  }
@@ -212,8 +235,11 @@ const imgStyles = ({
212
235
  display: 'inline-block',
213
236
  verticalAlign: 'middle',
214
237
  position: 'relative',
238
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
215
239
  cursor: cursor
216
- }, shouldPixelate ? `/* Prevent images from being smoothed when scaled up */
240
+ },
241
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
242
+ shouldPixelate ? `/* Prevent images from being smoothed when scaled up */
217
243
  image-rendering: optimizeSpeed; /* Legal fallback */
218
244
  image-rendering: -moz-crisp-edges; /* Firefox */
219
245
  image-rendering: -o-crisp-edges; /* Opera */
@@ -228,11 +254,15 @@ const medatadataTextWrapperStyles = css({
228
254
  const metadataWrapperStyles = css({
229
255
  display: 'flex'
230
256
  });
257
+
258
+ // 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
259
  const metadataFileNameStyles = css(ellipsis());
232
260
  const metadataSubTextStyles = css({
233
261
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
234
262
  color: '#c7d1db'
235
- }, ellipsis());
263
+ },
264
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
265
+ ellipsis());
236
266
  const metadataIconWrapperStyles = xcss({
237
267
  paddingTop: 'space.050',
238
268
  paddingRight: 'space.150'
@@ -241,6 +271,7 @@ const rightHeaderStyles = css({
241
271
  textAlign: 'right',
242
272
  marginRight: "var(--ds-space-500, 40px)",
243
273
  minWidth: '200px',
274
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
244
275
  '> *': {
245
276
  pointerEvents: 'all'
246
277
  }
@@ -252,7 +283,9 @@ const customAudioPlayerWrapperStyles = css({
252
283
  width: '100%'
253
284
  });
254
285
  const audioPlayerStyles = css({
286
+ // 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
287
  backgroundColor: blanketColor,
288
+ // 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
289
  borderRadius: borderRadius(),
257
290
  alignItems: 'center',
258
291
  justifyContent: 'center',
@@ -282,6 +315,7 @@ const defaultCoverWrapperStyles = css({
282
315
  display: 'flex',
283
316
  alignItems: 'center',
284
317
  justifyContent: 'center',
318
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
285
319
  '> *': {
286
320
  transform: 'scale(2)'
287
321
  }
@@ -289,14 +323,16 @@ const defaultCoverWrapperStyles = css({
289
323
  const downloadButtonWrapperStyles = css({
290
324
  marginTop: "var(--ds-space-300, 28px)",
291
325
  textAlign: 'center',
326
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
292
327
  button: {
293
328
  '&:hover, &:active': {
294
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
329
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
295
330
  color: '#161a1d !important'
296
331
  }
297
332
  }
298
333
  });
299
334
  const customVideoPlayerWrapperStyles = css({
335
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
300
336
  video: {
301
337
  flex: 1,
302
338
  width: '100vw',
@@ -310,6 +346,7 @@ const sidebarWrapperStyles = css({
310
346
  width: `${SIDEBAR_WIDTH}px`,
311
347
  height: '100vh',
312
348
  overflow: 'hidden auto',
349
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
313
350
  backgroundColor: `var(--ds-surface, ${headerAndSidebarBackgroundColor})`,
314
351
  color: "var(--ds-text, #c7d1db)"
315
352
  });
@@ -338,6 +375,7 @@ export const HeaderWrapper = ({
338
375
  isArchiveSideBarVisible
339
376
  }) => {
340
377
  return jsx("div", {
378
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
341
379
  css: headerWrapperStyles({
342
380
  isArchiveSideBarVisible
343
381
  })
@@ -371,7 +409,9 @@ jsx("div", {
371
409
  export const ContentWrapper = ({
372
410
  isSidebarVisible,
373
411
  children
374
- }) => jsx("div", {
412
+ }) =>
413
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
414
+ jsx("div", {
375
415
  css: contentWrapperStyles({
376
416
  isSidebarVisible
377
417
  })
@@ -465,7 +505,9 @@ jsx("span", {
465
505
  export const LeftWrapper = ({
466
506
  children,
467
507
  isArchiveSideBarVisible
468
- }) => jsx("div", {
508
+ }) =>
509
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
510
+ jsx("div", {
469
511
  css: leftWrapperStyles({
470
512
  isArchiveSideBarVisible
471
513
  })
@@ -483,7 +525,7 @@ export const Header = ({
483
525
  isArchiveSideBarVisible,
484
526
  className
485
527
  }) =>
486
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
528
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
487
529
  jsx("div", {
488
530
  css: headerStyles({
489
531
  isArchiveSideBarVisible
@@ -539,7 +581,9 @@ export const Img = ({
539
581
  }, [canDrag, isDragging]);
540
582
  return jsx("img", {
541
583
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
542
- className: className,
584
+ className: className
585
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
586
+ ,
543
587
  css: imgStyles({
544
588
  cursor,
545
589
  shouldPixelate
@@ -132,9 +132,9 @@ export const ItemViewerV2Base = ({
132
132
  }
133
133
  });
134
134
  }, [item]);
135
- const onLoadFail = useCallback((mediaViewerError, data) => {
136
- setItem(Outcome.failed(mediaViewerError, data));
137
- }, []);
135
+ const onLoadFail = useCallback(mediaViewerError => {
136
+ setItem(Outcome.failed(mediaViewerError, fileState));
137
+ }, [fileState]);
138
138
  const renderItem = fileItem => {
139
139
  const collectionName = isFileIdentifier(identifier) ? identifier.collectionName : undefined;
140
140
  const viewerProps = {
@@ -193,9 +193,7 @@ export const ItemViewerV2Base = ({
193
193
  case 'doc':
194
194
  return /*#__PURE__*/React.createElement(DocViewerV2, _extends({
195
195
  onSuccess: onSuccess,
196
- onError: err => {
197
- onLoadFail(err, fileState);
198
- }
196
+ onError: onLoadFail
199
197
  }, viewerProps));
200
198
  case 'archive':
201
199
  return /*#__PURE__*/React.createElement(ArchiveViewerLoader, _extends({
@@ -15,6 +15,7 @@ const archiveSideBarStyles = css({
15
15
  position: 'absolute',
16
16
  left: 0,
17
17
  top: 0,
18
+ // 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
19
  width: `${ArchiveSideBarWidth}px`,
19
20
  bottom: 0,
20
21
  boxSizing: 'border-box',
@@ -69,7 +70,7 @@ const archiveLayoutStyles = css({
69
70
  const archiveViewerWrapperStyles = css({
70
71
  position: 'absolute',
71
72
  top: 0,
72
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
73
+ // 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
74
  left: `${ArchiveSideBarWidth}px`,
74
75
  right: 0,
75
76
  bottom: 0,
@@ -28,6 +28,7 @@ export const CodeViewWrapper = ({
28
28
  }, children));
29
29
  };
30
30
  export const CodeViewerHeaderBar = () => {
31
+ // 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
32
  return jsx("div", {
32
33
  css: codeViewerHeaderBarStyles
33
34
  });
@@ -77,7 +78,9 @@ export class CodeViewRenderer extends Component {
77
78
  //Use src to measure the real file size
78
79
  //item.size is incorrect for archives with mutiple docs inside.
79
80
  const fileSize = new Blob([src]).size;
80
- const codeViewer = lineCount(src) > MAX_FORMATTED_LINES || fileSize > MAX_FILE_SIZE_USE_CODE_VIEWER ? jsx("code", {
81
+ const codeViewer = lineCount(src) > MAX_FORMATTED_LINES || fileSize > MAX_FILE_SIZE_USE_CODE_VIEWER ?
82
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
83
+ jsx("code", {
81
84
  css: codeViewerHTMLStyles,
82
85
  "data-testid": "code-block"
83
86
  }, src) : jsx(CodeBlock, {
@@ -2,23 +2,27 @@ import { css } from '@emotion/react';
2
2
  // AFP-2532 TODO: Fix automatic suppressions below
3
3
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
4
4
  import { colors } from '@atlaskit/theme';
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
5
6
  export const codeViewWrapperStyles = css({
6
7
  position: 'absolute',
7
8
  left: 0,
8
9
  top: 0,
9
10
  right: 0,
10
11
  bottom: 0,
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
11
13
  backgroundColor: `var(--ds-surface, ${colors.N20})`,
12
14
  overflow: 'auto'
13
15
  });
14
16
 
15
17
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
16
19
  export const codeViewerHeaderBarStyles = css({
17
20
  height: '75px',
18
21
  backgroundColor: '#1d2125'
19
22
  });
20
23
  /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
21
24
 
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
22
26
  export const codeViewerHTMLStyles = css({
23
27
  display: 'flex',
24
28
  lineHeight: '20px',
@@ -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 -- 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)',
@@ -143,7 +143,9 @@ const SvgViewerBase = ({
143
143
  }, /*#__PURE__*/React.createElement(MediaSvg, {
144
144
  testId: 'media-viewer-svg',
145
145
  identifier: identifier,
146
- dimensions: imgDimensions,
146
+ dimensions: imgDimensions
147
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
148
+ ,
147
149
  style: imgStyles,
148
150
  onLoad: onImgLoad,
149
151
  onMouseDown: startDragging
@@ -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 = "48.6.2";
4
+ var packageVersion = "48.6.3";
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 = "48.6.2";
8
+ var packageVersion = "48.6.3";
9
9
  var ufoExperience;
10
10
  var getExperience = function getExperience() {
11
11
  if (!ufoExperience) {
@@ -138,8 +138,9 @@ export var ItemViewerBase = /*#__PURE__*/function (_React$Component) {
138
138
  });
139
139
  });
140
140
  _defineProperty(_assertThisInitialized(_this), "onLoadFail", function (mediaViewerError, data) {
141
+ var item = _this.state.item;
141
142
  _this.safeSetState({
142
- item: Outcome.failed(mediaViewerError, data)
143
+ item: Outcome.failed(mediaViewerError, data || item.data)
143
144
  });
144
145
  });
145
146
  _defineProperty(_assertThisInitialized(_this), "onExternalImgSuccess", function () {