@atlaskit/media-viewer 53.2.4 → 54.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/AGENTS.md +62 -0
  2. package/CHANGELOG.md +32 -0
  3. package/classnames/package.json +1 -8
  4. package/dist/cjs/analytics/index.js +1 -1
  5. package/dist/cjs/analytics/ufoExperiences.js +1 -1
  6. package/dist/cjs/download.js +2 -2
  7. package/dist/cjs/utils/getObjectUrlFromFileState.js +15 -16
  8. package/dist/cjs/utils/index.js +16 -17
  9. package/dist/cjs/viewers/archiveSidebar/archive-sidebar-folder-entry.js +11 -11
  10. package/dist/cjs/viewers/archiveSidebar/archive-sidebar-renderer.js +12 -12
  11. package/dist/cjs/viewers/archiveSidebar/archive-sidebar.js +28 -28
  12. package/dist/cjs/viewers/archiveSidebar/archive.js +29 -29
  13. package/dist/cjs/viewers/archiveSidebar/archiveViewerLoader.js +12 -12
  14. package/dist/cjs/viewers/audio.js +37 -37
  15. package/dist/cjs/viewers/codeViewer/codeViewerRenderer-compiled.js +2 -2
  16. package/dist/cjs/viewers/codeViewer/index.js +35 -35
  17. package/dist/cjs/viewers/doc/doc-viewer.js +29 -27
  18. package/dist/cjs/viewers/doc/index.js +2 -2
  19. package/dist/cjs/viewers/image/index.js +43 -44
  20. package/dist/cjs/viewers/video.js +20 -20
  21. package/dist/es2019/analytics/index.js +1 -1
  22. package/dist/es2019/analytics/ufoExperiences.js +1 -1
  23. package/dist/esm/analytics/index.js +1 -1
  24. package/dist/esm/analytics/ufoExperiences.js +1 -1
  25. package/dist/esm/download.js +2 -2
  26. package/dist/esm/utils/getObjectUrlFromFileState.js +15 -16
  27. package/dist/esm/utils/index.js +16 -17
  28. package/dist/esm/viewers/archiveSidebar/archive-sidebar-folder-entry.js +11 -11
  29. package/dist/esm/viewers/archiveSidebar/archive-sidebar-renderer.js +11 -11
  30. package/dist/esm/viewers/archiveSidebar/archive-sidebar.js +28 -28
  31. package/dist/esm/viewers/archiveSidebar/archive.js +29 -29
  32. package/dist/esm/viewers/archiveSidebar/archiveViewerLoader.js +11 -11
  33. package/dist/esm/viewers/audio.js +37 -37
  34. package/dist/esm/viewers/codeViewer/codeViewerRenderer-compiled.js +2 -2
  35. package/dist/esm/viewers/codeViewer/index.js +34 -34
  36. package/dist/esm/viewers/doc/doc-viewer.js +28 -26
  37. package/dist/esm/viewers/doc/index.js +2 -2
  38. package/dist/esm/viewers/image/index.js +43 -44
  39. package/dist/esm/viewers/video.js +20 -20
  40. package/media-viewer-loader/package.json +1 -8
  41. package/package.json +33 -42
  42. package/types/package.json +1 -8
  43. package/viewer-options/package.json +1 -8
  44. package/dist/types-ts4.5/analytics/events/index.d.ts +0 -17
  45. package/dist/types-ts4.5/analytics/events/operational/_mediaFile.d.ts +0 -3
  46. package/dist/types-ts4.5/analytics/events/operational/commenced.d.ts +0 -5
  47. package/dist/types-ts4.5/analytics/events/operational/download.d.ts +0 -9
  48. package/dist/types-ts4.5/analytics/events/operational/loadFailed.d.ts +0 -7
  49. package/dist/types-ts4.5/analytics/events/operational/loadSucceeded.d.ts +0 -11
  50. package/dist/types-ts4.5/analytics/events/operational/previewUnsupported.d.ts +0 -6
  51. package/dist/types-ts4.5/analytics/events/operational/zipEntryLoadFailed.d.ts +0 -13
  52. package/dist/types-ts4.5/analytics/events/operational/zipEntryLoadSucceeded.d.ts +0 -12
  53. package/dist/types-ts4.5/analytics/events/screen/modal.d.ts +0 -3
  54. package/dist/types-ts4.5/analytics/events/screen/passwordPdf.d.ts +0 -3
  55. package/dist/types-ts4.5/analytics/events/screen/pdfPasswordInput.d.ts +0 -3
  56. package/dist/types-ts4.5/analytics/events/ui/_clickedButton.d.ts +0 -2
  57. package/dist/types-ts4.5/analytics/events/ui/closed.d.ts +0 -8
  58. package/dist/types-ts4.5/analytics/events/ui/downloadButtonClicked.d.ts +0 -8
  59. package/dist/types-ts4.5/analytics/events/ui/failedPreviewDownloadButtonClicked.d.ts +0 -10
  60. package/dist/types-ts4.5/analytics/events/ui/navigated.d.ts +0 -12
  61. package/dist/types-ts4.5/analytics/events/ui/zoomInButtonClicked.d.ts +0 -8
  62. package/dist/types-ts4.5/analytics/events/ui/zoomOutButtonClicked.d.ts +0 -6
  63. package/dist/types-ts4.5/analytics/index.d.ts +0 -17
  64. package/dist/types-ts4.5/analytics/ufoExperiences.d.ts +0 -19
  65. package/dist/types-ts4.5/classnames.d.ts +0 -5
  66. package/dist/types-ts4.5/components/media-viewer-error-boundary.d.ts +0 -3
  67. package/dist/types-ts4.5/components/media-viewer-loader.d.ts +0 -3
  68. package/dist/types-ts4.5/components/media-viewer.d.ts +0 -5
  69. package/dist/types-ts4.5/components/portal.d.ts +0 -4
  70. package/dist/types-ts4.5/components/types.d.ts +0 -45
  71. package/dist/types-ts4.5/content.d.ts +0 -11
  72. package/dist/types-ts4.5/domain/index.d.ts +0 -1
  73. package/dist/types-ts4.5/domain/outcome.d.ts +0 -31
  74. package/dist/types-ts4.5/domain/zoomLevel.d.ts +0 -15
  75. package/dist/types-ts4.5/download.d.ts +0 -20
  76. package/dist/types-ts4.5/error-images.d.ts +0 -2
  77. package/dist/types-ts4.5/errorMessage.d.ts +0 -33
  78. package/dist/types-ts4.5/errors.d.ts +0 -23
  79. package/dist/types-ts4.5/header.d.ts +0 -19
  80. package/dist/types-ts4.5/index.d.ts +0 -3
  81. package/dist/types-ts4.5/item-viewer.d.ts +0 -32
  82. package/dist/types-ts4.5/list.d.ts +0 -24
  83. package/dist/types-ts4.5/loading.d.ts +0 -2
  84. package/dist/types-ts4.5/media-viewer.d.ts +0 -16
  85. package/dist/types-ts4.5/navigation.d.ts +0 -25
  86. package/dist/types-ts4.5/styleWrappers.d.ts +0 -122
  87. package/dist/types-ts4.5/styles.d.ts +0 -2
  88. package/dist/types-ts4.5/utils/closeOnDirectClick.d.ts +0 -2
  89. package/dist/types-ts4.5/utils/getIdentifierCollection.d.ts +0 -2
  90. package/dist/types-ts4.5/utils/getObjectUrlFromFileState.d.ts +0 -2
  91. package/dist/types-ts4.5/utils/index.d.ts +0 -10
  92. package/dist/types-ts4.5/utils/isIE.d.ts +0 -1
  93. package/dist/types-ts4.5/viewerOptions.d.ts +0 -20
  94. package/dist/types-ts4.5/viewers/archiveSidebar/archive-download-button.d.ts +0 -8
  95. package/dist/types-ts4.5/viewers/archiveSidebar/archive-sidebar-folder-entry.d.ts +0 -24
  96. package/dist/types-ts4.5/viewers/archiveSidebar/archive-sidebar-header.d.ts +0 -9
  97. package/dist/types-ts4.5/viewers/archiveSidebar/archive-sidebar-renderer.d.ts +0 -26
  98. package/dist/types-ts4.5/viewers/archiveSidebar/archive-sidebar.d.ts +0 -28
  99. package/dist/types-ts4.5/viewers/archiveSidebar/archive.d.ts +0 -37
  100. package/dist/types-ts4.5/viewers/archiveSidebar/archiveViewerLoader.d.ts +0 -12
  101. package/dist/types-ts4.5/viewers/archiveSidebar/consts.d.ts +0 -2
  102. package/dist/types-ts4.5/viewers/archiveSidebar/custom-button-item.d.ts +0 -2
  103. package/dist/types-ts4.5/viewers/archiveSidebar/nativePdfViewer.d.ts +0 -9
  104. package/dist/types-ts4.5/viewers/archiveSidebar/styleWrappers.d.ts +0 -30
  105. package/dist/types-ts4.5/viewers/archiveSidebar/styles.d.ts +0 -1
  106. package/dist/types-ts4.5/viewers/archiveSidebar/types.d.ts +0 -13
  107. package/dist/types-ts4.5/viewers/audio.d.ts +0 -33
  108. package/dist/types-ts4.5/viewers/base-viewer.d.ts +0 -32
  109. package/dist/types-ts4.5/viewers/codeViewer/CodeRendererAdvanced/CodeRendererAdvanced.d.ts +0 -11
  110. package/dist/types-ts4.5/viewers/codeViewer/CodeRendererAdvanced/theme.d.ts +0 -4
  111. package/dist/types-ts4.5/viewers/codeViewer/codeViewerRenderer-compiled.d.ts +0 -29
  112. package/dist/types-ts4.5/viewers/codeViewer/codeViewerRenderer.d.ts +0 -23
  113. package/dist/types-ts4.5/viewers/codeViewer/index.d.ts +0 -27
  114. package/dist/types-ts4.5/viewers/codeViewer/msg-parser.d.ts +0 -8
  115. package/dist/types-ts4.5/viewers/codeViewer/styles.d.ts +0 -4
  116. package/dist/types-ts4.5/viewers/codeViewer/util.d.ts +0 -4
  117. package/dist/types-ts4.5/viewers/customViewer/customViewer.d.ts +0 -13
  118. package/dist/types-ts4.5/viewers/doc/doc-viewer.d.ts +0 -13
  119. package/dist/types-ts4.5/viewers/doc/index.d.ts +0 -36
  120. package/dist/types-ts4.5/viewers/doc/passwordInput.d.ts +0 -10
  121. package/dist/types-ts4.5/viewers/image/index.d.ts +0 -35
  122. package/dist/types-ts4.5/viewers/image/interactive-img.d.ts +0 -42
  123. package/dist/types-ts4.5/viewers/modalSpinner.d.ts +0 -8
  124. package/dist/types-ts4.5/viewers/svg/ImageWrapper-compiled.d.ts +0 -7
  125. package/dist/types-ts4.5/viewers/svg/ImageWrapper.d.ts +0 -7
  126. package/dist/types-ts4.5/viewers/svg/errors.d.ts +0 -3
  127. package/dist/types-ts4.5/viewers/svg/index.d.ts +0 -14
  128. package/dist/types-ts4.5/viewers/svg/utils.d.ts +0 -5
  129. package/dist/types-ts4.5/viewers/video.d.ts +0 -32
  130. package/dist/types-ts4.5/zoomControls.d.ts +0 -15
