@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/media-viewer
2
2
 
3
+ ## 48.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#111464](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111464)
8
+ [`1a9f6f0977000`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1a9f6f0977000) -
9
+ Added error handling to SVG
10
+ - Updated dependencies
11
+
12
+ ## 48.6.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [#111350](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111350)
17
+ [`efcf89de4e9ab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/efcf89de4e9ab) -
18
+ Added missing metadata in some error events
19
+ - Updated dependencies
20
+
3
21
  ## 48.6.2
4
22
 
5
23
  ### Patch Changes
package/compass.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  name: Media Viewer
2
2
  id: 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/b67342fb-426a-4066-b4d8-f13c0aa2e5ad'
3
- description: MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate
3
+ description:
4
+ MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and
5
+ extendable yet easy-to-integrate
4
6
  configVersion: 1
5
7
  typeId: UI_ELEMENT
6
8
  ownerId: 'ari:cloud:teams::team/ef910622-ce0a-44a0-b441-ba89efe7891b'
@@ -23,7 +25,7 @@ links:
23
25
  - name: ''
24
26
  type: REPOSITORY
25
27
  url: 'https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/media/media-viewer/'
26
- - name: ''
28
+ - name: ''
27
29
  type: DOCUMENT
28
30
  url: 'https://atlaskit.atlassian.com/packages/media/media-viewer'
29
31
  - name: '' # Tome Capability
@@ -45,6 +47,5 @@ relationships:
45
47
  DEPENDS_ON:
46
48
  - 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/652381b6-c323-4b50-bf31-c94941a0b6ef'
47
49
  - 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/3bc23fc6-021a-4adf-9602-ade6d8cad7d3'
48
-
49
50
  # Learn more about formatting compass.yml:
50
- # https://go.atlassian.com/compass-yml-format
51
+ # https://go.atlassian.com/compass-yml-format
@@ -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 = "48.6.2";
13
+ var packageVersion = exports.packageVersion = "48.6.4";
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 = "48.6.2";
15
+ var packageVersion = "48.6.4";
16
16
  var ufoExperience;
17
17
  var getExperience = function getExperience() {
18
18
  if (!ufoExperience) {
@@ -160,8 +160,9 @@ var ItemViewerBase = exports.ItemViewerBase = /*#__PURE__*/function (_React$Comp
160
160
  });
161
161
  });
162
162
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onLoadFail", function (mediaViewerError, data) {
163
+ var item = _this.state.item;
163
164
  _this.safeSetState({
164
- item: _domain.Outcome.failed(mediaViewerError, data)
165
+ item: _domain.Outcome.failed(mediaViewerError, data || item.data)
165
166
  });
166
167
  });
167
168
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onExternalImgSuccess", function () {
@@ -18,6 +18,7 @@ var _styles2 = require("./viewers/archiveSidebar/styles");
18
18
  var _constants = require("@atlaskit/theme/constants");
19
19
  var _primitives = require("@atlaskit/primitives");
20
20
  /** @jsx jsx */
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
22
 
22
23
  var SIDEBAR_WIDTH = 416;
23
24
  var blanketStyles = (0, _react.css)({
@@ -26,7 +27,9 @@ var blanketStyles = (0, _react.css)({
26
27
  left: 0,
27
28
  bottom: 0,
28
29
  right: 0,
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
29
31
  backgroundColor: _styles.blanketColor,
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
33
  zIndex: _styles.overlayZindex,
31
34
  display: 'flex'
32
35
  });
@@ -39,7 +42,9 @@ var headerWrapperStyles = function headerWrapperStyles(_ref) {
39
42
  width: '100%',
40
43
  height: '98px',
41
44
  opacity: 0.85,
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
42
46
  background: "linear-gradient( to bottom, ".concat(_modalSpinner.headerAndSidebarBackgroundColor, ", rgba(14, 22, 36, 0) ) no-repeat"),
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
43
48
  backgroundPosition: isArchiveSideBarVisible ? "".concat(_styles2.ArchiveSideBarWidth, "px 0") : '0',
44
49
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
45
50
  color: '#c7d1db',
@@ -47,6 +52,7 @@ var headerWrapperStyles = function headerWrapperStyles(_ref) {
47
52
  padding: "var(--ds-space-300, 24px)",
48
53
  boxSizing: 'border-box',
49
54
  pointerEvents: 'none',
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
50
56
  zIndex: _styles.overlayZindex + 1
51
57
  });
52
58
  };
@@ -62,11 +68,13 @@ var closeButtonWrapperStyles = (0, _react.css)({
62
68
  position: 'absolute',
63
69
  top: "var(--ds-space-300, 24px)",
64
70
  right: "var(--ds-space-250, 20px)",
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
65
72
  zIndex: _styles.overlayZindex + 2
66
73
  });
67
74
  var contentWrapperStyles = function contentWrapperStyles(_ref2) {
68
75
  var isSidebarVisible = _ref2.isSidebarVisible;
69
76
  return (0, _react.css)({
77
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
70
78
  width: isSidebarVisible ? "calc(100% - ".concat(SIDEBAR_WIDTH, "px)") : '100%'
71
79
  });
72
80
  };
@@ -75,6 +83,7 @@ var zoomWrapperStyles = (0, _react.css)({
75
83
  position: 'absolute',
76
84
  bottom: '0px',
77
85
  height: '98px',
86
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
78
87
  backgroundImage: "linear-gradient( to top, ".concat(_modalSpinner.headerAndSidebarBackgroundColor, ", rgba(14, 22, 36, 0) )"),
79
88
  opacity: 0.85,
80
89
  pointerEvents: 'none',
@@ -88,6 +97,7 @@ var zoomCenterControlsStyles = (0, _react.css)({
88
97
  display: 'flex',
89
98
  justifyContent: 'center',
90
99
  gap: "var(--ds-space-100, 10px)",
100
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
91
101
  '> *': {
92
102
  pointerEvents: 'all'
93
103
  }
@@ -113,6 +123,7 @@ var hdIconGroupWrapperStyles = (0, _react.css)({
113
123
  gap: "var(--ds-space-100, 10px)",
114
124
  position: 'relative',
115
125
  width: '24px',
126
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
116
127
  '> *': {
117
128
  position: 'absolute'
118
129
  }
@@ -121,6 +132,7 @@ var errorMessageWrapperStyles = (0, _react.css)({
121
132
  textAlign: 'center',
122
133
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
123
134
  color: '#c7d1db',
135
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
124
136
  p: {
125
137
  lineHeight: '100%'
126
138
  }
@@ -145,19 +157,23 @@ var pdfWrapperStyles = (0, _react.css)((0, _defineProperty2.default)({
145
157
  }));
146
158
  var arrowStyles = (0, _react.css)({
147
159
  cursor: 'pointer',
160
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
148
161
  svg: {
149
162
  filter: 'drop-shadow(0px 1px 1px rgb(9 30 66 / 25%)) drop-shadow(0px 0px 1px rgb(9 30 66 / 31%))'
150
163
  },
164
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
151
165
  '&& button': {
152
166
  height: 'inherit',
153
167
  background: 'none',
154
168
  '&:hover': {
169
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
155
170
  svg: {
156
171
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
157
172
  color: '#b6c2cf'
158
173
  }
159
174
  },
160
175
  '&:active': {
176
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
161
177
  svg: {
162
178
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
163
179
  color: '#c7d1db'
@@ -181,11 +197,17 @@ var arrowsWrapperStyles = (0, _react.css)({
181
197
  });
182
198
  var leftWrapperStyles = function leftWrapperStyles(_ref3) {
183
199
  var isArchiveSideBarVisible = _ref3.isArchiveSideBarVisible;
184
- return (0, _react.css)(arrowWrapperStyles, {
185
- textAlign: 'left',
186
- left: isArchiveSideBarVisible ? "".concat(_styles2.ArchiveSideBarWidth, "px") : '0'
187
- });
200
+ return (
201
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
202
+ (0, _react.css)(arrowWrapperStyles, {
203
+ textAlign: 'left',
204
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
205
+ left: isArchiveSideBarVisible ? "".concat(_styles2.ArchiveSideBarWidth, "px") : '0'
206
+ })
207
+ );
188
208
  };
209
+
210
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
189
211
  var rightWrapperStyles = (0, _react.css)(arrowWrapperStyles, {
190
212
  textAlign: 'right',
191
213
  right: 0
@@ -194,12 +216,14 @@ var headerStyles = function headerStyles(_ref4) {
194
216
  var isArchiveSideBarVisible = _ref4.isArchiveSideBarVisible;
195
217
  return (0, _react.css)({
196
218
  display: 'flex',
219
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
197
220
  paddingLeft: isArchiveSideBarVisible ? "".concat(_styles2.ArchiveSideBarWidth, "px") : '0'
198
221
  });
199
222
  };
200
223
  var leftHeaderStyles = (0, _react.css)({
201
224
  flex: 1,
202
225
  overflow: 'hidden',
226
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
203
227
  '> *': {
204
228
  pointerEvents: 'all'
205
229
  }
@@ -224,8 +248,11 @@ var imgStyles = function imgStyles(_ref5) {
224
248
  display: 'inline-block',
225
249
  verticalAlign: 'middle',
226
250
  position: 'relative',
251
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
227
252
  cursor: cursor
228
- }, shouldPixelate ? "/* Prevent images from being smoothed when scaled up */\n image-rendering: optimizeSpeed; /* Legal fallback */\n image-rendering: -moz-crisp-edges; /* Firefox */\n image-rendering: -o-crisp-edges; /* Opera */\n image-rendering: -webkit-optimize-contrast; /* Safari */\n image-rendering: optimize-contrast; /* CSS3 Proposed */\n image-rendering: crisp-edges; /* CSS4 Proposed */\n image-rendering: pixelated; /* CSS4 Proposed */\n -ms-interpolation-mode: nearest-neighbor; /* IE8+ */" : "");
253
+ },
254
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
255
+ shouldPixelate ? "/* Prevent images from being smoothed when scaled up */\n image-rendering: optimizeSpeed; /* Legal fallback */\n image-rendering: -moz-crisp-edges; /* Firefox */\n image-rendering: -o-crisp-edges; /* Opera */\n image-rendering: -webkit-optimize-contrast; /* Safari */\n image-rendering: optimize-contrast; /* CSS3 Proposed */\n image-rendering: crisp-edges; /* CSS4 Proposed */\n image-rendering: pixelated; /* CSS4 Proposed */\n -ms-interpolation-mode: nearest-neighbor; /* IE8+ */" : "");
229
256
  };
230
257
  var medatadataTextWrapperStyles = (0, _react.css)({
231
258
  overflow: 'hidden'
@@ -233,11 +260,15 @@ var medatadataTextWrapperStyles = (0, _react.css)({
233
260
  var metadataWrapperStyles = (0, _react.css)({
234
261
  display: 'flex'
235
262
  });
263
+
264
+ // 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
236
265
  var metadataFileNameStyles = (0, _react.css)((0, _mediaUi.ellipsis)());
237
266
  var metadataSubTextStyles = (0, _react.css)({
238
267
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
239
268
  color: '#c7d1db'
240
- }, (0, _mediaUi.ellipsis)());
269
+ },
270
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
271
+ (0, _mediaUi.ellipsis)());
241
272
  var metadataIconWrapperStyles = (0, _primitives.xcss)({
242
273
  paddingTop: 'space.050',
243
274
  paddingRight: 'space.150'
@@ -246,6 +277,7 @@ var rightHeaderStyles = (0, _react.css)({
246
277
  textAlign: 'right',
247
278
  marginRight: "var(--ds-space-500, 40px)",
248
279
  minWidth: '200px',
280
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
249
281
  '> *': {
250
282
  pointerEvents: 'all'
251
283
  }
@@ -257,7 +289,9 @@ var customAudioPlayerWrapperStyles = (0, _react.css)({
257
289
  width: '100%'
258
290
  });
259
291
  var audioPlayerStyles = (0, _react.css)({
292
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
260
293
  backgroundColor: _styles.blanketColor,
294
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
261
295
  borderRadius: (0, _constants.borderRadius)(),
262
296
  alignItems: 'center',
263
297
  justifyContent: 'center',
@@ -287,6 +321,7 @@ var defaultCoverWrapperStyles = (0, _react.css)({
287
321
  display: 'flex',
288
322
  alignItems: 'center',
289
323
  justifyContent: 'center',
324
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
290
325
  '> *': {
291
326
  transform: 'scale(2)'
292
327
  }
@@ -294,14 +329,16 @@ var defaultCoverWrapperStyles = (0, _react.css)({
294
329
  var downloadButtonWrapperStyles = (0, _react.css)({
295
330
  marginTop: "var(--ds-space-300, 28px)",
296
331
  textAlign: 'center',
332
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
297
333
  button: {
298
334
  '&:hover, &:active': {
299
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
335
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
300
336
  color: '#161a1d !important'
301
337
  }
302
338
  }
303
339
  });
304
340
  var customVideoPlayerWrapperStyles = (0, _react.css)({
341
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
305
342
  video: {
306
343
  flex: 1,
307
344
  width: '100vw',
@@ -315,6 +352,7 @@ var sidebarWrapperStyles = (0, _react.css)({
315
352
  width: "".concat(SIDEBAR_WIDTH, "px"),
316
353
  height: '100vh',
317
354
  overflow: 'hidden auto',
355
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
318
356
  backgroundColor: "var(--ds-surface, ".concat(_modalSpinner.headerAndSidebarBackgroundColor, ")"),
319
357
  color: "var(--ds-text, #c7d1db)"
320
358
  });
@@ -344,6 +382,7 @@ var HeaderWrapper = exports.HeaderWrapper = function HeaderWrapper(_ref7) {
344
382
  children = _ref7.children,
345
383
  isArchiveSideBarVisible = _ref7.isArchiveSideBarVisible;
346
384
  return (0, _react.jsx)("div", {
385
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
347
386
  css: headerWrapperStyles({
348
387
  isArchiveSideBarVisible: isArchiveSideBarVisible
349
388
  })
@@ -381,11 +420,14 @@ var CloseButtonWrapper = exports.CloseButtonWrapper = function CloseButtonWrappe
381
420
  var ContentWrapper = exports.ContentWrapper = function ContentWrapper(_ref11) {
382
421
  var isSidebarVisible = _ref11.isSidebarVisible,
383
422
  children = _ref11.children;
384
- return (0, _react.jsx)("div", {
385
- css: contentWrapperStyles({
386
- isSidebarVisible: isSidebarVisible
387
- })
388
- }, children);
423
+ return (
424
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
425
+ (0, _react.jsx)("div", {
426
+ css: contentWrapperStyles({
427
+ isSidebarVisible: isSidebarVisible
428
+ })
429
+ }, children)
430
+ );
389
431
  };
390
432
  var ZoomWrapper = exports.ZoomWrapper = function ZoomWrapper(_ref12) {
391
433
  var className = _ref12.className,
@@ -488,11 +530,14 @@ var Arrow = exports.Arrow = function Arrow(_ref21) {
488
530
  var LeftWrapper = exports.LeftWrapper = function LeftWrapper(_ref22) {
489
531
  var children = _ref22.children,
490
532
  isArchiveSideBarVisible = _ref22.isArchiveSideBarVisible;
491
- return (0, _react.jsx)("div", {
492
- css: leftWrapperStyles({
493
- isArchiveSideBarVisible: isArchiveSideBarVisible
494
- })
495
- }, children);
533
+ return (
534
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
535
+ (0, _react.jsx)("div", {
536
+ css: leftWrapperStyles({
537
+ isArchiveSideBarVisible: isArchiveSideBarVisible
538
+ })
539
+ }, children)
540
+ );
496
541
  };
497
542
  var RightWrapper = exports.RightWrapper = function RightWrapper(_ref23) {
498
543
  var children = _ref23.children;
@@ -508,7 +553,7 @@ var Header = exports.Header = function Header(_ref24) {
508
553
  isArchiveSideBarVisible = _ref24.isArchiveSideBarVisible,
509
554
  className = _ref24.className;
510
555
  return (
511
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
556
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
512
557
  (0, _react.jsx)("div", {
513
558
  css: headerStyles({
514
559
  isArchiveSideBarVisible: isArchiveSideBarVisible
@@ -569,7 +614,9 @@ var Img = exports.Img = function Img(_ref27) {
569
614
  }, [canDrag, isDragging]);
570
615
  return (0, _react.jsx)("img", {
571
616
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
572
- className: className,
617
+ className: className
618
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
619
+ ,
573
620
  css: imgStyles({
574
621
  cursor: cursor,
575
622
  shouldPixelate: shouldPixelate
@@ -152,6 +152,13 @@ var ItemViewerV2Base = exports.ItemViewerV2Base = function ItemViewerV2Base(_ref
152
152
 
153
153
  // Did mount
154
154
 
155
+ (0, _react.useEffect)(function () {
156
+ if ((0, _mediaClient.isExternalImageIdentifier)(identifier)) {
157
+ return;
158
+ }
159
+ (0, _analytics.fireAnalytics)((0, _commenced.createCommencedEvent)(identifier === null || identifier === void 0 ? void 0 : identifier.id, traceContext.current), createAnalyticsEventRef.current);
160
+ (0, _ufoExperiences.startMediaFileUfoExperience)();
161
+ }, [identifier]);
155
162
  (0, _react.useEffect)(function () {
156
163
  if ((0, _mediaClient.isExternalImageIdentifier)(identifier)) {
157
164
  // external images do not need to talk to our backend,
@@ -160,11 +167,8 @@ var ItemViewerV2Base = exports.ItemViewerV2Base = function ItemViewerV2Base(_ref
160
167
  setItem(_domain.Outcome.successful('external-image'));
161
168
  return;
162
169
  }
163
- (0, _analytics.fireAnalytics)((0, _commenced.createCommencedEvent)(identifier === null || identifier === void 0 ? void 0 : identifier.id, traceContext.current), createAnalyticsEventRef.current);
164
- (0, _ufoExperiences.startMediaFileUfoExperience)();
165
170
 
166
171
  // File Subscription
167
-
168
172
  if (fileState) {
169
173
  var status = fileState.status;
170
174
  if (fileState.status !== 'error') {
@@ -194,9 +198,9 @@ var ItemViewerV2Base = exports.ItemViewerV2Base = function ItemViewerV2Base(_ref
194
198
  }
195
199
  });
196
200
  }, [item]);
197
- var onLoadFail = (0, _react.useCallback)(function (mediaViewerError, data) {
198
- setItem(_domain.Outcome.failed(mediaViewerError, data));
199
- }, []);
201
+ var onLoadFail = (0, _react.useCallback)(function (mediaViewerError) {
202
+ setItem(_domain.Outcome.failed(mediaViewerError, fileState));
203
+ }, [fileState]);
200
204
  var renderItem = function renderItem(fileItem) {
201
205
  var collectionName = (0, _mediaClient.isFileIdentifier)(identifier) ? identifier.collectionName : undefined;
202
206
  var viewerProps = {
@@ -253,9 +257,7 @@ var ItemViewerV2Base = exports.ItemViewerV2Base = function ItemViewerV2Base(_ref
253
257
  case 'doc':
254
258
  return /*#__PURE__*/_react.default.createElement(DocViewerV2, (0, _extends2.default)({
255
259
  onSuccess: onSuccess,
256
- onError: function onError(err) {
257
- onLoadFail(err, fileState);
258
- }
260
+ onError: onLoadFail
259
261
  }, viewerProps));
260
262
  case 'archive':
261
263
  return /*#__PURE__*/_react.default.createElement(_archiveViewerLoader.default, (0, _extends2.default)({
@@ -10,6 +10,8 @@ var _colors = require("@atlaskit/theme/colors");
10
10
  var _reactScrolllock = require("react-scrolllock");
11
11
  /** @jsx jsx */
12
12
 
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
+
13
15
  var archiveItemViewerWrapperStyles = (0, _react.css)({
14
16
  width: '100%',
15
17
  display: 'flex',
@@ -21,6 +23,7 @@ var archiveSideBarStyles = (0, _react.css)({
21
23
  position: 'absolute',
22
24
  left: 0,
23
25
  top: 0,
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
24
27
  width: "".concat(_styles.ArchiveSideBarWidth, "px"),
25
28
  bottom: 0,
26
29
  boxSizing: 'border-box',
@@ -75,7 +78,7 @@ var archiveLayoutStyles = (0, _react.css)({
75
78
  var archiveViewerWrapperStyles = (0, _react.css)({
76
79
  position: 'absolute',
77
80
  top: 0,
78
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
81
+ // 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
79
82
  left: "".concat(_styles.ArchiveSideBarWidth, "px"),
80
83
  right: 0,
81
84
  bottom: 0,
@@ -25,7 +25,7 @@ var _util = require("./util");
25
25
  var _styles = require("./styles");
26
26
  var _reactScrolllock = require("react-scrolllock");
27
27
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
28
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
29
29
  // Based on some basic benchmarking with @atlaskit/code it was found that ~10,000 lines took around ~5secs to render, which locks the main thread.
30
30
  // Therefore we set a hard limit on the amount of lines which we apply formatting to,
31
31
  // otherwise the "text" language will be used which is plain and more performant
@@ -42,6 +42,7 @@ var CodeViewWrapper = exports.CodeViewWrapper = function CodeViewWrapper(_ref) {
42
42
  }, children));
43
43
  };
44
44
  var CodeViewerHeaderBar = exports.CodeViewerHeaderBar = function CodeViewerHeaderBar() {
45
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
45
46
  return (0, _react.jsx)("div", {
46
47
  css: _styles.codeViewerHeaderBarStyles
47
48
  });
@@ -117,7 +118,9 @@ var CodeViewRenderer = exports.CodeViewRenderer = /*#__PURE__*/function (_Compon
117
118
  //Use src to measure the real file size
118
119
  //item.size is incorrect for archives with mutiple docs inside.
119
120
  var fileSize = new Blob([src]).size;
120
- var codeViewer = (0, _util.lineCount)(src) > MAX_FORMATTED_LINES || fileSize > MAX_FILE_SIZE_USE_CODE_VIEWER ? (0, _react.jsx)("code", {
121
+ var codeViewer = (0, _util.lineCount)(src) > MAX_FORMATTED_LINES || fileSize > MAX_FILE_SIZE_USE_CODE_VIEWER ?
122
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
123
+ (0, _react.jsx)("code", {
121
124
  css: _styles.codeViewerHTMLStyles,
122
125
  "data-testid": "code-block"
123
126
  }, src) : (0, _react.jsx)(_block.default, {
@@ -6,26 +6,32 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.codeViewerHeaderBarStyles = exports.codeViewerHTMLStyles = exports.codeViewWrapperStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _theme = require("@atlaskit/theme");
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
+
9
11
  // AFP-2532 TODO: Fix automatic suppressions below
10
12
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
11
13
 
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
12
15
  var codeViewWrapperStyles = exports.codeViewWrapperStyles = (0, _react.css)({
13
16
  position: 'absolute',
14
17
  left: 0,
15
18
  top: 0,
16
19
  right: 0,
17
20
  bottom: 0,
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
18
22
  backgroundColor: "var(--ds-surface, ".concat(_theme.colors.N20, ")"),
19
23
  overflow: 'auto'
20
24
  });
21
25
 
22
26
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
23
28
  var codeViewerHeaderBarStyles = exports.codeViewerHeaderBarStyles = (0, _react.css)({
24
29
  height: '75px',
25
30
  backgroundColor: '#1d2125'
26
31
  });
27
32
  /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
28
33
 
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
29
35
  var codeViewerHTMLStyles = exports.codeViewerHTMLStyles = (0, _react.css)({
30
36
  display: 'flex',
31
37
  lineHeight: '20px',
@@ -22,6 +22,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
22
22
  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
23
  /**@jsx jsx */
24
24
 
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
+
25
27
  var COLOR_SHADE = '#b6c2cf';
26
28
  var headingStyle = (0, _react2.css)({
27
29
  fontSize: '14px',
@@ -34,6 +34,8 @@ var _pdfPasswordInput2 = require("../../analytics/events/screen/pdfPasswordInput
34
34
  var _passwordPdf = require("../../analytics/events/screen/passwordPdf");
35
35
  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); }
36
36
  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; }
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
38
+
37
39
  var pdfViewerClassName = exports.pdfViewerClassName = 'pdfViewer';
38
40
 
39
41
  // Styles are partially copied from https://github.com/mozilla/pdfjs-dist/blob/v2.9.359/web/pdf_viewer.css
@@ -42,14 +44,17 @@ var pdfViewerClassName = exports.pdfViewerClassName = 'pdfViewer';
42
44
  var globalStyles = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat(pdfViewerClassName), {
43
45
  marginTop: "var(--ds-space-800, 64px)",
44
46
  marginBottom: "var(--ds-space-800, 64px)",
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
45
48
  '.page': {
46
49
  margin: "1px auto ".concat("var(--ds-space-negative-100, -8px)", " auto"),
47
50
  border: '9px solid transparent',
48
51
  position: 'relative'
49
52
  },
53
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
50
54
  '.canvasWrapper': {
51
55
  overflow: 'hidden'
52
56
  },
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
53
58
  '.textLayer': {
54
59
  position: 'absolute',
55
60
  left: 0,
@@ -60,6 +65,7 @@ var globalStyles = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat
60
65
  opacity: 0.2,
61
66
  lineHeight: 1
62
67
  },
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
63
69
  '.textLayer span, .textLayer br': {
64
70
  color: 'transparent',
65
71
  position: 'absolute',
@@ -67,16 +73,20 @@ var globalStyles = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat
67
73
  cursor: 'text',
68
74
  transformOrigin: '0% 0%'
69
75
  },
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
70
77
  '.textLayer ::-moz-selection': {
71
78
  background: 'rgba(0, 0, 255, 1)'
72
79
  },
80
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
73
81
  '.textLayer ::selection': {
74
82
  background: 'rgba(0, 0, 255, 1)'
75
83
  },
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
76
85
  '.annotationLayer section': {
77
86
  position: 'absolute',
78
87
  textAlign: 'initial'
79
88
  },
89
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
80
90
  '.annotationLayer .linkAnnotation > a, .annotationLayer .buttonWidgetAnnotation.pushButton > a': {
81
91
  position: 'absolute',
82
92
  fontSize: '1em',
@@ -85,6 +95,7 @@ var globalStyles = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat
85
95
  width: '100%',
86
96
  height: '100%'
87
97
  },
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
88
99
  '.annotationLayer .linkAnnotation > a:hover, .annotationLayer .buttonWidgetAnnotation.pushButton > a:hover': {
89
100
  opacity: 0.2,
90
101
  background: 'rgba(255, 255, 0, 1)',
@@ -7,6 +7,7 @@ exports.ImageWrapper = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _react2 = require("react");
9
9
  /** @jsx jsx */
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
11
 
11
12
  var imageWrapperStyles = (0, _react.css)({
12
13
  width: '100vw',
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getErrorReason = void 0;
7
+ var getErrorReason = exports.getErrorReason = function getErrorReason(svgReason) {
8
+ switch (svgReason) {
9
+ case 'img-error':
10
+ return 'svg-img-error';
11
+ case 'binary-fetch':
12
+ return 'svg-binary-fetch';
13
+ default:
14
+ return 'svg-unknown-error';
15
+ }
16
+ };