@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 +6 -0
- package/dist/cjs/components/clipboard/clipboard.js +4 -0
- package/dist/cjs/components/dropzone/dropzone.js +8 -7
- package/dist/cjs/service/uploadServiceImpl.js +6 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/util/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/clipboard/clipboard.js +4 -0
- package/dist/es2019/components/dropzone/dropzone.js +2 -0
- package/dist/es2019/service/uploadServiceImpl.js +7 -2
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/util/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/clipboard/clipboard.js +4 -0
- package/dist/esm/components/dropzone/dropzone.js +8 -7
- package/dist/esm/service/uploadServiceImpl.js +6 -2
- package/dist/esm/util/analytics.js +1 -1
- package/dist/esm/util/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/report.api.md +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -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 =
|
|
107
|
+
_context.next = 15;
|
|
107
108
|
break;
|
|
108
109
|
}
|
|
109
110
|
_this.fireAnalyticsForFolders(dragEvent.dataTransfer.items);
|
|
110
|
-
_context.next =
|
|
111
|
+
_context.next = 10;
|
|
111
112
|
return _this.getFilesFromDragEvent(dragEvent.dataTransfer.items);
|
|
112
|
-
case
|
|
113
|
+
case 10:
|
|
113
114
|
flattenedDirectoryFiles = _context.sent;
|
|
114
115
|
_this.onDropFolders(flattenedDirectoryFiles.length);
|
|
115
116
|
_this.uploadService.addFiles(flattenedDirectoryFiles, featureFlags);
|
|
116
|
-
_context.next =
|
|
117
|
+
_context.next = 18;
|
|
117
118
|
break;
|
|
118
|
-
case
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
15
|
+
var packageVersion = "64.3.0";
|
|
16
16
|
var ufoExperience;
|
|
17
17
|
var initExperience = function initExperience(id, componentName) {
|
|
18
18
|
if (!ufoExperience) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -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
|
|
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 = {
|
|
@@ -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.
|
|
5
|
+
const packageVersion = "64.3.0";
|
|
6
6
|
let ufoExperience;
|
|
7
7
|
const initExperience = (id, componentName) => {
|
|
8
8
|
if (!ufoExperience) {
|
package/dist/es2019/version.json
CHANGED
|
@@ -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 =
|
|
100
|
+
_context.next = 15;
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
102
103
|
_this.fireAnalyticsForFolders(dragEvent.dataTransfer.items);
|
|
103
|
-
_context.next =
|
|
104
|
+
_context.next = 10;
|
|
104
105
|
return _this.getFilesFromDragEvent(dragEvent.dataTransfer.items);
|
|
105
|
-
case
|
|
106
|
+
case 10:
|
|
106
107
|
flattenedDirectoryFiles = _context.sent;
|
|
107
108
|
_this.onDropFolders(flattenedDirectoryFiles.length);
|
|
108
109
|
_this.uploadService.addFiles(flattenedDirectoryFiles, featureFlags);
|
|
109
|
-
_context.next =
|
|
110
|
+
_context.next = 18;
|
|
110
111
|
break;
|
|
111
|
-
case
|
|
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
|
|
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
|
|
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 = {
|
|
@@ -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.
|
|
8
|
+
var packageVersion = "64.3.0";
|
|
9
9
|
var ufoExperience;
|
|
10
10
|
var initExperience = function initExperience(id, componentName) {
|
|
11
11
|
if (!ufoExperience) {
|
package/dist/esm/version.json
CHANGED
package/dist/types/types.d.ts
CHANGED
package/package.json
CHANGED
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.
|
|
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"
|