@@ -53,63 +53,63 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
53
53
  key: "init",
54
54
  value: function () {
55
55
  var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
56
- var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, preview, _yield$preview, value, origin, item, response, imgError;
57
- return _regeneratorRuntime.wrap(function _callee$(_context) {
56
+ var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, preview, _yield$preview, value, origin, item, response, imgError, _t, _t2, _t3;
57
+ return _regeneratorRuntime.wrap(function (_context) {
58
58
  while (1) switch (_context.prev = _context.next) {
59
59
  case 0:
60
60
  _this$props = this.props, fileState = _this$props.item, mediaClient = _this$props.mediaClient, collectionName = _this$props.collectionName, traceContext = _this$props.traceContext;
61
61
  if (!isErrorFileState(fileState)) {
62
- _context.next = 3;
62
+ _context.next = 1;
63
63
  break;
64
64
  }
65
65
  return _context.abrupt("return");
66
- case 3:
66
+ case 1:
67
67
  controller = typeof AbortController !== 'undefined' ? new AbortController() : undefined;
68
- _context.prev = 4;
68
+ _context.prev = 2;
69
69
  orientation = 1;
70
70
  isLocalFileReference = false;
71
- _context.prev = 7;
72
- _context.next = 10;
71
+ _context.prev = 3;
72
+ _context.next = 4;
73
73
  return mediaClient.getClientId(collectionName);
74
- case 10:
74
+ case 4:
75
75
  clientId = _context.sent;
76
- _context.next = 15;
76
+ _context.next = 6;
77
77
  break;
78
- case 13:
79
- _context.prev = 13;
80
- _context.t0 = _context["catch"](7);
81
- case 15:
78
+ case 5:
79
+ _context.prev = 5;
80
+ _t = _context["catch"](3);
81
+ case 6:
82
82
  preview = fileState.preview;
83
83
  if (!preview) {
84
- _context.next = 33;
84
+ _context.next = 11;
85
85
  break;
86
86
  }
87
- _context.next = 19;
87
+ _context.next = 7;
88
88
  return preview;
89
- case 19:
89
+ case 7:
90
90
  _yield$preview = _context.sent;
91
91
  value = _yield$preview.value;
92
92
  origin = _yield$preview.origin;
93
93
  if (!(value instanceof Blob)) {
94
- _context.next = 30;
94
+ _context.next = 9;
95
95
  break;
96
96
  }
97
- _context.next = 25;
97
+ _context.next = 8;
98
98
  return getOrientation(value);
99
- case 25:
99
+ case 8:
100
100
  orientation = _context.sent;
101
101
  objectUrl = URL.createObjectURL(value);
102
102
  isLocalFileReference = origin === 'local';
103
- _context.next = 31;
103
+ _context.next = 10;
104
104
  break;
105
- case 30:
105
+ case 9:
106
106
  objectUrl = value;
107
- case 31:
108
- _context.next = 46;
107
+ case 10:
108
+ _context.next = 14;
109
109
  break;
110
- case 33:
110
+ case 11:
111
111
  if (!isImageRepresentationReady(fileState)) {
112
- _context.next = 44;
112
+ _context.next = 13;
113
113
  break;
114
114
  }
115
115
  item = processedFileStateToMediaItem(fileState);
@@ -120,31 +120,30 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
120
120
  this.cancelImageFetch = function () {
121
121
  return controller === null || controller === void 0 ? void 0 : controller.abort();
122
122
  };
123
- _context.t1 = URL;
124
- _context.next = 40;
123
+ _t2 = URL;
124
+ _context.next = 12;
125
125
  return response;
126
- case 40:
127
- _context.t2 = _context.sent;
128
- objectUrl = _context.t1.createObjectURL.call(_context.t1, _context.t2);
129
- _context.next = 46;
126
+ case 12:
127
+ objectUrl = _t2.createObjectURL.call(_t2, _context.sent);
128
+ _context.next = 14;
130
129
  break;
131
- case 44:
130
+ case 13:
132
131
  this.setState({
133
132
  content: Outcome.pending()
134
133
  });
135
134
  return _context.abrupt("return");
136
- case 46:
135
+ case 14:
137
136
  if (!(!isLocalFileReference &&
138
137
  // objectUrl at this point is binary file already
139
138
  !isErrorFileState(fileState) && fileState.status !== 'uploading' && fileState.mediaType === 'image' && isImageMimeTypeSupportedByBrowser(fileState.mimeType))) {
140
- _context.next = 50;
139
+ _context.next = 16;
141
140
  break;
142
141
  }
143
- _context.next = 49;
142
+ _context.next = 15;
144
143
  return mediaClient.file.getFileBinaryURL(fileState.id, collectionName);
145
- case 49:
144
+ case 15:
146
145
  originalBinaryImageUrl = _context.sent;
147
- case 50:
146
+ case 16:
148
147
  this.setState({
149
148
  content: Outcome.successful({
150
149
  objectUrl: objectUrl,
@@ -153,24 +152,24 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
153
152
  clientId: clientId
154
153
  })
155
154
  });
156
- _context.next = 56;
155
+ _context.next = 18;
157
156
  break;
158
- case 53:
159
- _context.prev = 53;
160
- _context.t3 = _context["catch"](4);
157
+ case 17:
158
+ _context.prev = 17;
159
+ _t3 = _context["catch"](2);
161
160
  // TODO : properly handle aborted requests (MS-2843)
162
161
  if (!(controller !== null && controller !== void 0 && controller.signal.aborted)) {
163
- imgError = new MediaViewerError('imageviewer-fetch-url', _context.t3 instanceof Error ? _context.t3 : undefined);
162
+ imgError = new MediaViewerError('imageviewer-fetch-url', _t3 instanceof Error ? _t3 : undefined);
164
163
  this.setState({
165
164
  content: Outcome.failed(imgError)
166
165
  });
167
166
  this.props.onError(imgError);
168
167
  }
169
- case 56:
168
+ case 18:
170
169
  case "end":
171
170
  return _context.stop();
172
171
  }
173
- }, _callee, this, [[4, 53], [7, 13]]);
172
+ }, _callee, this, [[2, 17], [3, 5]]);
174
173
  }));
