@atlaskit/media-picker 66.0.4 → 66.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/media-picker
2
2
 
3
+ ## 66.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c5a5b4ec141`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c5a5b4ec141) - Reverted back the changes done as part of UTEST-643
8
+
9
+ ## 66.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`8c7beee89c0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c7beee89c0) - Multiple simultaneous uploads above 255 files are batched due to backend restrictions
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 66.0.4
4
20
 
5
21
  ### Patch Changes
package/compass.yml ADDED
@@ -0,0 +1,49 @@
1
+ name: Media Picker
2
+ id: 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/201cd71f-c6e6-4396-9547-c304e5954a14'
3
+ description: Library for handling file uploads
4
+ configVersion: 1
5
+ typeId: UI_ELEMENT
6
+ ownerId: 'ari:cloud:teams::team/ef910622-ce0a-44a0-b441-ba89efe7891b'
7
+ fields:
8
+ lifecycle: Active
9
+ tier: 4
10
+ labels:
11
+ - atlassian-platform
12
+ customFields:
13
+ - name: Dev Owner
14
+ type: user
15
+ value: null
16
+ - name: Product
17
+ type: text
18
+ value: null
19
+ - name: Test
20
+ type: text
21
+ value: null
22
+ links:
23
+ - name: ''
24
+ type: REPOSITORY
25
+ url: 'https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/media/media-picker/'
26
+ - name: ''
27
+ type: DOCUMENT
28
+ url: 'https://atlaskit.atlassian.com/packages/media/media-picker'
29
+ - name: '' # Tome Capability
30
+ type: OTHER_LINK
31
+ url: 'https://tome.prod.atl-paas.net/capability/9202e800-ec6b-4183-b1df-468aa6f5fb0e'
32
+ - name: Media By Product
33
+ type: DASHBOARD
34
+ url: 'https://atlassian.signalfx.com/#/dashboard/E-vk3wqAwAA?groupId=E-vkzo1AwAA&configId=E-vk5fsAwAA&startTime=-7d&endTime=Now'
35
+ - name: ''
36
+ type: CHAT_CHANNEL
37
+ url: 'https://atlassian.slack.com/archives/C020CGJDJ3A'
38
+ - name: ''
39
+ type: ON_CALL
40
+ url: 'https://atlassian.app.opsgenie.com/settings/schedule/detail/b62291ff-4029-4f26-b7fc-d75d46d7aebc'
41
+ - name: ''
42
+ type: PROJECT
43
+ url: 'https://product-fabric.atlassian.net/jira/software/c/projects/MEX/boards/713'
44
+ relationships:
45
+ DEPENDS_ON:
46
+ - 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/652381b6-c323-4b50-bf31-c94941a0b6ef'
47
+
48
+ # Learn more about formatting compass.yml:
49
+ # https://go.atlassian.com/compass-yml-format
@@ -18,9 +18,15 @@ var _getPreviewFromImage = require("../util/getPreviewFromImage");
18
18
  var _types = require("../service/types");
19
19
  var _getPreviewFromBlob = require("../util/getPreviewFromBlob");
20
20
  var _mediaCommon = require("@atlaskit/media-common");
