@atlaskit/media-picker 64.2.4 → 64.3.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,11 @@
1
1
  # @atlaskit/media-picker
2
2
 
3
+ ## 64.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c213d7f6cfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c213d7f6cfb) - Expose Expiry After parameter for Media Backend
8
+
3
9
  ## 64.2.4
4
10
 
5
11
  ### Patch Changes
@@ -160,6 +160,10 @@ var ClipboardBase = /*#__PURE__*/function (_LocalUploadComponent) {
160
160
  if (prevProps.featureFlags !== this.props.featureFlags) {
161
161
  this.clipboard.featureFlags = this.props.featureFlags;
162
162
  }
163
+ // refreshes uploadParams as only set once in parent constructor
164
+ if (prevProps.config.uploadParams !== this.props.config.uploadParams) {
165
+ this.setUploadParams(this.props.config.uploadParams);
166
+ }
163
167
  }
164
168
  }, {
165
169
  key: "componentWillUnmount",
@@ -96,30 +96,31 @@ var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
96
96
  case 2:
97
97
  dragEvent.preventDefault();
98
98
  dragEvent.stopPropagation();
99
- featureFlags = _this.props.featureFlags;
99
+ featureFlags = _this.props.featureFlags; // refreshes uploadParams as only set once in parent constructor
100
+ _this.setUploadParams(_this.props.config.uploadParams);
100
101
  /*
101
102
  * Only enable support for folders if (1) the browser is supported (2) feature flag is enabled
102
103
  * The file flattening library used to add support for Folders uses a function called webkitEntry.
103
104
  * Some browser types are not supported https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitEntries
104
105
  */
105
106
  if (!((0, _browser.isWebkitSupported)() && (0, _mediaCommon.getMediaFeatureFlag)('folderUploads', featureFlags))) {
106
- _context.next = 14;
107
+ _context.next = 15;
107
108
  break;
108
109
  }
109
110
  _this.fireAnalyticsForFolders(dragEvent.dataTransfer.items);
110
- _context.next = 9;
111
+ _context.next = 10;
111
112
  return _this.getFilesFromDragEvent(dragEvent.dataTransfer.items);
112
- case 9:
113
+ case 10:
113
114
  flattenedDirectoryFiles = _context.sent;
114
115
  _this.onDropFolders(flattenedDirectoryFiles.length);
115
116
  _this.uploadService.addFiles(flattenedDirectoryFiles, featureFlags);
116
- _context.next = 17;
117
+ _context.next = 18;
117
118
  break;
118
- case 14:
119
+ case 15:
119
120
  _this.onDrop(dragEvent);
120
121
  files = Array.from(dragEvent.dataTransfer.files);
121
122
  _this.uploadService.addFiles(files, featureFlags);
122
- case 17:
123
+ case 18:
123
124
  case "end":
124
125
  return _context.stop();
125
126
  }
