@scaleflex/widget-core 4.0.5 → 4.0.7

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/lib/index.js CHANGED
@@ -185,7 +185,6 @@ var ScaleflexWidget = /*#__PURE__*/function () {
185
185
  restrictions: {
186
186
  maxFileSize: null,
187
187
  maxTotalFilesSize: null,
188
- totalUploadedFilesSize: null,
189
188
  maxNumberOfFiles: null,
190
189
  minNumberOfFiles: null,
191
190
  allowedFileTypes: null,
@@ -198,6 +197,7 @@ var ScaleflexWidget = /*#__PURE__*/function () {
198
197
  remoteMaxFolderDepth: 5,
199
198
  remoteMaxFolderCount: 100
200
199
  },
200
+ customUploadedFilesSizeInMb: 0,
201
201
  onBeforeFileAdded: function onBeforeFileAdded(currentFile, files) {
202
202
  return currentFile;
203
203
  },
@@ -759,12 +759,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
759
759
  var _this3 = this,
760
760
  _file$data;
761
761
  var dontCheckFileType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
762
+ var customUploadedFilesSizeInMb = this.opts.customUploadedFilesSizeInMb;
762
763
  var _this$opts$restrictio = this.opts.restrictions,
763
764
  maxFileSize = _this$opts$restrictio.maxFileSize,
764
765
  maxNumberOfFiles = _this$opts$restrictio.maxNumberOfFiles,
765
766
  allowedFileTypes = _this$opts$restrictio.allowedFileTypes,
766
- maxTotalFilesSize = _this$opts$restrictio.maxTotalFilesSize,
767
- totalUploadedFilesSize = _this$opts$restrictio.totalUploadedFilesSize;
767
+ maxTotalFilesSize = _this$opts$restrictio.maxTotalFilesSize;
768
768
  var _selectUserSecurityDa = selectUserSecurityData(this.getGlobalState()),
769
769
  _selectUserSecurityDa2 = _selectUserSecurityDa.upload_scope,
770
770
  allowedFoldersToUploadTo = _selectUserSecurityDa2 === void 0 ? this.opts.userFoldersScope : _selectUserSecurityDa2;
@@ -828,7 +828,7 @@ var ScaleflexWidget = /*#__PURE__*/function () {
828
828
  totalSize += ((_file$data2 = file.data) === null || _file$data2 === void 0 ? void 0 : _file$data2.size) || file.size || 0;
829
829
  return totalSize;
830
830
  }, 0);
831
- if (convertBytesToMb(totalFilesSize) + totalUploadedFilesSize > maxTotalFilesSize) {
831
+ if (convertBytesToMb(totalFilesSize) + customUploadedFilesSizeInMb > maxTotalFilesSize) {
832
832
  throw new RestrictionError(this.i18n('filerobotFilesExceedsSizeError', {
833
833
  size: maxTotalFilesSize
834
834
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scaleflex/widget-core",
3
3
  "description": "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, Box, One Drive, S3 and more.",
4
- "version": "4.0.5",
4
+ "version": "4.0.7",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
7
7
  "style": "dist/style.min.css",
@@ -18,7 +18,7 @@
18
18
  "@reduxjs/toolkit": "^1.9.5",
19
19
  "@scaleflex/icons": "^3.0.0-beta.11",
20
20
  "@scaleflex/ui": "^3.0.0-beta.11",
21
- "@scaleflex/widget-utils": "^4.0.5",
21
+ "@scaleflex/widget-utils": "^4.0.7",
22
22
  "@transloadit/prettier-bytes": "0.1.0",
23
23
  "cuid": "^3.0.0",
24
24
  "lodash.throttle": "^4.1.1",
@@ -34,5 +34,5 @@
34
34
  "react": ">=19.0.0",
35
35
  "react-dom": ">=19.0.0"
36
36
  },
37
- "gitHead": "c95faef749de50d9c458d63a8b01da02efa268e2"
37
+ "gitHead": "a940492ab76142f7041379f9a8a1d0bc8367214f"
38
38
  }