@atlaskit/media-client 28.1.0 → 28.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/media-client
2
2
 
3
+ ## 28.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6099ac032dd30`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6099ac032dd30) -
8
+ Added viewerOptions to override file preview renderer in media components
9
+
3
10
  ## 28.1.0
4
11
 
5
12
  ### Minor Changes
@@ -308,7 +308,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
308
308
  }, {
309
309
  key: "getFileBinary",
310
310
  value: function () {
311
- var _getFileBinary = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id, collectionName) {
311
+ var _getFileBinary = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id, collectionName, abortController) {
312
312
  var maxAge,
313
313
  headers,
314
314
  binaryEndpoint,
@@ -318,7 +318,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
318
318
  return _regenerator.default.wrap(function _callee5$(_context5) {
319
319
  while (1) switch (_context5.prev = _context5.next) {
320
320
  case 0:
321
- maxAge = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : _constants.FILE_CACHE_MAX_AGE;
321
+ maxAge = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : _constants.FILE_CACHE_MAX_AGE;
322
322
  headers = {};
323
323
  binaryEndpoint = cdnFeatureFlag('binary');
324
324
  metadata = {
@@ -335,14 +335,14 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
335
335
  'max-age': "".concat(maxAge)
336
336
  }
337
337
  });
338
- return _context5.abrupt("return", this.request("/file/".concat(id, "/").concat(binaryEndpoint), options, undefined, true).then((0, _helpers.createMapResponseToBlob)(metadata)));
338
+ return _context5.abrupt("return", this.request("/file/".concat(id, "/").concat(binaryEndpoint), options, abortController, true).then((0, _helpers.createMapResponseToBlob)(metadata)));
339
339
  case 6:
340
340
  case "end":
341
341
  return _context5.stop();
342
342
  }
343
343
  }, _callee5, this);
344
344
  }));
345
- function getFileBinary(_x14, _x15) {
345
+ function getFileBinary(_x14, _x15, _x16) {
346
346
  return _getFileBinary.apply(this, arguments);
347
347
  }
348
348
  return getFileBinary;
@@ -382,7 +382,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
382
382
  }
383
383
  }, _callee6, this);
384
384
  }));
385
- function getFileBinaryURL(_x16, _x17) {
385
+ function getFileBinaryURL(_x17, _x18) {
386
386
  return _getFileBinaryURL.apply(this, arguments);
387
387
  }
388
388
  return getFileBinaryURL;
@@ -422,7 +422,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
422
422
  }
423
423
  }, _callee7, this);
424
424
  }));
425
- function getArtifactURL(_x18, _x19, _x20) {
425
+ function getArtifactURL(_x19, _x20, _x21) {
426
426
  return _getArtifactURL.apply(this, arguments);
427
427
  }
428
428
  return getArtifactURL;
@@ -462,7 +462,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
462
462
  }
463
463
  }, _callee8, this);
464
464
  }));
465
- function getImage(_x21, _x22, _x23, _x24, _x25) {
465
+ function getImage(_x22, _x23, _x24, _x25, _x26) {
466
466
  return _getImage.apply(this, arguments);
467
467
  }
468
468
  return getImage;
@@ -503,7 +503,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
503
503
  }
504
504
  }, _callee9, this);
505
505
  }));
506
- function getItems(_x26, _x27, _x28) {
506
+ function getItems(_x27, _x28, _x29) {
507
507
  return _getItems.apply(this, arguments);
508
508
  }
509
509
  return getItems;
@@ -534,7 +534,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
534
534
  }
535
535
  }, _callee10, this);
536
536
  }));
537
- function getImageMetadata(_x29, _x30, _x31) {
537
+ function getImageMetadata(_x30, _x31, _x32) {
538
538
  return _getImageMetadata.apply(this, arguments);
539
539
  }
540
540
  return getImageMetadata;
@@ -567,7 +567,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
567
567
  }
568
568
  }, _callee11, this);
569
569
  }));
570
- function appendChunksToUpload(_x32, _x33, _x34, _x35) {
570
+ function appendChunksToUpload(_x33, _x34, _x35, _x36) {
571
571
  return _appendChunksToUpload.apply(this, arguments);
572
572
  }
573
573
  return appendChunksToUpload;
@@ -662,7 +662,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
662
662
  }
663
663
  }, _callee12, this);
664
664
  }));