175
174
  function init() {
176
175
  return _init.apply(this, arguments);
@@ -116,58 +116,58 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
116
116
  key: "init",
117
117
  value: function () {
118
118
  var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
119
- var _this$props3, mediaClient, item, collectionName, contentUrl;
120
- return _regeneratorRuntime.wrap(function _callee$(_context) {
119
+ var _this$props3, mediaClient, item, collectionName, contentUrl, _t;
120
+ return _regeneratorRuntime.wrap(function (_context) {
121
121
  while (1) switch (_context.prev = _context.next) {
122
122
  case 0:
123
123
  _this$props3 = this.props, mediaClient = _this$props3.mediaClient, item = _this$props3.item, collectionName = _this$props3.collectionName;
124
124
  _context.prev = 1;
125
125
  if (!(item.status === 'processed')) {
126
- _context.next = 10;
126
+ _context.next = 4;
127
127
  break;
128
128
  }
129
- _context.next = 5;
129
+ _context.next = 2;
130
130
  return mediaClient.file.getArtifactURL(item.artifacts, hdArtifact, collectionName);
131
- case 5:
131
+ case 2:
132
132
  contentUrl = _context.sent;
133
133
  if (contentUrl) {
134
- _context.next = 8;
134
+ _context.next = 3;
135
135
  break;
136
136
  }
137
137
  throw new MediaViewerError("videoviewer-missing-artefact");
138
- case 8:
139
- _context.next = 16;
138
+ case 3:
139
+ _context.next = 6;
140
140
  break;
141
- case 10:
142
- _context.next = 12;
141
+ case 4:
142
+ _context.next = 5;
143
143
  return getObjectUrlFromFileState(item);
144
- case 12:
144
+ case 5:
145
145
  contentUrl = _context.sent;
146
146
  if (contentUrl) {
147
- _context.next = 16;
147
+ _context.next = 6;
148
148
  break;
149
149
  }
150
150
  this.setState({
151
151
  content: Outcome.pending()
152
152
  });
153
153
  return _context.abrupt("return");
154
- case 16:
154
+ case 6:
155
155
  this.setState({
156
156
  content: Outcome.successful(contentUrl)
157
157
  });
158
- _context.next = 22;
158
+ _context.next = 8;
159
159
  break;
160
- case 19:
161
- _context.prev = 19;
162
- _context.t0 = _context["catch"](1);
160
+ case 7:
161
+ _context.prev = 7;
162
+ _t = _context["catch"](1);
163
163
  this.setState({
164
- content: Outcome.failed(new MediaViewerError('videoviewer-fetch-url', _context.t0 instanceof Error ? _context.t0 : undefined))
164
+ content: Outcome.failed(new MediaViewerError('videoviewer-fetch-url', _t instanceof Error ? _t : undefined))
165
165
  });
166
- case 22:
166
+ case 8:
167
167
  case "end":
168
168
  return _context.stop();
169
169
  }
170
- }, _callee, this, [[1, 19]]);
170
+ }, _callee, this, [[1, 7]]);
171
171
  }));
