@atlaskit/media-client 37.3.0 → 37.4.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,19 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 37.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 37.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`bcd2b3a9ab05b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bcd2b3a9ab05b) -
|
|
14
|
+
Added a fallback for file size: if `size` is not supplied by the integrator, it is now inferred
|
|
15
|
+
from the Blob content.
|
|
16
|
+
|
|
3
17
|
## 37.3.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -99,12 +99,15 @@ var createProcessingFunction = function createProcessingFunction(store, deferred
|
|
|
99
99
|
};
|
|
100
100
|
var createFileFromUpload = /*#__PURE__*/function () {
|
|
101
101
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(file, store, uploadableFileUpfrontIds, uploadId, traceContext) {
|
|
102
|
-
var collection, name, mimeType, id, occurrenceKey, body;
|
|
102
|
+
var collection, name, mimeType, content, id, occurrenceKey, body;
|
|
103
103
|
return _regenerator.default.wrap(function (_context4) {
|
|
104
104
|
while (1) switch (_context4.prev = _context4.next) {
|
|
105
105
|
case 0:
|
|
106
|
-
collection = file.collection, name = file.name, mimeType = file.mimeType;
|
|
107
|
-
id = uploadableFileUpfrontIds.id, occurrenceKey = uploadableFileUpfrontIds.occurrenceKey;
|
|
106
|
+
collection = file.collection, name = file.name, mimeType = file.mimeType, content = file.content;
|
|
107
|
+
id = uploadableFileUpfrontIds.id, occurrenceKey = uploadableFileUpfrontIds.occurrenceKey; // If the file is a Blob and the size is not passed from consumer, set the file size from file content
|
|
108
|
+
if (content instanceof Blob && !file.size) {
|
|
109
|
+
file.size = content === null || content === void 0 ? void 0 : content.size;
|
|
110
|
+
}
|
|
108
111
|
body = file.size ? {
|
|
109
112
|
uploadId: uploadId,
|
|
110
113
|
name: name,
|
|
@@ -31,12 +31,18 @@ const createFileFromUpload = async (file, store, uploadableFileUpfrontIds, uploa
|
|
|
31
31
|
const {
|
|
32
32
|
collection,
|
|
33
33
|
name,
|
|
34
|
-
mimeType
|
|
34
|
+
mimeType,
|
|
35
|
+
content
|
|
35
36
|
} = file;
|
|
36
37
|
const {
|
|
37
38
|
id,
|
|
38
39
|
occurrenceKey
|
|
39
40
|
} = uploadableFileUpfrontIds;
|
|
41
|
+
|
|
42
|
+
// If the file is a Blob and the size is not passed from consumer, set the file size from file content
|
|
43
|
+
if (content instanceof Blob && !file.size) {
|
|
44
|
+
file.size = content === null || content === void 0 ? void 0 : content.size;
|
|
45
|
+
}
|
|
40
46
|
const body = file.size ? {
|
|
41
47
|
uploadId,
|
|
42
48
|
name,
|
|
@@ -93,12 +93,15 @@ var createProcessingFunction = function createProcessingFunction(store, deferred
|
|
|
93
93
|
};
|
|
94
94
|
var createFileFromUpload = /*#__PURE__*/function () {
|
|
95
95
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(file, store, uploadableFileUpfrontIds, uploadId, traceContext) {
|
|
96
|
-
var collection, name, mimeType, id, occurrenceKey, body;
|
|
96
|
+
var collection, name, mimeType, content, id, occurrenceKey, body;
|
|
97
97
|
return _regeneratorRuntime.wrap(function (_context4) {
|
|
98
98
|
while (1) switch (_context4.prev = _context4.next) {
|
|
99
99
|
case 0:
|
|
100
|
-
collection = file.collection, name = file.name, mimeType = file.mimeType;
|
|
101
|
-
id = uploadableFileUpfrontIds.id, occurrenceKey = uploadableFileUpfrontIds.occurrenceKey;
|
|
100
|
+
collection = file.collection, name = file.name, mimeType = file.mimeType, content = file.content;
|
|
101
|
+
id = uploadableFileUpfrontIds.id, occurrenceKey = uploadableFileUpfrontIds.occurrenceKey; // If the file is a Blob and the size is not passed from consumer, set the file size from file content
|
|
102
|
+
if (content instanceof Blob && !file.size) {
|
|
103
|
+
file.size = content === null || content === void 0 ? void 0 : content.size;
|
|
104
|
+
}
|
|
102
105
|
body = file.size ? {
|
|
103
106
|
uploadId: uploadId,
|
|
104
107
|
name: name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.4.1",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@atlaskit/chunkinator": "^8.0.0",
|
|
26
26
|
"@atlaskit/media-common": "^14.4.0",
|
|
27
27
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
28
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
28
|
+
"@atlaskit/tmp-editor-statsig": "^156.0.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0",
|
|
30
30
|
"dataloader": "^2.1.0",
|
|
31
31
|
"deep-equal": "^1.0.1",
|