665
- function request(_x36) {
665
+ function request(_x37) {
666
666
  return _request2.apply(this, arguments);
667
667
  }
668
668
  return request;
@@ -200,7 +200,7 @@ export class MediaStore {
200
200
  const imageEndpoint = cdnFeatureFlag('image');
201
201
  return mapToMediaCdnUrl(createUrl(`${auth.baseUrl}/file/${id}/${imageEndpoint}`, options), auth.token);
202
202
  }
203
- async getFileBinary(id, collectionName, maxAge = FILE_CACHE_MAX_AGE) {
203
+ async getFileBinary(id, collectionName, abortController, maxAge = FILE_CACHE_MAX_AGE) {
204
204
  const headers = {};
205
205
  const binaryEndpoint = cdnFeatureFlag('binary');
206
206
  const metadata = {
@@ -218,7 +218,7 @@ export class MediaStore {
218
218
  'max-age': `${maxAge}`
219
219
  }
220
220
  };
221
- return this.request(`/file/${id}/${binaryEndpoint}`, options, undefined, true).then(createMapResponseToBlob(metadata));
221
+ return this.request(`/file/${id}/${binaryEndpoint}`, options, abortController, true).then(createMapResponseToBlob(metadata));
222
222
  }
223
223
  async getFileBinaryURL(id, collectionName, maxAge = FILE_CACHE_MAX_AGE) {
224
224
  const auth = await this.resolveAuth({
@@ -302,7 +302,7 @@ export var MediaStore = /*#__PURE__*/function () {
302
302
  }, {
303
303
  key: "getFileBinary",
304
304
  value: function () {
305
- var _getFileBinary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, collectionName) {
305
+ var _getFileBinary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, collectionName, abortController) {
306
306
  var maxAge,
307
307
  headers,
308
308
  binaryEndpoint,
@@ -312,7 +312,7 @@ export var MediaStore = /*#__PURE__*/function () {
312
312
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
313
313
  while (1) switch (_context5.prev = _context5.next) {
314
314
  case 0:
315
- maxAge = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : FILE_CACHE_MAX_AGE;
315
+ maxAge = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : FILE_CACHE_MAX_AGE;
316
316
  headers = {};
317
317
  binaryEndpoint = cdnFeatureFlag('binary');
318
318
  metadata = {
@@ -329,14 +329,14 @@ export var MediaStore = /*#__PURE__*/function () {
329
329
  'max-age': "".concat(maxAge)
330
330
  }
331
331
  });
332
- return _context5.abrupt("return", this.request("/file/".concat(id, "/").concat(binaryEndpoint), options, undefined, true).then(createMapResponseToBlob(metadata)));
332
+ return _context5.abrupt("return", this.request("/file/".concat(id, "/").concat(binaryEndpoint), options, abortController, true).then(createMapResponseToBlob(metadata)));
333
333
  case 6:
334
334
  case "end":
335
335
  return _context5.stop();
336
336
  }
337
337
  }, _callee5, this);
338
338
  }));
339
- function getFileBinary(_x14, _x15) {
339
+ function getFileBinary(_x14, _x15, _x16) {
340
340
  return _getFileBinary.apply(this, arguments);
341
341
  }
342
342
  return getFileBinary;
@@ -376,7 +376,7 @@ export var MediaStore = /*#__PURE__*/function () {
376
376
  }
377
377
  }, _callee6, this);
378
378
  }));
379
- function getFileBinaryURL(_x16, _x17) {
379
+ function getFileBinaryURL(_x17, _x18) {
380
380
  return _getFileBinaryURL.apply(this, arguments);
381
381
  }
382
382
  return getFileBinaryURL;
@@ -416,7 +416,7 @@ export var MediaStore = /*#__PURE__*/function () {
416
416
  }
417
417
  }, _callee7, this);
418
418
  }));
419
- function getArtifactURL(_x18, _x19, _x20) {
419
+ function getArtifactURL(_x19, _x20, _x21) {
420
420
  return _getArtifactURL.apply(this, arguments);
421
421
  }
422
422
  return getArtifactURL;
@@ -456,7 +456,7 @@ export var MediaStore = /*#__PURE__*/function () {
456
456
  }
457
457
  }, _callee8, this);
458
458
  }));
459
- function getImage(_x21, _x22, _x23, _x24, _x25) {
459
+ function getImage(_x22, _x23, _x24, _x25, _x26) {
460
460
  return _getImage.apply(this, arguments);
461
461
  }
462
462
  return getImage;
@@ -497,7 +497,7 @@ export var MediaStore = /*#__PURE__*/function () {
497
497
  }
498
498
  }, _callee9, this);
499
499
  }));