172
172
  function init() {
173
173
  return _init.apply(this, arguments);
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/components/media-viewer-loader.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/components/media-viewer-loader.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/components/media-viewer-loader.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-viewer",
3
- "version": "53.2.4",
3
+ "version": "54.0.0",
4
4
  "description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": [
24
16
  "*.compiled.css"
25
17
  ],
@@ -38,31 +30,31 @@
38
30
  }
39
31
  },
40
32
  "dependencies": {
41
- "@atlaskit/analytics-next": "^11.2.0",
42
- "@atlaskit/button": "^23.11.0",
43
- "@atlaskit/code": "^17.5.0",
44
- "@atlaskit/css": "^0.19.0",
45
- "@atlaskit/form": "^15.5.0",
46
- "@atlaskit/heading": "^5.4.0",
47
- "@atlaskit/icon": "^35.0.0",
48
- "@atlaskit/icon-file-type": "^7.0.0",
49
- "@atlaskit/icon-lab": "^6.9.0",
50
- "@atlaskit/media-client": "^36.3.0",
51
- "@atlaskit/media-client-react": "^5.1.0",
52
- "@atlaskit/media-common": "^13.3.0",
53
- "@atlaskit/media-document-viewer": "^0.7.0",
54
- "@atlaskit/media-svg": "^2.3.0",
55
- "@atlaskit/media-ui": "^29.2.0",
56
- "@atlaskit/platform-feature-flags": "^1.1.0",
57
- "@atlaskit/portal": "^5.5.0",
58
- "@atlaskit/primitives": "^19.0.0",
59
- "@atlaskit/side-navigation": "^11.2.0",
60
- "@atlaskit/spinner": "^19.1.0",
61
- "@atlaskit/textfield": "^8.3.0",
62
- "@atlaskit/theme": "^24.0.0",
63
- "@atlaskit/tokens": "^13.0.0",
64
- "@atlaskit/tooltip": "^22.2.0",
65
- "@atlaskit/ufo": "^0.5.0",
33
+ "@atlaskit/analytics-next": "^12.0.0",
34
+ "@atlaskit/button": "^24.0.0",
35
+ "@atlaskit/code": "^18.0.0",
36
+ "@atlaskit/css": "^1.0.0",
37
+ "@atlaskit/form": "^16.0.0",
38
+ "@atlaskit/heading": "^6.0.0",
39
+ "@atlaskit/icon": "^36.0.0",
40
+ "@atlaskit/icon-file-type": "^8.0.0",
41
+ "@atlaskit/icon-lab": "^7.0.0",
42
+ "@atlaskit/media-client": "^37.0.0",
43
+ "@atlaskit/media-client-react": "^6.0.0",
44
+ "@atlaskit/media-common": "^14.0.0",
45
+ "@atlaskit/media-document-viewer": "^1.0.0",
46
+ "@atlaskit/media-svg": "^3.0.0",
47
+ "@atlaskit/media-ui": "^30.0.0",
48
+ "@atlaskit/platform-feature-flags": "^2.0.0",
49
+ "@atlaskit/portal": "^6.0.0",
50
+ "@atlaskit/primitives": "^20.0.0",
51
+ "@atlaskit/side-navigation": "^12.0.0",
52
+ "@atlaskit/spinner": "^20.0.0",
53
+ "@atlaskit/textfield": "^9.0.0",
54
+ "@atlaskit/theme": "^26.0.0",
55
+ "@atlaskit/tokens": "^14.0.0",
56
+ "@atlaskit/tooltip": "^23.0.0",
57
+ "@atlaskit/ufo": "^1.0.0",
66
58
  "@babel/runtime": "^7.0.0",
67
59
  "@codemirror/language": "6.10.8",
68
60
  "@codemirror/language-data": "6.5.1",
@@ -91,25 +83,24 @@
91
83
  "@af/integration-testing": "workspace:^",
92
84
  "@af/suppress-react-warnings": "workspace:^",
93
85
  "@af/visual-regression": "workspace:^",
94
- "@atlaskit/media-core": "^37.1.0",
86
+ "@atlaskit/media-core": "^38.0.0",
95
87
  "@atlaskit/media-integration-test-helpers": "workspace:^",
96
- "@atlaskit/media-state": "^2.1.0",
97
- "@atlaskit/media-test-data": "^3.3.0",
98
- "@atlaskit/media-test-helpers": "^41.1.0",
88
+ "@atlaskit/media-state": "^3.0.0",
89
+ "@atlaskit/media-test-data": "^4.0.0",
90
+ "@atlaskit/media-test-helpers": "^42.0.0",
99
91
  "@atlaskit/ssr": "workspace:^",
100
- "@atlaskit/toggle": "^15.6.0",
101
- "@atlassian/a11y-jest-testing": "^0.11.0",
92
+ "@atlaskit/toggle": "^17.0.0",
93
+ "@atlassian/a11y-jest-testing": "^0.12.0",
102
94
  "@atlassian/feature-flags-test-utils": "^1.1.0",
103
95
  "@atlassian/react-compiler-gating": "workspace:^",
96
+ "@atlassian/testing-library": "^0.6.0",
104
97
  "@atlassian/ufo": "^0.8.0",
105
98
  "@testing-library/dom": "^10.1.0",
106
99
  "@testing-library/react": "^16.3.0",
107
100
  "@testing-library/user-event": "^14.4.3",
108
101
  "@types/deep-equal": "^1.0.1",
109
- "@types/enzyme": "3.1.15",
110
102
  "@types/mime": "^2.0.1",
111
103
  "@types/react-loadable": "^5.4.1",
112
- "enzyme": "^3.10.0",
113
104
  "exenv": "^1.2.2",
114
105
  "jsverify": "^0.8.3",
115
106
  "react": "^18.2.0",
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/components/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/components/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/components/types.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/viewerOptions.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/viewerOptions.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/viewerOptions.d.ts"
17
10
  }