@@ -120,7 +120,10 @@ var UploadServiceImpl = /*#__PURE__*/function () {
120
120
  tenantMediaClient = this.tenantMediaClient,
121
121
  shouldCopyFileToRecents = this.shouldCopyFileToRecents;
122
122
  var mediaClient = shouldCopyFileToRecents ? tenantMediaClient : userMediaClient;
123
- var collection = shouldCopyFileToRecents ? this.tenantUploadParams.collection : _constants.RECENTS_COLLECTION;
123
+ var _this$tenantUploadPar = this.tenantUploadParams,
124
+ collectionTentant = _this$tenantUploadPar.collection,
125
+ expireAfter = _this$tenantUploadPar.expireAfter;
126
+ var collection = shouldCopyFileToRecents ? collectionTentant : _constants.RECENTS_COLLECTION;
124
127
  if (!mediaClient) {
125
128
  return;
126
129
  }
@@ -130,7 +133,8 @@ var UploadServiceImpl = /*#__PURE__*/function () {
130
133
  touchFileDescriptors.push({
131
134
  fileId: replaceFileId || (0, _v.default)(),
132
135
  occurrenceKey: (0, _v.default)(),
133
- collection: collection
136
+ collection: collection,
137
+ expireAfter: expireAfter
134
138
  });
135
139
  }
136
140
  var traceContext = {
@@ -7,7 +7,7 @@ exports.getPackageAttributes = getPackageAttributes;
7
7
  exports.getRequestMetadata = getRequestMetadata;
8
8
  var _mediaClient = require("@atlaskit/media-client");
9
9
  var packageName = "@atlaskit/media-picker";
10
- var packageVersion = "64.2.4";
10
+ var packageVersion = "64.3.0";
11
11
  function getPackageAttributes(componentName) {
12
12
  return {
13
13
  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 = "64.2.4";
15
+ var packageVersion = "64.3.0";
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": "64.2.4"
3
+ "version": "64.3.0"
4
4
  }
@@ -125,6 +125,10 @@ export class ClipboardBase extends LocalUploadComponentReact {
125
125
  if (prevProps.featureFlags !== this.props.featureFlags) {
126
126
  this.clipboard.featureFlags = this.props.featureFlags;
127
127
  }
128
+ // refreshes uploadParams as only set once in parent constructor
129
+ if (prevProps.config.uploadParams !== this.props.config.uploadParams) {
130
+ this.setUploadParams(this.props.config.uploadParams);
131
+ }
128
132
  }
129
133
  componentWillUnmount() {
130
134
  this.clipboard.deactivate();
@@ -69,6 +69,8 @@ export class DropzoneBase extends LocalUploadComponentReact {
69
69
  const {
70
70
  featureFlags
71
71
  } = this.props;
72
+ // refreshes uploadParams as only set once in parent constructor
73
+ this.setUploadParams(this.props.config.uploadParams);
72
74
  /*
73
75
  * Only enable support for folders if (1) the browser is supported (2) feature flag is enabled
74
76
  * The file flattening library used to add support for Folders uses a function called webkitEntry.
@@ -82,7 +82,11 @@ export class UploadServiceImpl {
82
82
  shouldCopyFileToRecents
83
83
  } = this;
84
84
  const mediaClient = shouldCopyFileToRecents ? tenantMediaClient : userMediaClient;
85
- const collection = shouldCopyFileToRecents ? this.tenantUploadParams.collection : RECENTS_COLLECTION;
85
+ const {
86
+ collection: collectionTentant,
87
+ expireAfter
88
+ } = this.tenantUploadParams;
89
+ const collection = shouldCopyFileToRecents ? collectionTentant : RECENTS_COLLECTION;
86
90
  if (!mediaClient) {
87
91
  return;
88
92
  }
@@ -94,7 +98,8 @@ export class UploadServiceImpl {
94
98
  touchFileDescriptors.push({
95
99
  fileId: replaceFileId || uuidV4(),
96
100
  occurrenceKey: uuidV4(),
97
- collection
101
+ collection,
102
+ expireAfter
98
103
  });
99
104
  }
100
105
  const traceContext = {
@@ -1,6 +1,6 @@
1
1
  import { isRequestError } from '@atlaskit/media-client';
2
2
  const packageName = "@atlaskit/media-picker";
3
- const packageVersion = "64.2.4";
3
+ const packageVersion = "64.3.0";
4
4
  export function getPackageAttributes(componentName) {
5
5
  return {
6
6
  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 = "64.2.4";
5
+ const packageVersion = "64.3.0";
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": "64.2.4"
3
+ "version": "64.3.0"
4
4
  }
@@ -152,6 +152,10 @@ export var ClipboardBase = /*#__PURE__*/function (_LocalUploadComponent) {
152
152
  if (prevProps.featureFlags !== this.props.featureFlags) {
153
153
  this.clipboard.featureFlags = this.props.featureFlags;
154
154
  }
155
+ // refreshes uploadParams as only set once in parent constructor
156
+ if (prevProps.config.uploadParams !== this.props.config.uploadParams) {
157
+ this.setUploadParams(this.props.config.uploadParams);
158
+ }
155
159
  }
156
160
  }, {
157
161
  key: "componentWillUnmount",
@@ -89,30 +89,31 @@ export var DropzoneBase = /*#__PURE__*/function (_LocalUploadComponent) {
89
89
  case 2:
90
90
  dragEvent.preventDefault();
91
91
  dragEvent.stopPropagation();
92
- featureFlags = _this.props.featureFlags;
92
+ featureFlags = _this.props.featureFlags; // refreshes uploadParams as only set once in parent constructor
93
+ _this.setUploadParams(_this.props.config.uploadParams);
93
94
  /*
94
95
  * Only enable support for folders if (1) the browser is supported (2) feature flag is enabled
95
96
  * The file flattening library used to add support for Folders uses a function called webkitEntry.
96
97
  * Some browser types are not supported https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitEntries
97
98
  */
98
99
  if (!(isWebkitSupported() && getMediaFeatureFlag('folderUploads', featureFlags))) {
99
- _context.next = 14;
100
+ _context.next = 15;
100
101
  break;
101
102
  }
102
103
  _this.fireAnalyticsForFolders(dragEvent.dataTransfer.items);
103
- _context.next = 9;
104
+ _context.next = 10;
104
105
  return _this.getFilesFromDragEvent(dragEvent.dataTransfer.items);
105
- case 9:
106
+ case 10:
106
107
  flattenedDirectoryFiles = _context.sent;
107
108
  _this.onDropFolders(flattenedDirectoryFiles.length);
108
109
  _this.uploadService.addFiles(flattenedDirectoryFiles, featureFlags);
109
- _context.next = 17;
110
+ _context.next = 18;
110
111
  break;
111
- case 14:
112
+ case 15:
112
113
  _this.onDrop(dragEvent);
113
114
  files = Array.from(dragEvent.dataTransfer.files);
114
115
  _this.uploadService.addFiles(files, featureFlags);
115
- case 17:
116
+ case 18:
116
117
  case "end":
117
118
  return _context.stop();
118
119
  }
@@ -113,7 +113,10 @@ export var UploadServiceImpl = /*#__PURE__*/function () {
113
113
  tenantMediaClient = this.tenantMediaClient,
114
114
  shouldCopyFileToRecents = this.shouldCopyFileToRecents;
115
115
  var mediaClient = shouldCopyFileToRecents ? tenantMediaClient : userMediaClient;
116
- var collection = shouldCopyFileToRecents ? this.tenantUploadParams.collection : RECENTS_COLLECTION;
116
+ var _this$tenantUploadPar = this.tenantUploadParams,
117
+ collectionTentant = _this$tenantUploadPar.collection,
118
+ expireAfter = _this$tenantUploadPar.expireAfter;
119
+ var collection = shouldCopyFileToRecents ? collectionTentant : RECENTS_COLLECTION;
117
120
  if (!mediaClient) {
118
121
  return;
119
122
  }
@@ -123,7 +126,8 @@ export var UploadServiceImpl = /*#__PURE__*/function () {
123
126
  touchFileDescriptors.push({
124
127
  fileId: replaceFileId || uuidV4(),
125
128
  occurrenceKey: uuidV4(),
126
- collection: collection
129
+ collection: collection,
130
+ expireAfter: expireAfter
127
131
  });
128
132
  }
129
133
  var traceContext = {
@@ -1,6 +1,6 @@
1
1
  import { isRequestError } from '@atlaskit/media-client';
2
2
  var packageName = "@atlaskit/media-picker";
3
- var packageVersion = "64.2.4";
3
+ var packageVersion = "64.3.0";
4
4
  export function getPackageAttributes(componentName) {
5
5
  return {
6
6
  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 = "64.2.4";
8
+ var packageVersion = "64.3.0";
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": "64.2.4"
3
+ "version": "64.3.0"
4
4
  }
@@ -4,6 +4,7 @@ import { LocalUploadConfig } from './components/types';
4
4
  import { PluginItemPayload } from './domain/plugin';
5
5
  export interface UploadParams {
6
6
  collection?: string;
7
+ expireAfter?: number;
7
8
  }
8
9
  export declare type MediaFile = {
9
10
  readonly id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "64.2.4",
3
+ "version": "64.3.0",
4
4
  "description": "Library for handling file uploads",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -300,6 +300,8 @@ export type UploadErrorEventPayload = {
300
300
  export interface UploadParams {
301
301
  // (undocumented)
302
302
  collection?: string;
303
+ // (undocumented)
304
+ expireAfter?: number;
303
305
  }
304
306
 
305
307
  // @public (undocumented)
@@ -327,7 +329,7 @@ export type UploadsStartEventPayload = {
327
329
 
328
330
  ```json
329
331
  {
330
- "@atlaskit/media-core": "^34.0.1",
332
+ "@atlaskit/media-core": "^34.0.2",
331
333
  "react": "^16.8.0",
332
334
  "react-dom": "^16.8.0",
333
335
  "react-intl-next": "npm:react-intl@^5.18.1"