500
- function getItems(_x26, _x27, _x28) {
500
+ function getItems(_x27, _x28, _x29) {
501
501
  return _getItems.apply(this, arguments);
502
502
  }
503
503
  return getItems;
@@ -528,7 +528,7 @@ export var MediaStore = /*#__PURE__*/function () {
528
528
  }
529
529
  }, _callee10, this);
530
530
  }));
531
- function getImageMetadata(_x29, _x30, _x31) {
531
+ function getImageMetadata(_x30, _x31, _x32) {
532
532
  return _getImageMetadata.apply(this, arguments);
533
533
  }
534
534
  return getImageMetadata;
@@ -561,7 +561,7 @@ export var MediaStore = /*#__PURE__*/function () {
561
561
  }
562
562
  }, _callee11, this);
563
563
  }));
564
- function appendChunksToUpload(_x32, _x33, _x34, _x35) {
564
+ function appendChunksToUpload(_x33, _x34, _x35, _x36) {
565
565
  return _appendChunksToUpload.apply(this, arguments);
566
566
  }
567
567
  return appendChunksToUpload;
@@ -656,7 +656,7 @@ export var MediaStore = /*#__PURE__*/function () {
656
656
  }
657
657
  }, _callee12, this);
658
658
  }));
659
- function request(_x36) {
659
+ function request(_x37) {
660
660
  return _request2.apply(this, arguments);
661
661
  }
662
662
  return request;
@@ -18,7 +18,7 @@ export declare class MediaStore implements MediaApi {
18
18
  getFileImageURL(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
19
19
  getFileImageURLSync(id: string, params?: MediaStoreGetFileImageParams): string;
20
20
  private createFileImageURL;
21
- getFileBinary(id: string, collectionName?: string, maxAge?: number): Promise<Blob>;
21
+ getFileBinary(id: string, collectionName?: string, abortController?: AbortController, maxAge?: number): Promise<Blob>;
22
22
  getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
23
23
  getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
24
24
  getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext): Promise<Blob>;
@@ -156,7 +156,7 @@ export interface MediaApi {
156
156
  getFile: (fileId: string, params: MediaStoreGetFileParams, traceContext?: MediaTraceContext) => Promise<MediaStoreResponse<MediaFile>>;
157
157
  getFileImageURL: (id: string, params?: MediaStoreGetFileImageParams) => Promise<string>;
158
158
  getFileImageURLSync: (id: string, params?: MediaStoreGetFileImageParams) => string;
159
- getFileBinary: (id: string, collectionName?: string) => Promise<Blob>;
159
+ getFileBinary: (id: string, collectionName?: string, abortController?: AbortController) => Promise<Blob>;
160
160
  getFileBinaryURL: (id: string, collectionName?: string) => Promise<string>;
161
161
  getArtifactURL: (artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string) => Promise<string>;
162
162
  getImage: (id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext) => Promise<Blob>;
@@ -18,7 +18,7 @@ export declare class MediaStore implements MediaApi {
18
18
  getFileImageURL(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
19
19
  getFileImageURLSync(id: string, params?: MediaStoreGetFileImageParams): string;
20
20
  private createFileImageURL;
21
- getFileBinary(id: string, collectionName?: string, maxAge?: number): Promise<Blob>;
21
+ getFileBinary(id: string, collectionName?: string, abortController?: AbortController, maxAge?: number): Promise<Blob>;
22
22
  getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
23
23
  getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
24
24
  getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext): Promise<Blob>;
@@ -156,7 +156,7 @@ export interface MediaApi {
156
156
  getFile: (fileId: string, params: MediaStoreGetFileParams, traceContext?: MediaTraceContext) => Promise<MediaStoreResponse<MediaFile>>;
157
157
  getFileImageURL: (id: string, params?: MediaStoreGetFileImageParams) => Promise<string>;
158
158
  getFileImageURLSync: (id: string, params?: MediaStoreGetFileImageParams) => string;
159
- getFileBinary: (id: string, collectionName?: string) => Promise<Blob>;
159
+ getFileBinary: (id: string, collectionName?: string, abortController?: AbortController) => Promise<Blob>;
160
160
  getFileBinaryURL: (id: string, collectionName?: string) => Promise<string>;
161
161
  getArtifactURL: (artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string) => Promise<string>;
162
162
  getImage: (id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext) => Promise<Blob>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-client",
3
- "version": "28.1.0",
3
+ "version": "28.2.0",
4
4
  "description": "Media API Web Client Library",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"