@@ -1,17 +0,0 @@
1
- import { type CommencedEventPayload } from './operational/commenced';
2
- import { type LoadFailedEventPayload } from './operational/loadFailed';
3
- import { type DownloadFailedEventPayload, type DownloadSucceededEventPayload } from './operational/download';
4
- import { type LoadSucceededEventPayload } from './operational/loadSucceeded';
5
- import { type PreviewUnsupportedEventPayload } from './operational/previewUnsupported';
6
- import { type ZipEntryLoadFailedEventPayload } from './operational/zipEntryLoadFailed';
7
- import { type ZipEntryLoadSucceededEventPayload } from './operational/zipEntryLoadSucceeded';
8
- import { type ModalEventPayload } from './screen/modal';
9
- import { type PdfPasswordInputScreenEventPayload } from './screen/pdfPasswordInput';
10
- import { type PasswordPdfScreenEventPayload } from './screen/passwordPdf';
11
- import { type ClosedEventPayload } from './ui/closed';
12
- import { type DownloadButtonClickedEventPayload } from './ui/downloadButtonClicked';
13
- import { type FailedPreviewDownloadButtonClickedEventPayload } from './ui/failedPreviewDownloadButtonClicked';
14
- import { type NavigatedEventPayload } from './ui/navigated';
15
- import { type ZoomInButtonClickEventPayload } from './ui/zoomInButtonClicked';
16
- import { type ZoomOutButtonClickEventPayload } from './ui/zoomOutButtonClicked';
17
- export type MediaViewerEventPayload = CommencedEventPayload | LoadFailedEventPayload | LoadSucceededEventPayload | PreviewUnsupportedEventPayload | ZipEntryLoadFailedEventPayload | ZipEntryLoadSucceededEventPayload | ModalEventPayload | PdfPasswordInputScreenEventPayload | PasswordPdfScreenEventPayload | ClosedEventPayload | DownloadButtonClickedEventPayload | FailedPreviewDownloadButtonClickedEventPayload | NavigatedEventPayload | ZoomInButtonClickEventPayload | ZoomOutButtonClickEventPayload | DownloadFailedEventPayload | DownloadSucceededEventPayload;
@@ -1,3 +0,0 @@
1
- import { type OperationalEventPayload, type OperationalAttributes } from '@atlaskit/media-common';
2
- /** common definition used by other mediaFile events */
3
- export type MediaFileEventPayload<Attributes extends OperationalAttributes, Action extends 'commenced' | 'loadSucceeded' | 'loadFailed' | 'previewUnsupported' | 'zipEntryLoadSucceeded' | 'zipEntryLoadFailed' | 'downloadSucceeded' | 'downloadFailed'> = OperationalEventPayload<Attributes, Action, 'mediaFile'>;
@@ -1,5 +0,0 @@
1
- import { type MediaTraceContext, type WithFileAttributes, type WithTraceContext } from '@atlaskit/media-common';
2
- import { type MediaFileEventPayload } from './_mediaFile';
3
- export type CommencedAttributes = WithFileAttributes & WithTraceContext;
4
- export type CommencedEventPayload = MediaFileEventPayload<CommencedAttributes, 'commenced'>;
5
- export declare const createCommencedEvent: (fileId: string, traceContext: MediaTraceContext) => CommencedEventPayload;
@@ -1,9 +0,0 @@
1
- import { type FileState } from '@atlaskit/media-client';
2
- import { type MediaFileEventPayload } from './_mediaFile';
3
- import { type MediaViewerFailureAttributes } from '../..';
4
- import { type MediaViewerError } from '../../../errors';
5
- import { type MediaTraceContext, type SuccessAttributes, type WithFileAttributes, type WithTraceContext } from '@atlaskit/media-common';
6
- export type DownloadFailedEventPayload = MediaFileEventPayload<MediaViewerFailureAttributes, 'downloadFailed'>;
7
- export type DownloadSucceededEventPayload = MediaFileEventPayload<SuccessAttributes & WithFileAttributes & WithTraceContext, 'downloadSucceeded'>;
8
- export declare const createDownloadSucceededEventPayload: (fileState?: FileState, traceContext?: MediaTraceContext) => DownloadSucceededEventPayload;
9
- export declare const createDownloadFailedEventPayload: (fileId: string, error: MediaViewerError, fileState?: FileState, traceContext?: MediaTraceContext) => DownloadFailedEventPayload;
@@ -1,7 +0,0 @@
1
- import { type FileState } from '@atlaskit/media-client';
2
- import { type MediaFileEventPayload } from './_mediaFile';
3
- import { type MediaViewerFailureAttributes } from '../..';
4
- import { type MediaViewerError } from '../../../errors';
5
- import { type MediaTraceContext } from '@atlaskit/media-common';
6
- export type LoadFailedEventPayload = MediaFileEventPayload<MediaViewerFailureAttributes, 'loadFailed'>;
7
- export declare const createLoadFailedEvent: (fileId: string, error: MediaViewerError, fileState?: FileState, traceContext?: MediaTraceContext) => LoadFailedEventPayload;
@@ -1,11 +0,0 @@
1
- import { type SuccessAttributes, type WithFileAttributes, type FileAttributes, type MediaTraceContext, type WithTraceContext } from '@atlaskit/media-common';
2
- import { type MediaFileEventPayload } from './_mediaFile';
3
- type WithFeatureFlags = {
4
- featureFlags: {
5
- media_document_viewer: boolean;
6
- };
7
- };
8
- export type LoadSucceededAttributes = SuccessAttributes & WithFileAttributes & WithTraceContext & WithFeatureFlags;
9
- export type LoadSucceededEventPayload = MediaFileEventPayload<LoadSucceededAttributes, 'loadSucceeded'>;
10
- export declare const createLoadSucceededEvent: ({ fileId, fileMediatype, fileMimetype, fileSize }: FileAttributes, traceContext?: MediaTraceContext) => LoadSucceededEventPayload;
11
- export {};
@@ -1,6 +0,0 @@
1
- import { type FileState } from '@atlaskit/media-client';
2
- import { type WithFileAttributes } from '@atlaskit/media-common';
3
- import { type MediaFileEventPayload } from './_mediaFile';
4
- export type PreviewUnsupportedAttributes = WithFileAttributes;
5
- export type PreviewUnsupportedEventPayload = MediaFileEventPayload<PreviewUnsupportedAttributes, 'previewUnsupported'>;
6
- export declare const createPreviewUnsupportedEvent: (fileState: FileState) => PreviewUnsupportedEventPayload;
@@ -1,13 +0,0 @@
1
- import { type FileState } from '@atlaskit/media-client';
2
- import { type ZipEntry } from 'unzipit';
3
- import { type MediaFileEventPayload } from './_mediaFile';
4
- import { type MediaViewerFailureAttributes } from '../..';
5
- import { type MediaViewerError } from '../../../errors';
6
- export type ZipEntryLoadFailedAttributes = MediaViewerFailureAttributes & {
7
- size: number;
8
- encrypted: boolean;
9
- compressedSize: number;
10
- mimeType: string;
11
- };
12
- export type ZipEntryLoadFailedEventPayload = MediaFileEventPayload<ZipEntryLoadFailedAttributes, 'zipEntryLoadFailed'>;
13
- export declare const createZipEntryLoadFailedEvent: (fileState: FileState, error: MediaViewerError, zipEntry?: ZipEntry) => ZipEntryLoadFailedEventPayload;
@@ -1,12 +0,0 @@
1
- import { type FileState } from '@atlaskit/media-client';
2
- import { type SuccessAttributes, type WithFileAttributes } from '@atlaskit/media-common/analytics';
3
- import { type ZipEntry } from 'unzipit';
4
- import { type MediaFileEventPayload } from './_mediaFile';
5
- export type ZipEntryLoadSucceededAttributes = SuccessAttributes & WithFileAttributes & {
6
- size: number;
7
- encrypted: boolean;
8
- compressedSize: number;
9
- mimeType: string;
10
- };
11
- export type ZipEntryLoadSucceededEventPayload = MediaFileEventPayload<ZipEntryLoadSucceededAttributes, 'zipEntryLoadSucceeded'>;
12
- export declare const createZipEntryLoadSucceededEvent: (fileState: FileState, zipEntry: ZipEntry) => ZipEntryLoadSucceededEventPayload;
@@ -1,3 +0,0 @@
1
- import { type ScreenEventPayload, type ScreenAttributes } from '@atlaskit/media-common';
2
- export type ModalEventPayload = Omit<ScreenEventPayload<ScreenAttributes, 'mediaViewerModal'>, 'attributes'>;
3
- export declare const createModalEvent: () => ModalEventPayload;
@@ -1,3 +0,0 @@
1
- import { type ScreenEventPayload, type ScreenAttributes } from '@atlaskit/media-common';
2
- export type PasswordPdfScreenEventPayload = Omit<ScreenEventPayload<ScreenAttributes, 'mediaViewerPasswordPdfScreen'>, 'attributes'>;
3
- export declare const createPasswordPdfScreenEvent: () => PasswordPdfScreenEventPayload;
@@ -1,3 +0,0 @@
1
- import { type ScreenEventPayload, type ScreenAttributes } from '@atlaskit/media-common';
2
- export type PdfPasswordInputScreenEventPayload = Omit<ScreenEventPayload<ScreenAttributes, 'mediaViewerPdfPasswordInputScreen'>, 'attributes'>;
3
- export declare const createPdfPasswordInputScreenEvent: () => PdfPasswordInputScreenEventPayload;
@@ -1,2 +0,0 @@
1
- import { type UIAttributes, type UIEventPayload } from '@atlaskit/media-common';
2
- export type ButtonClickEventPayload<Attributes extends UIAttributes> = UIEventPayload<Attributes, 'clicked', 'button'>;
@@ -1,8 +0,0 @@
1
- import { type UIEventPayload } from '@atlaskit/media-common';
2
- export type ClosedInputType = 'button' | 'blanket' | 'escKey';
3
- export interface ClosedAttributes {
4
- input: ClosedInputType;
5
- sessionDurationMs: number;
6
- }
7
- export type ClosedEventPayload = UIEventPayload<ClosedAttributes, 'closed', 'mediaViewer'>;
8
- export declare const createClosedEvent: (input: ClosedInputType) => ClosedEventPayload;
@@ -1,8 +0,0 @@
1
- import { type WithFileAttributes } from '@atlaskit/media-common';
2
- import { type FileStatus, type FileState } from '@atlaskit/media-client';
3
- import { type ButtonClickEventPayload } from './_clickedButton';
4
- export type DownloadButtonClickedAttributes = WithFileAttributes & {
5
- fileProcessingStatus: FileStatus;
6
- };
7
- export type DownloadButtonClickedEventPayload = ButtonClickEventPayload<DownloadButtonClickedAttributes>;
8
- export declare const createDownloadButtonClickedEvent: (fileState: FileState) => DownloadButtonClickedEventPayload;
@@ -1,10 +0,0 @@
1
- import { type WithFileAttributes } from '@atlaskit/media-common';
2
- import { type FileStatus, type FileState } from '@atlaskit/media-client';
3
- import { type ButtonClickEventPayload } from './_clickedButton';
4
- import { type PrimaryErrorReason, type MediaViewerError } from '../../../errors';
5
- export type FailedPreviewDownloadButtonClickedAttributes = WithFileAttributes & {
6
- fileProcessingStatus: FileStatus;
7
- failReason: PrimaryErrorReason;
8
- };
9
- export type FailedPreviewDownloadButtonClickedEventPayload = ButtonClickEventPayload<FailedPreviewDownloadButtonClickedAttributes>;
10
- export declare const createFailedPreviewDownloadButtonClickedEvent: (fileState: FileState, error: MediaViewerError) => FailedPreviewDownloadButtonClickedEventPayload;
@@ -1,12 +0,0 @@
1
- import { type UIEventPayload, type UIAttributes, type WithFileAttributes } from '@atlaskit/media-common';
2
- import { type Identifier } from '@atlaskit/media-client';
3
- import { type NavigationDirection, type NavigationSource } from '../../../navigation';
4
- export type NavigatedAttributes = UIAttributes & WithFileAttributes & {
5
- input: 'button' | 'keys';
6
- };
7
- export type NavigatedEventPayload = UIEventPayload<NavigatedAttributes, 'navigated', 'file'> & {
8
- actionSubjectId: 'next' | 'previous';
9
- };
10
- export type NavigatedInput = 'button' | 'keys';
11
- export declare const inputFromSource: (source: NavigationSource) => NavigatedInput;
12
- export declare const createNavigatedEvent: (direction: NavigationDirection, source: NavigationSource, identifier: Identifier) => NavigatedEventPayload;
@@ -1,8 +0,0 @@
1
- import { type ButtonClickEventPayload } from './_clickedButton';
2
- export type ZoomButtonClickAttributes = {
3
- zoomScale: number;
4
- };
5
- export type ZoomInButtonClickEventPayload = ButtonClickEventPayload<ZoomButtonClickAttributes> & {
6
- actionSubjectId: 'zoomIn';
7
- };
8
- export declare function createZoomInButtonClickEvent(zoomScale: number): ZoomInButtonClickEventPayload;
@@ -1,6 +0,0 @@
1
- import { type ButtonClickEventPayload } from './_clickedButton';
2
- import { type ZoomButtonClickAttributes } from './zoomInButtonClicked';
3
- export type ZoomOutButtonClickEventPayload = ButtonClickEventPayload<ZoomButtonClickAttributes> & {
4
- actionSubjectId: 'zoomOut';
5
- };
6
- export declare function createZoomOutButtonClickedEvent(zoomScale: number): ZoomOutButtonClickEventPayload;
@@ -1,17 +0,0 @@
1
- import { type FileState, type RequestMetadata } from '@atlaskit/media-client';
2
- import { type FileAttributes, type WithFileAttributes, type FailureAttributes, type WithTraceContext } from '@atlaskit/media-common/analytics';
3
- import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
- import { type PrimaryErrorReason } from '../errors';
5
- import { type MediaViewerEventPayload } from './events';
6
- declare const componentName = "mediaViewer";
7
- declare const packageName: string;
8
- declare const packageVersion: string;
9
- export { packageName, packageVersion, componentName, componentName as component };
10
- export declare function getFileAttributes(fileState?: FileState): FileAttributes;
11
- /** This type takes FailureAttributes and redefines `failReason` to be the strong media-viewer type */
12
- export type MediaViewerFailureAttributes = Omit<FailureAttributes, 'failReason'> & {
13
- failReason: PrimaryErrorReason;
14
- statusCode?: number;
15
- request?: RequestMetadata;
16
- } & WithFileAttributes & WithTraceContext;
17
- export declare function fireAnalytics(payload: MediaViewerEventPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
@@ -1,19 +0,0 @@
1
- import { type FileAttributes } from '@atlaskit/media-common';
2
- import { type RequestMetadata } from '@atlaskit/media-client';
3
- import { type PrimaryErrorReason } from '../errors';
4
- import { type FileStateFlags } from '../components/types';
5
- export type UFOFailedEventPayload = {
6
- failReason?: PrimaryErrorReason;
7
- error?: string;
8
- errorDetail?: string;
9
- request?: RequestMetadata;
10
- fileAttributes: FileAttributes;
11
- fileStateFlags?: FileStateFlags;
12
- };
13
- export type UFOSucceedEventPayload = {
14
- fileAttributes: FileAttributes;
15
- fileStateFlags?: FileStateFlags;
16
- };
17
- export declare const startMediaFileUfoExperience: () => void;
18
- export declare const succeedMediaFileUfoExperience: (properties?: UFOSucceedEventPayload) => void;
19
- export declare const failMediaFileUfoExperience: (properties?: UFOFailedEventPayload) => void;