21
+ var generateTraceContext = function generateTraceContext() {
22
+ return {
23
+ traceId: (0, _mediaCommon.getRandomHex)(8)
24
+ };
25
+ };
21
26
  var UploadServiceImpl = /*#__PURE__*/function () {
22
27
  function UploadServiceImpl(tenantMediaClient, tenantUploadParams, shouldCopyFileToRecents) {
23
28
  var _this = this;
29
+ var maxUploadBatchSize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 255;
24
30
  (0, _classCallCheck2.default)(this, UploadServiceImpl);
25
31
  (0, _defineProperty2.default)(this, "emit", function (event, payload) {
26
32
  _this.emitter.emit(event, payload);
@@ -72,6 +78,7 @@ var UploadServiceImpl = /*#__PURE__*/function () {
72
78
  this.tenantMediaClient = tenantMediaClient;
73
79
  this.tenantUploadParams = tenantUploadParams;
74
80
  this.shouldCopyFileToRecents = shouldCopyFileToRecents;
81
+ this.maxUploadBatchSize = maxUploadBatchSize;
75
82
  this.emitter = new _eventemitter.EventEmitter2();
76
83
  this.cancellableFilesUploads = {};
77
84
  }
@@ -90,12 +97,17 @@ var UploadServiceImpl = /*#__PURE__*/function () {
90
97
  }, {
91
98
  key: "addFiles",
92
99
  value: function addFiles(files) {
93
- this.addFilesWithSource(files.map(function (file) {
94
- return {
95
- file: file,
96
- source: _types.LocalFileSource.LocalUpload
97
- };
98
- }));
100
+ var maxUploadBatchSize = this.maxUploadBatchSize;
101
+ var traceContext = generateTraceContext();
102
+ for (var iterator = 0; iterator < files.length; iterator += maxUploadBatchSize) {
103
+ var filesArray = files.slice(iterator, iterator + maxUploadBatchSize).map(function (file) {
104
+ return {
105
+ file: file,
106
+ source: _types.LocalFileSource.LocalUpload
107
+ };
108
+ });
109
+ this.addFilesWithSource(filesArray, traceContext);
110
+ }
99
111
  }
100
112
  }, {
101
113
  key: "addFile",
@@ -111,27 +123,48 @@ var UploadServiceImpl = /*#__PURE__*/function () {
111
123
  value: function () {
112
124
  var _addFilesWithSource = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(files) {
113
125
  var _this2 = this;
114
- var creationDate, userMediaClient, tenantMediaClient, shouldCopyFileToRecents, mediaClient, _this$tenantUploadPar, collectionTentant, expireAfter, collection, touchFileDescriptors, i, _files$i, replaceFileId, file, traceContext, touchedFiles, caughtError, cancellableFileUploads, filteredCancellableFileUploads, mediaFiles;
126
+ var traceContext,
127
+ creationDate,
128
+ userMediaClient,
129
+ tenantMediaClient,
130
+ shouldCopyFileToRecents,
131
+ mediaClient,
132
+ _this$tenantUploadPar,
133
+ collectionTentant,
134
+ expireAfter,
135
+ collection,
136
+ touchFileDescriptors,
137
+ i,
138
+ _files$i,
139
+ replaceFileId,
140
+ file,
141
+ touchedFiles,
142
+ caughtError,
143
+ cancellableFileUploads,
144
+ filteredCancellableFileUploads,
145
+ mediaFiles,
146
+ _args2 = arguments;
115
147
  return _regenerator.default.wrap(function _callee2$(_context2) {
116
148
  while (1) switch (_context2.prev = _context2.next) {
117
149
  case 0:
150
+ traceContext = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : generateTraceContext();
118
151
  if (!(files.length === 0)) {
119
- _context2.next = 2;
152
+ _context2.next = 3;
120
153
  break;
121
154
  }
122
155
  return _context2.abrupt("return");
123
- case 2:
156
+ case 3:
124
157
  creationDate = Date.now();
125
158
  userMediaClient = this.userMediaClient, tenantMediaClient = this.tenantMediaClient, shouldCopyFileToRecents = this.shouldCopyFileToRecents;
126
159
  mediaClient = shouldCopyFileToRecents ? tenantMediaClient : userMediaClient;
127
160
  _this$tenantUploadPar = this.tenantUploadParams, collectionTentant = _this$tenantUploadPar.collection, expireAfter = _this$tenantUploadPar.expireAfter;
128
161
  collection = shouldCopyFileToRecents ? collectionTentant : _constants.RECENTS_COLLECTION;
129
162
  if (mediaClient) {
130
- _context2.next = 9;
163
+ _context2.next = 10;
131
164
  break;
132
165
  }
133
166
  return _context2.abrupt("return");
134
- case 9:
167
+ case 10:
135
168
  touchFileDescriptors = [];
136
169
  for (i = 0; i < files.length; i++) {
137
170
  _files$i = files[i], replaceFileId = _files$i.replaceFileId, file = _files$i.file;
@@ -143,9 +176,6 @@ var UploadServiceImpl = /*#__PURE__*/function () {
143
176
  expireAfter: expireAfter
144
177
  });
145
178
  }
146
- traceContext = {
147
- traceId: (0, _mediaCommon.getRandomHex)(8)
148
- };
149
179
  _context2.prev = 12;
150
180
  _context2.next = 15;
151
181
  return mediaClient.file.touchFiles(touchFileDescriptors, collection, traceContext);
@@ -9,7 +9,7 @@ var _mediaClient = require("@atlaskit/media-client");
9
9
  // Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
10
10
 
11
11
  var packageName = "@atlaskit/media-picker";
12
- var packageVersion = "66.0.4";
12
+ var packageVersion = "66.1.1";
13
13
  function getPackageAttributes(componentName) {
14
14
  return {
15
15
  packageName: packageName,
@@ -12,7 +12,7 @@ var _mediaClient = require("@atlaskit/media-client");
12
12
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
13
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14
14
  var packageName = "@atlaskit/media-picker";
15
- var packageVersion = "66.0.4";
15
+ var packageVersion = "66.1.1";
16
16
  var ufoExperience;
17
17
  var initExperience = function initExperience(id, componentName) {
18
18
  if (!ufoExperience) {
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "66.0.4"
3
+ "version": "66.1.1"
4
4
  }
@@ -7,8 +7,12 @@ import { getPreviewFromImage } from '../util/getPreviewFromImage';
7
7
  import { LocalFileSource } from '../service/types';
8
8
  import { getPreviewFromBlob } from '../util/getPreviewFromBlob';
9
9
  import { getRandomHex } from '@atlaskit/media-common';
10
+ const generateTraceContext = () => ({
11
+ traceId: getRandomHex(8)
12
+ });
10
13
  export class UploadServiceImpl {
11
- constructor(tenantMediaClient, tenantUploadParams, shouldCopyFileToRecents) {
14
+ constructor(tenantMediaClient, tenantUploadParams, shouldCopyFileToRecents, maxUploadBatchSize = 255 // Max supported batch is 255. We parametrise it for testing purposes
15
+ ) {
12
16
  _defineProperty(this, "emit", (event, payload) => {
13
17
  this.emitter.emit(event, payload);
14
18
  });
@@ -47,6 +51,7 @@ export class UploadServiceImpl {
47
51
  this.tenantMediaClient = tenantMediaClient;
48
52
  this.tenantUploadParams = tenantUploadParams;
49
53
  this.shouldCopyFileToRecents = shouldCopyFileToRecents;
54
+ this.maxUploadBatchSize = maxUploadBatchSize;
50
55
  this.emitter = new EventEmitter2();
51
56
  this.cancellableFilesUploads = {};
52
57
  }
@@ -59,10 +64,17 @@ export class UploadServiceImpl {
59
64
  return new UploadController();
60
65
  }
61
66
  addFiles(files) {
62
- this.addFilesWithSource(files.map(file => ({
63
- file,
64
- source: LocalFileSource.LocalUpload
65
- })));
67
+ const {
68
+ maxUploadBatchSize
69
+ } = this;
70
+ const traceContext = generateTraceContext();
71
+ for (let iterator = 0; iterator < files.length; iterator += maxUploadBatchSize) {
72
+ const filesArray = files.slice(iterator, iterator + maxUploadBatchSize).map(file => ({
73
+ file,
74
+ source: LocalFileSource.LocalUpload
75
+ }));
76
+ this.addFilesWithSource(filesArray, traceContext);
77
+ }
66
78
  }
67
79
  addFile(file, replaceFileId) {
68
80
  this.addFilesWithSource([{
@@ -71,7 +83,7 @@ export class UploadServiceImpl {
71
83
  replaceFileId
72
84
  }]);
73
85
  }
74
- async addFilesWithSource(files) {
86
+ async addFilesWithSource(files, traceContext = generateTraceContext()) {
75
87
  if (files.length === 0) {
76
88
  return;
77
89
  }
@@ -104,9 +116,6 @@ export class UploadServiceImpl {
104
116
  expireAfter
105
117
  });
106
118
  }
107
- const traceContext = {
108
- traceId: getRandomHex(8)
109
- };
110
119
  let touchedFiles;
111
120
  let caughtError;
112
121
  try {
@@ -3,7 +3,7 @@ import { isRequestError } from '@atlaskit/media-client';
3
3
  // Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
4
4
 
5
5
  const packageName = "@atlaskit/media-picker";
6
- const packageVersion = "66.0.4";
6
+ const packageVersion = "66.1.1";
7
7
  export function getPackageAttributes(componentName) {
8
8
  return {
9
9
  packageName,
@@ -2,7 +2,7 @@ import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } fro
2
2
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
3
3
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
4
4
  const packageName = "@atlaskit/media-picker";
5
- const packageVersion = "66.0.4";
5
+ const packageVersion = "66.1.1";
6
6
  let ufoExperience;
7
7
  const initExperience = (id, componentName) => {
8
8
  if (!ufoExperience) {
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "66.0.4"
3
+ "version": "66.1.1"
4
4
  }
@@ -11,9 +11,15 @@ import { getPreviewFromImage } from '../util/getPreviewFromImage';
11
11
  import { LocalFileSource } from '../service/types';
12
12
  import { getPreviewFromBlob } from '../util/getPreviewFromBlob';
13
13
  import { getRandomHex } from '@atlaskit/media-common';
14
+ var generateTraceContext = function generateTraceContext() {
15
+ return {
16
+ traceId: getRandomHex(8)
17
+ };
18
+ };
14
19
  export var UploadServiceImpl = /*#__PURE__*/function () {
15
20
  function UploadServiceImpl(tenantMediaClient, tenantUploadParams, shouldCopyFileToRecents) {
16
21
  var _this = this;
22
+ var maxUploadBatchSize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 255;
17
23
  _classCallCheck(this, UploadServiceImpl);
18
24
  _defineProperty(this, "emit", function (event, payload) {
19
25
  _this.emitter.emit(event, payload);
@@ -65,6 +71,7 @@ export var UploadServiceImpl = /*#__PURE__*/function () {
65
71
  this.tenantMediaClient = tenantMediaClient;
66
72
  this.tenantUploadParams = tenantUploadParams;
67
73
  this.shouldCopyFileToRecents = shouldCopyFileToRecents;
74
+ this.maxUploadBatchSize = maxUploadBatchSize;
68
75
  this.emitter = new EventEmitter2();
69
76
  this.cancellableFilesUploads = {};
70
77
  }
@@ -83,12 +90,17 @@ export var UploadServiceImpl = /*#__PURE__*/function () {
83
90
  }, {
84
91
  key: "addFiles",
85
92
  value: function addFiles(files) {
86
- this.addFilesWithSource(files.map(function (file) {
87
- return {
88
- file: file,
89
- source: LocalFileSource.LocalUpload
90
- };
91
- }));
93
+ var maxUploadBatchSize = this.maxUploadBatchSize;
94
+ var traceContext = generateTraceContext();
95
+ for (var iterator = 0; iterator < files.length; iterator += maxUploadBatchSize) {
96
+ var filesArray = files.slice(iterator, iterator + maxUploadBatchSize).map(function (file) {
97
+ return {
98
+ file: file,
99
+ source: LocalFileSource.LocalUpload
100
+ };
101
+ });
102
+ this.addFilesWithSource(filesArray, traceContext);
103
+ }
92
104
  }
93
105
  }, {
94
106
  key: "addFile",
@@ -104,27 +116,48 @@ export var UploadServiceImpl = /*#__PURE__*/function () {
104
116
  value: function () {
105
117
  var _addFilesWithSource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(files) {
106
118
  var _this2 = this;
107
- var creationDate, userMediaClient, tenantMediaClient, shouldCopyFileToRecents, mediaClient, _this$tenantUploadPar, collectionTentant, expireAfter, collection, touchFileDescriptors, i, _files$i, replaceFileId, file, traceContext, touchedFiles, caughtError, cancellableFileUploads, filteredCancellableFileUploads, mediaFiles;
119
+ var traceContext,
120
+ creationDate,
121
+ userMediaClient,
122
+ tenantMediaClient,
123
+ shouldCopyFileToRecents,
124
+ mediaClient,
125
+ _this$tenantUploadPar,
126
+ collectionTentant,
127
+ expireAfter,
128
+ collection,
129
+ touchFileDescriptors,
130
+ i,
131
+ _files$i,
132
+ replaceFileId,
133
+ file,
134
+ touchedFiles,
135
+ caughtError,
136
+ cancellableFileUploads,
137
+ filteredCancellableFileUploads,
138
+ mediaFiles,
139
+ _args2 = arguments;
108
140
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
109
141
  while (1) switch (_context2.prev = _context2.next) {
110
142
  case 0:
143
+ traceContext = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : generateTraceContext();
111
144
  if (!(files.length === 0)) {
112
- _context2.next = 2;
145
+ _context2.next = 3;
113
146
  break;
114
147
  }
115
148
  return _context2.abrupt("return");
116
- case 2:
149
+ case 3:
117
150
  creationDate = Date.now();
118
151
  userMediaClient = this.userMediaClient, tenantMediaClient = this.tenantMediaClient, shouldCopyFileToRecents = this.shouldCopyFileToRecents;
119
152
  mediaClient = shouldCopyFileToRecents ? tenantMediaClient : userMediaClient;
120
153
  _this$tenantUploadPar = this.tenantUploadParams, collectionTentant = _this$tenantUploadPar.collection, expireAfter = _this$tenantUploadPar.expireAfter;
121
154
  collection = shouldCopyFileToRecents ? collectionTentant : RECENTS_COLLECTION;
122
155
  if (mediaClient) {
123
- _context2.next = 9;
156
+ _context2.next = 10;
124
157
  break;
125
158
  }
126
159
  return _context2.abrupt("return");
127
- case 9:
160
+ case 10:
128
161
  touchFileDescriptors = [];
129
162
  for (i = 0; i < files.length; i++) {
130
163
  _files$i = files[i], replaceFileId = _files$i.replaceFileId, file = _files$i.file;
@@ -136,9 +169,6 @@ export var UploadServiceImpl = /*#__PURE__*/function () {
136
169
  expireAfter: expireAfter
137
170
  });
138
171
  }
139
- traceContext = {
140
- traceId: getRandomHex(8)
141
- };
142
172
  _context2.prev = 12;
143
173
  _context2.next = 15;
144
174
  return mediaClient.file.touchFiles(touchFileDescriptors, collection, traceContext);
@@ -3,7 +3,7 @@ import { isRequestError } from '@atlaskit/media-client';
3
3
  // Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
4
4
 
5
5
  var packageName = "@atlaskit/media-picker";
6
- var packageVersion = "66.0.4";
6
+ var packageVersion = "66.1.1";
7
7
  export function getPackageAttributes(componentName) {
8
8
  return {
9
9
  packageName: packageName,
@@ -5,7 +5,7 @@ import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } fro
5
5
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
6
6
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
7
7
  var packageName = "@atlaskit/media-picker";
8
- var packageVersion = "66.0.4";
8
+ var packageVersion = "66.1.1";
9
9
  var ufoExperience;
10
10
  var initExperience = function initExperience(id, componentName) {
11
11
  if (!ufoExperience) {
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "66.0.4"
3
+ "version": "66.1.1"
4
4
  }
@@ -3,6 +3,7 @@ import { MediaFile, UploadParams } from '../types';
3
3
  import { UploadRejectionData } from '../types';
4
4
  import { UploadService, UploadServiceEventListener, UploadServiceEventPayloadTypes } from './types';
5
5
  import { LocalFileSource, LocalFileWithSource } from '../service/types';
6
+ import { MediaTraceContext } from '@atlaskit/media-common';
6
7
  export interface CancellableFileUpload {
7
8
  mediaFile: MediaFile;
8
9
  file: File;
@@ -13,16 +14,17 @@ export declare class UploadServiceImpl implements UploadService {
13
14
  private readonly tenantMediaClient;
14
15
  private tenantUploadParams;
15
16
  private readonly shouldCopyFileToRecents;
17
+ private readonly maxUploadBatchSize;
16
18
  private readonly userMediaClient?;
17
19
  private readonly emitter;
18
20
  private cancellableFilesUploads;
19
21
  private fileRejectionHandler?;
20
- constructor(tenantMediaClient: MediaClient, tenantUploadParams: UploadParams, shouldCopyFileToRecents: boolean);
22
+ constructor(tenantMediaClient: MediaClient, tenantUploadParams: UploadParams, shouldCopyFileToRecents: boolean, maxUploadBatchSize?: number);
21
23
  setUploadParams(uploadParams: UploadParams): void;
22
24
  private createUploadController;
23
25
  addFiles(files: File[]): void;
24
26
  addFile(file: File, replaceFileId?: string): void;
25
- addFilesWithSource(files: LocalFileWithSource[]): Promise<void>;
27
+ addFilesWithSource(files: LocalFileWithSource[], traceContext?: MediaTraceContext): Promise<void>;
26
28
  isCancellableFileUpload(fileUpload: null | CancellableFileUpload): fileUpload is CancellableFileUpload;
27
29
  cancel(id?: string): void;
28
30
  on<E extends keyof UploadServiceEventPayloadTypes>(event: E, listener: UploadServiceEventListener<E>): void;
@@ -3,6 +3,7 @@ import { MediaFile, UploadParams } from '../types';
3
3
  import { UploadRejectionData } from '../types';
4
4
  import { UploadService, UploadServiceEventListener, UploadServiceEventPayloadTypes } from './types';
5
5
  import { LocalFileSource, LocalFileWithSource } from '../service/types';
6
+ import { MediaTraceContext } from '@atlaskit/media-common';
6
7
  export interface CancellableFileUpload {
7
8
  mediaFile: MediaFile;
8
9
  file: File;
@@ -13,16 +14,17 @@ export declare class UploadServiceImpl implements UploadService {
13
14
  private readonly tenantMediaClient;
14
15
  private tenantUploadParams;
15
16
  private readonly shouldCopyFileToRecents;
17
+ private readonly maxUploadBatchSize;
16
18
  private readonly userMediaClient?;
17
19
  private readonly emitter;
18
20
  private cancellableFilesUploads;
19
21
  private fileRejectionHandler?;
20
- constructor(tenantMediaClient: MediaClient, tenantUploadParams: UploadParams, shouldCopyFileToRecents: boolean);
22
+ constructor(tenantMediaClient: MediaClient, tenantUploadParams: UploadParams, shouldCopyFileToRecents: boolean, maxUploadBatchSize?: number);
21
23
  setUploadParams(uploadParams: UploadParams): void;
22
24
  private createUploadController;
23
25
  addFiles(files: File[]): void;
24
26
  addFile(file: File, replaceFileId?: string): void;
25
- addFilesWithSource(files: LocalFileWithSource[]): Promise<void>;
27
+ addFilesWithSource(files: LocalFileWithSource[], traceContext?: MediaTraceContext): Promise<void>;
26
28
  isCancellableFileUpload(fileUpload: null | CancellableFileUpload): fileUpload is CancellableFileUpload;
27
29
  cancel(id?: string): void;
28
30
  on<E extends keyof UploadServiceEventPayloadTypes>(event: E, listener: UploadServiceEventListener<E>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "66.0.4",
3
+ "version": "66.1.1",
4
4
  "description": "Library for handling file uploads",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,11 +37,11 @@
37
37
  "@atlaskit/analytics-next": "^9.1.0",
38
38
  "@atlaskit/flag": "^15.1.0",
39
39
  "@atlaskit/icon": "^21.11.0",
40
- "@atlaskit/media-client": "^23.0.0",
40
+ "@atlaskit/media-client": "^23.1.0",
41
41
  "@atlaskit/media-common": "^7.0.0",
42
- "@atlaskit/media-ui": "^23.0.0",
42
+ "@atlaskit/media-ui": "^23.1.0",
43
43
  "@atlaskit/theme": "^12.4.0",
44
- "@atlaskit/tokens": "^1.5.0",
44
+ "@atlaskit/tokens": "^1.9.0",
45
45
  "@atlaskit/ufo": "^0.2.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "eventemitter2": "^4.1.0",
@@ -60,7 +60,7 @@
60
60
  "devDependencies": {
61
61
  "@atlaskit/analytics-listeners": "^8.7.0",
62
62
  "@atlaskit/analytics-namespaced-context": "^6.7.0",
63
- "@atlaskit/button": "^16.7.0",
63
+ "@atlaskit/button": "^16.8.0",
64
64
  "@atlaskit/docs": "*",
65
65
  "@atlaskit/dropdown-menu": "^11.9.0",
66
66
  "@atlaskit/media-card": "^76.0.0",
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/spinner": "^15.5.0",
70
70
  "@atlaskit/ssr": "*",
71
71
  "@atlaskit/toggle": "^12.6.0",
72
- "@atlaskit/tokens": "^1.2.18",
72
+ "@atlaskit/tokens": "^1.9.0",
73
73
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
74
74
  "@atlassian/ufo": "^0.2.0",
75
75
  "@babel/plugin-proposal-numeric-separator": "^7.18.6",
File without changes