@scaleflex/widget-core 4.0.7-beta.0 → 4.1.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 +7521 -0
- package/LICENSE +21 -21
- package/README.md +1201 -1201
- package/dist/style.css +94 -58
- package/dist/style.min.css +1 -1
- package/lib/Client.js +5 -5
- package/lib/Plugin.js +40 -40
- package/lib/SassKeyRenewer.js +12 -12
- package/lib/_common.scss +243 -243
- package/lib/_utils.scss +38 -38
- package/lib/_variables.scss +63 -63
- package/lib/index.js +196 -196
- package/lib/slices/common.slice.js +9 -9
- package/lib/slices/info.slice.js +10 -10
- package/lib/slices/uploads.slice.js +9 -9
- package/lib/slices/user.slice.js +9 -9
- package/lib/style.scss +3 -3
- package/package.json +4 -4
- package/types/index.d.ts +301 -301
package/lib/index.js
CHANGED
|
@@ -79,16 +79,16 @@ var RestrictionError = /*#__PURE__*/function (_Error) {
|
|
|
79
79
|
_inherits(RestrictionError, _Error);
|
|
80
80
|
return _createClass(RestrictionError);
|
|
81
81
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
82
|
-
/**
|
|
83
|
-
* filerobot Core module.
|
|
84
|
-
* Manages plugins, state updates, acts as an event bus,
|
|
85
|
-
* adds/removes files and metadata.
|
|
82
|
+
/**
|
|
83
|
+
* filerobot Core module.
|
|
84
|
+
* Manages plugins, state updates, acts as an event bus,
|
|
85
|
+
* adds/removes files and metadata.
|
|
86
86
|
*/
|
|
87
87
|
var ScaleflexWidget = /*#__PURE__*/function () {
|
|
88
|
-
/**
|
|
89
|
-
* Instantiate filerobot
|
|
90
|
-
*
|
|
91
|
-
* @param {object} opts — filerobot options
|
|
88
|
+
/**
|
|
89
|
+
* Instantiate filerobot
|
|
90
|
+
*
|
|
91
|
+
* @param {object} opts — filerobot options
|
|
92
92
|
*/
|
|
93
93
|
function ScaleflexWidget(opts) {
|
|
94
94
|
var _this2 = this;
|
|
@@ -286,9 +286,9 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
286
286
|
throw new TypeError('`restrictions.allowedFileTypes` must be an array');
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
/**
|
|
290
|
-
* saveMissing translations is temporary disabled. Until we find a good solution how to improve automation.
|
|
291
|
-
* Previous approach doesn't work thus we switched to manual translations adding to Wordplex directly by developers.
|
|
289
|
+
/**
|
|
290
|
+
* saveMissing translations is temporary disabled. Until we find a good solution how to improve automation.
|
|
291
|
+
* Previous approach doesn't work thus we switched to manual translations adding to Wordplex directly by developers.
|
|
292
292
|
*/
|
|
293
293
|
// Translator.IS_DEV = this.opts.dev
|
|
294
294
|
|
|
@@ -296,10 +296,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
296
296
|
|
|
297
297
|
// Container for different types of plugins
|
|
298
298
|
this.plugins = {};
|
|
299
|
-
/*
|
|
300
|
-
* Container for the current uploads operations
|
|
301
|
-
* (not files but the upload process/operation itself that can contain multiple files)
|
|
302
|
-
* made as a property in the class as it doesn't need to cause a render or accessed externally.
|
|
299
|
+
/*
|
|
300
|
+
* Container for the current uploads operations
|
|
301
|
+
* (not files but the upload process/operation itself that can contain multiple files)
|
|
302
|
+
* made as a property in the class as it doesn't need to cause a render or accessed externally.
|
|
303
303
|
*/
|
|
304
304
|
this.uploadOperations = {};
|
|
305
305
|
this.getGlobalState = this.getGlobalState.bind(this);
|
|
@@ -403,10 +403,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
403
403
|
}));
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
-
/**
|
|
407
|
-
* Iterate on all plugins and run `update` on them.
|
|
408
|
-
* Called each time state changes.
|
|
409
|
-
*
|
|
406
|
+
/**
|
|
407
|
+
* Iterate on all plugins and run `update` on them.
|
|
408
|
+
* Called each time state changes.
|
|
409
|
+
*
|
|
410
410
|
*/
|
|
411
411
|
}, {
|
|
412
412
|
key: "updateAll",
|
|
@@ -416,9 +416,9 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
/**
|
|
420
|
-
* creates & assigns the redux store
|
|
421
|
-
*
|
|
419
|
+
/**
|
|
420
|
+
* creates & assigns the redux store
|
|
421
|
+
*
|
|
422
422
|
*/
|
|
423
423
|
}, {
|
|
424
424
|
key: "_storeInit",
|
|
@@ -433,9 +433,9 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
/**
|
|
437
|
-
* injects a sub-reducer into the root reducer (mostly used for injecting a plugin's reducer)
|
|
438
|
-
*
|
|
436
|
+
/**
|
|
437
|
+
* injects a sub-reducer into the root reducer (mostly used for injecting a plugin's reducer)
|
|
438
|
+
*
|
|
439
439
|
*/
|
|
440
440
|
}, {
|
|
441
441
|
key: "_injectReducer",
|
|
@@ -443,9 +443,9 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
443
443
|
this.store.injectReducer(key, reducerFn);
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
/**
|
|
447
|
-
* injects a sub-reducer into the root reducer (mostly used for injecting a plugin's reducer)
|
|
448
|
-
*
|
|
446
|
+
/**
|
|
447
|
+
* injects a sub-reducer into the root reducer (mostly used for injecting a plugin's reducer)
|
|
448
|
+
*
|
|
449
449
|
*/
|
|
450
450
|
}, {
|
|
451
451
|
key: "_removeReducer",
|
|
@@ -453,9 +453,9 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
453
453
|
this.store.removeReducer(key);
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
-
/**
|
|
457
|
-
* Triggers the action to call store's reducers
|
|
458
|
-
* @param {Function} actionCreator
|
|
456
|
+
/**
|
|
457
|
+
* Triggers the action to call store's reducers
|
|
458
|
+
* @param {Function} actionCreator
|
|
459
459
|
*/
|
|
460
460
|
}, {
|
|
461
461
|
key: "dispatch",
|
|
@@ -463,12 +463,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
463
463
|
return this.store.dispatch(actionCreator);
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
/**
|
|
467
|
-
* Updates common state with a patch
|
|
468
|
-
* any state that not organized in a sub-reducer/slice
|
|
469
|
-
*
|
|
470
|
-
* @param {object} patch {foo: 'bar'}
|
|
471
|
-
// * TODO: To check it
|
|
466
|
+
/**
|
|
467
|
+
* Updates common state with a patch
|
|
468
|
+
* any state that not organized in a sub-reducer/slice
|
|
469
|
+
*
|
|
470
|
+
* @param {object} patch {foo: 'bar'}
|
|
471
|
+
// * TODO: To check it
|
|
472
472
|
*/
|
|
473
473
|
}, {
|
|
474
474
|
key: "setCoreCommonState",
|
|
@@ -476,10 +476,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
476
476
|
this.dispatch(coreCommonStateUpdated(patch));
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
-
/**
|
|
480
|
-
* Returns current state of whole redux's store (global state).
|
|
481
|
-
*
|
|
482
|
-
* @returns {object}
|
|
479
|
+
/**
|
|
480
|
+
* Returns current state of whole redux's store (global state).
|
|
481
|
+
*
|
|
482
|
+
* @returns {object}
|
|
483
483
|
*/
|
|
484
484
|
}, {
|
|
485
485
|
key: "getGlobalState",
|
|
@@ -487,10 +487,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
487
487
|
return this.store.getState();
|
|
488
488
|
}
|
|
489
489
|
|
|
490
|
-
/**
|
|
491
|
-
* Returns current core's slice state.
|
|
492
|
-
*
|
|
493
|
-
* @returns {object}
|
|
490
|
+
/**
|
|
491
|
+
* Returns current core's slice state.
|
|
492
|
+
*
|
|
493
|
+
* @returns {object}
|
|
494
494
|
*/
|
|
495
495
|
}, {
|
|
496
496
|
key: "getCoreState",
|
|
@@ -498,10 +498,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
498
498
|
return this.getGlobalState()[PLUGINS_IDS.CORE];
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
-
/**
|
|
502
|
-
* Returns current core's slice state.
|
|
503
|
-
*
|
|
504
|
-
* @returns {object}
|
|
501
|
+
/**
|
|
502
|
+
* Returns current core's slice state.
|
|
503
|
+
*
|
|
504
|
+
* @returns {object}
|
|
505
505
|
*/
|
|
506
506
|
}, {
|
|
507
507
|
key: "getCoreCommonState",
|
|
@@ -509,10 +509,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
509
509
|
return selectCommonState(this.getGlobalState());
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
-
/**
|
|
513
|
-
* Returns current uploads
|
|
514
|
-
*
|
|
515
|
-
* @returns {object}
|
|
512
|
+
/**
|
|
513
|
+
* Returns current uploads
|
|
514
|
+
*
|
|
515
|
+
* @returns {object}
|
|
516
516
|
*/
|
|
517
517
|
}, {
|
|
518
518
|
key: "getUploadOperations",
|
|
@@ -520,10 +520,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
520
520
|
return this.uploadOperations;
|
|
521
521
|
}
|
|
522
522
|
|
|
523
|
-
/**
|
|
524
|
-
* Returns current uploads' meta
|
|
525
|
-
*
|
|
526
|
-
* @returns {object}
|
|
523
|
+
/**
|
|
524
|
+
* Returns current uploads' meta
|
|
525
|
+
*
|
|
526
|
+
* @returns {object}
|
|
527
527
|
*/
|
|
528
528
|
}, {
|
|
529
529
|
key: "getUploadCapabilities",
|
|
@@ -531,10 +531,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
531
531
|
return selectUploadCapabilities(this.getGlobalState());
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
/**
|
|
535
|
-
* Returns the current files that will get uploaded
|
|
536
|
-
*
|
|
537
|
-
* @returns {object}
|
|
534
|
+
/**
|
|
535
|
+
* Returns the current files that will get uploaded
|
|
536
|
+
*
|
|
537
|
+
* @returns {object}
|
|
538
538
|
*/
|
|
539
539
|
}, {
|
|
540
540
|
key: "getUploads",
|
|
@@ -548,10 +548,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
548
548
|
return files;
|
|
549
549
|
}
|
|
550
550
|
|
|
551
|
-
/**
|
|
552
|
-
* Returns the current files that will get uploaded in a type of array
|
|
553
|
-
*
|
|
554
|
-
* @returns {Array}
|
|
551
|
+
/**
|
|
552
|
+
* Returns the current files that will get uploaded in a type of array
|
|
553
|
+
*
|
|
554
|
+
* @returns {Array}
|
|
555
555
|
*/
|
|
556
556
|
}, {
|
|
557
557
|
key: "getUploadsArray",
|
|
@@ -574,8 +574,8 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
574
574
|
this.setFileStateBeforeUpload.apply(this, arguments);
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
/**
|
|
578
|
-
* Shorthand to set state for a specific file.
|
|
577
|
+
/**
|
|
578
|
+
* Shorthand to set state for a specific file.
|
|
579
579
|
*/
|
|
580
580
|
}, {
|
|
581
581
|
key: "setFileStateBeforeUpload",
|
|
@@ -697,10 +697,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
697
697
|
}));
|
|
698
698
|
}
|
|
699
699
|
|
|
700
|
-
/**
|
|
701
|
-
* Get file uploading object.
|
|
702
|
-
*
|
|
703
|
-
* @param {string} fileId The ID of the file object to return.
|
|
700
|
+
/**
|
|
701
|
+
* Get file uploading object.
|
|
702
|
+
*
|
|
703
|
+
* @param {string} fileId The ID of the file object to return.
|
|
704
704
|
*/
|
|
705
705
|
}, {
|
|
706
706
|
key: "getFileUploading",
|
|
@@ -718,10 +718,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
/**
|
|
722
|
-
* Get a file object before upload.
|
|
723
|
-
*
|
|
724
|
-
* @param {string} fileId The ID of the file object to return.
|
|
721
|
+
/**
|
|
722
|
+
* Get a file object before upload.
|
|
723
|
+
*
|
|
724
|
+
* @param {string} fileId The ID of the file object to return.
|
|
725
725
|
*/
|
|
726
726
|
}, {
|
|
727
727
|
key: "getFileBeforeUpload",
|
|
@@ -729,10 +729,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
729
729
|
return selectUploadById(this.getGlobalState(), fileId);
|
|
730
730
|
}
|
|
731
731
|
|
|
732
|
-
/**
|
|
733
|
-
* Check if minNumberOfFiles restriction is reached before uploading.
|
|
734
|
-
*
|
|
735
|
-
* @private
|
|
732
|
+
/**
|
|
733
|
+
* Check if minNumberOfFiles restriction is reached before uploading.
|
|
734
|
+
*
|
|
735
|
+
* @private
|
|
736
736
|
*/
|
|
737
737
|
}, {
|
|
738
738
|
key: "_checkMinNumberOfFiles",
|
|
@@ -745,13 +745,13 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
747
|
|
|
748
|
-
/**
|
|
749
|
-
* Check if file passes a set of restrictions set in options: maxFileSize,
|
|
750
|
-
* maxNumberOfFiles and allowedFileTypes.
|
|
751
|
-
*
|
|
752
|
-
* @param {object} files Object of files already added
|
|
753
|
-
* @param {object} file object to check
|
|
754
|
-
* @private
|
|
748
|
+
/**
|
|
749
|
+
* Check if file passes a set of restrictions set in options: maxFileSize,
|
|
750
|
+
* maxNumberOfFiles and allowedFileTypes.
|
|
751
|
+
*
|
|
752
|
+
* @param {object} files Object of files already added
|
|
753
|
+
* @param {object} file object to check
|
|
754
|
+
* @private
|
|
755
755
|
*/
|
|
756
756
|
}, {
|
|
757
757
|
key: "_checkRestrictions",
|
|
@@ -843,16 +843,16 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
/**
|
|
847
|
-
* Logs an error, sets Informer message, then throws the error.
|
|
848
|
-
* Emits a 'restriction-failed' event if it’s a restriction error
|
|
849
|
-
*
|
|
850
|
-
* @param {object | string} err — Error object or plain string message
|
|
851
|
-
* @param {object} [options]
|
|
852
|
-
* @param {boolean} [options.showInformer=true] — Sometimes developer might want to show Informer manually
|
|
853
|
-
* @param {object} [options.file=null] — File object used to emit the restriction error
|
|
854
|
-
* @param {boolean} [options.throwErr=true] — Errors shouldn’t be thrown, for example, in `upload-error` event
|
|
855
|
-
* @private
|
|
846
|
+
/**
|
|
847
|
+
* Logs an error, sets Informer message, then throws the error.
|
|
848
|
+
* Emits a 'restriction-failed' event if it’s a restriction error
|
|
849
|
+
*
|
|
850
|
+
* @param {object | string} err — Error object or plain string message
|
|
851
|
+
* @param {object} [options]
|
|
852
|
+
* @param {boolean} [options.showInformer=true] — Sometimes developer might want to show Informer manually
|
|
853
|
+
* @param {object} [options.file=null] — File object used to emit the restriction error
|
|
854
|
+
* @param {boolean} [options.throwErr=true] — Errors shouldn’t be thrown, for example, in `upload-error` event
|
|
855
|
+
* @private
|
|
856
856
|
*/
|
|
857
857
|
}, {
|
|
858
858
|
key: "_showOrLogErrorAndThrow",
|
|
@@ -905,12 +905,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
|
|
908
|
-
/**
|
|
909
|
-
* Create a file state object based on user-provided `addFile()` options.
|
|
910
|
-
*
|
|
911
|
-
* Note this is extremely side-effectful and should only be done when a file state object will be added to state immediately afterward!
|
|
912
|
-
*
|
|
913
|
-
* The `files` value is passed in because it may be updated by the caller without updating the store.
|
|
908
|
+
/**
|
|
909
|
+
* Create a file state object based on user-provided `addFile()` options.
|
|
910
|
+
*
|
|
911
|
+
* Note this is extremely side-effectful and should only be done when a file state object will be added to state immediately afterward!
|
|
912
|
+
*
|
|
913
|
+
* The `files` value is passed in because it may be updated by the caller without updating the store.
|
|
914
914
|
*/
|
|
915
915
|
}, {
|
|
916
916
|
key: "_checkAndCreateFileStateObject",
|
|
@@ -998,12 +998,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
998
998
|
return newFile;
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
|
-
/**
|
|
1002
|
-
* check if file is available and if not it will throw an error
|
|
1003
|
-
*
|
|
1004
|
-
* @param {string} error — Error message
|
|
1005
|
-
* @param {object} file — File object
|
|
1006
|
-
* @private
|
|
1001
|
+
/**
|
|
1002
|
+
* check if file is available and if not it will throw an error
|
|
1003
|
+
*
|
|
1004
|
+
* @param {string} error — Error message
|
|
1005
|
+
* @param {object} file — File object
|
|
1006
|
+
* @private
|
|
1007
1007
|
*/
|
|
1008
1008
|
}, {
|
|
1009
1009
|
key: "_checkIfFileIsAvailable",
|
|
@@ -1060,13 +1060,13 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
|
-
/**
|
|
1064
|
-
* Add a new file to `state.files`. This will run `onBeforeFileAdded`,
|
|
1065
|
-
* try to guess file type in a clever way, check file against restrictions,
|
|
1066
|
-
* and start an upload if `autoProceed === true`.
|
|
1067
|
-
*
|
|
1068
|
-
* @param {object} file object to add
|
|
1069
|
-
* @returns {string} id for the added file
|
|
1063
|
+
/**
|
|
1064
|
+
* Add a new file to `state.files`. This will run `onBeforeFileAdded`,
|
|
1065
|
+
* try to guess file type in a clever way, check file against restrictions,
|
|
1066
|
+
* and start an upload if `autoProceed === true`.
|
|
1067
|
+
*
|
|
1068
|
+
* @param {object} file object to add
|
|
1069
|
+
* @returns {string} id for the added file
|
|
1070
1070
|
*/
|
|
1071
1071
|
}, {
|
|
1072
1072
|
key: "addFile",
|
|
@@ -1101,12 +1101,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1101
1101
|
return newFile.id;
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
|
-
/**
|
|
1105
|
-
* Add multiple files to `state.files`. See the `addFile()` documentation.
|
|
1106
|
-
*
|
|
1107
|
-
* This cuts some corners for performance, so should typically only be used in cases where there may be a lot of files.
|
|
1108
|
-
*
|
|
1109
|
-
* If an error occurs while adding a file, it is logged and the user is notified. This is good for UI plugins, but not for programmatic use. Programmatic users should usually still use `addFile()` on individual files.
|
|
1104
|
+
/**
|
|
1105
|
+
* Add multiple files to `state.files`. See the `addFile()` documentation.
|
|
1106
|
+
*
|
|
1107
|
+
* This cuts some corners for performance, so should typically only be used in cases where there may be a lot of files.
|
|
1108
|
+
*
|
|
1109
|
+
* If an error occurs while adding a file, it is logged and the user is notified. This is good for UI plugins, but not for programmatic use. Programmatic users should usually still use `addFile()` on individual files.
|
|
1110
1110
|
*/
|
|
1111
1111
|
}, {
|
|
1112
1112
|
key: "addFiles",
|
|
@@ -1295,9 +1295,9 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1295
1295
|
return this.upload(_defineProperty({}, file.id, file));
|
|
1296
1296
|
}
|
|
1297
1297
|
|
|
1298
|
-
/**
|
|
1299
|
-
* Registers listeners for all global actions, like:
|
|
1300
|
-
* `error`, `file-removed`, `upload-progress`
|
|
1298
|
+
/**
|
|
1299
|
+
* Registers listeners for all global actions, like:
|
|
1300
|
+
* `error`, `file-removed`, `upload-progress`
|
|
1301
1301
|
*/
|
|
1302
1302
|
}, {
|
|
1303
1303
|
key: "_addListeners",
|
|
@@ -1396,12 +1396,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1396
1396
|
return this.opts.id;
|
|
1397
1397
|
}
|
|
1398
1398
|
|
|
1399
|
-
/**
|
|
1400
|
-
* Registers a plugin with Core.
|
|
1401
|
-
*
|
|
1402
|
-
* @param {object} Plugin object
|
|
1403
|
-
* @param {object} [opts] object with options to be passed to Plugin
|
|
1404
|
-
* @returns {object} self for chaining
|
|
1399
|
+
/**
|
|
1400
|
+
* Registers a plugin with Core.
|
|
1401
|
+
*
|
|
1402
|
+
* @param {object} Plugin object
|
|
1403
|
+
* @param {object} [opts] object with options to be passed to Plugin
|
|
1404
|
+
* @returns {object} self for chaining
|
|
1405
1405
|
*/
|
|
1406
1406
|
}, {
|
|
1407
1407
|
key: "use",
|
|
@@ -1439,11 +1439,11 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1439
1439
|
return this;
|
|
1440
1440
|
}
|
|
1441
1441
|
|
|
1442
|
-
/**
|
|
1443
|
-
* Find one Plugin by name.
|
|
1444
|
-
*
|
|
1445
|
-
* @param {string} id plugin id
|
|
1446
|
-
* @returns {object|boolean}
|
|
1442
|
+
/**
|
|
1443
|
+
* Find one Plugin by name.
|
|
1444
|
+
*
|
|
1445
|
+
* @param {string} id plugin id
|
|
1446
|
+
* @returns {object|boolean}
|
|
1447
1447
|
*/
|
|
1448
1448
|
}, {
|
|
1449
1449
|
key: "getPlugin",
|
|
@@ -1458,10 +1458,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1458
1458
|
return foundPlugin;
|
|
1459
1459
|
}
|
|
1460
1460
|
|
|
1461
|
-
/**
|
|
1462
|
-
* Get all the pre-processor plugins
|
|
1463
|
-
*
|
|
1464
|
-
* @returns array
|
|
1461
|
+
/**
|
|
1462
|
+
* Get all the pre-processor plugins
|
|
1463
|
+
*
|
|
1464
|
+
* @returns array
|
|
1465
1465
|
*/
|
|
1466
1466
|
}, {
|
|
1467
1467
|
key: "getPreProcessors",
|
|
@@ -1469,10 +1469,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1469
1469
|
return this.preProcessors;
|
|
1470
1470
|
}
|
|
1471
1471
|
|
|
1472
|
-
/**
|
|
1473
|
-
* Get all the post-processor plugins
|
|
1474
|
-
*
|
|
1475
|
-
* @returns array
|
|
1472
|
+
/**
|
|
1473
|
+
* Get all the post-processor plugins
|
|
1474
|
+
*
|
|
1475
|
+
* @returns array
|
|
1476
1476
|
*/
|
|
1477
1477
|
}, {
|
|
1478
1478
|
key: "getPostProcessors",
|
|
@@ -1480,10 +1480,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1480
1480
|
return this.postProcessors;
|
|
1481
1481
|
}
|
|
1482
1482
|
|
|
1483
|
-
/**
|
|
1484
|
-
* Iterate through all `use`d plugins.
|
|
1485
|
-
*
|
|
1486
|
-
* @param {Function} method that will be run on each plugin
|
|
1483
|
+
/**
|
|
1484
|
+
* Iterate through all `use`d plugins.
|
|
1485
|
+
*
|
|
1486
|
+
* @param {Function} method that will be run on each plugin
|
|
1487
1487
|
*/
|
|
1488
1488
|
}, {
|
|
1489
1489
|
key: "iteratePlugins",
|
|
@@ -1513,10 +1513,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1513
1513
|
return Boolean(this.getPlugin(pluginIdToCheck));
|
|
1514
1514
|
}
|
|
1515
1515
|
|
|
1516
|
-
/**
|
|
1517
|
-
* Uninstall and remove a plugin.
|
|
1518
|
-
*
|
|
1519
|
-
* @param {object} instance The plugin instance to remove.
|
|
1516
|
+
/**
|
|
1517
|
+
* Uninstall and remove a plugin.
|
|
1518
|
+
*
|
|
1519
|
+
* @param {object} instance The plugin instance to remove.
|
|
1520
1520
|
*/
|
|
1521
1521
|
}, {
|
|
1522
1522
|
key: "removePlugin",
|
|
@@ -1536,8 +1536,8 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1536
1536
|
this.emit('plugins-updated', this._getInstalledPkgs());
|
|
1537
1537
|
}
|
|
1538
1538
|
|
|
1539
|
-
/**
|
|
1540
|
-
* Uninstall all plugins and close down this filerobot instance.
|
|
1539
|
+
/**
|
|
1540
|
+
* Uninstall all plugins and close down this filerobot instance.
|
|
1541
1541
|
*/
|
|
1542
1542
|
}, {
|
|
1543
1543
|
key: "close",
|
|
@@ -1553,13 +1553,13 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
1555
1555
|
|
|
1556
|
-
/**
|
|
1557
|
-
* Set info message in `state.info`, so that UI plugins like `Informer`
|
|
1558
|
-
* can display the message.
|
|
1559
|
-
*
|
|
1560
|
-
* @param {string | object} message Message to be displayed by the informer
|
|
1561
|
-
* @param {string} [type]
|
|
1562
|
-
* @param {number} [duration]
|
|
1556
|
+
/**
|
|
1557
|
+
* Set info message in `state.info`, so that UI plugins like `Informer`
|
|
1558
|
+
* can display the message.
|
|
1559
|
+
*
|
|
1560
|
+
* @param {string | object} message Message to be displayed by the informer
|
|
1561
|
+
* @param {string} [type]
|
|
1562
|
+
* @param {number} [duration]
|
|
1563
1563
|
*/
|
|
1564
1564
|
}, {
|
|
1565
1565
|
key: "info",
|
|
@@ -1598,12 +1598,12 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1598
1598
|
this.emit('info-hidden');
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
|
-
/**
|
|
1602
|
-
* Passes messages to a function, provided in `opts.logger`.
|
|
1603
|
-
* If `opts.logger: filerobot.debugLogger` or `opts.debug: true`, logs to the browser console.
|
|
1604
|
-
*
|
|
1605
|
-
* @param {string|object} message to log
|
|
1606
|
-
* @param {string} [type] optional `error` or `warning`
|
|
1601
|
+
/**
|
|
1602
|
+
* Passes messages to a function, provided in `opts.logger`.
|
|
1603
|
+
* If `opts.logger: filerobot.debugLogger` or `opts.debug: true`, logs to the browser console.
|
|
1604
|
+
*
|
|
1605
|
+
* @param {string|object} message to log
|
|
1606
|
+
* @param {string} [type] optional `error` or `warning`
|
|
1607
1607
|
*/
|
|
1608
1608
|
}, {
|
|
1609
1609
|
key: "log",
|
|
@@ -1625,8 +1625,8 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
1627
|
|
|
1628
|
-
/**
|
|
1629
|
-
* Obsolete, event listeners are now added in the constructor.
|
|
1628
|
+
/**
|
|
1629
|
+
* Obsolete, event listeners are now added in the constructor.
|
|
1630
1630
|
*/
|
|
1631
1631
|
}, {
|
|
1632
1632
|
key: "run",
|
|
@@ -1635,8 +1635,8 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1635
1635
|
return this;
|
|
1636
1636
|
}
|
|
1637
1637
|
|
|
1638
|
-
/**
|
|
1639
|
-
* Restore an upload by its ID.
|
|
1638
|
+
/**
|
|
1639
|
+
* Restore an upload by its ID.
|
|
1640
1640
|
*/
|
|
1641
1641
|
}, {
|
|
1642
1642
|
key: "restore",
|
|
@@ -1649,11 +1649,11 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1649
1649
|
return this._runUploadOperation(uploadId);
|
|
1650
1650
|
}
|
|
1651
1651
|
|
|
1652
|
-
/**
|
|
1653
|
-
* Create an upload for a bunch of files.
|
|
1654
|
-
*
|
|
1655
|
-
* @param {Object} files Files to include in this upload.
|
|
1656
|
-
* @returns {string} ID of this upload.
|
|
1652
|
+
/**
|
|
1653
|
+
* Create an upload for a bunch of files.
|
|
1654
|
+
*
|
|
1655
|
+
* @param {Object} files Files to include in this upload.
|
|
1656
|
+
* @returns {string} ID of this upload.
|
|
1657
1657
|
*/
|
|
1658
1658
|
}, {
|
|
1659
1659
|
key: "_createUploadOperation",
|
|
@@ -1692,11 +1692,11 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1692
1692
|
return this.getUploadOperations()[uploadId];
|
|
1693
1693
|
}
|
|
1694
1694
|
|
|
1695
|
-
/**
|
|
1696
|
-
* Add data to an upload's result object.
|
|
1697
|
-
*
|
|
1698
|
-
* @param {string} uploadId The ID of the upload.
|
|
1699
|
-
* @param {object} data Data properties to add to the result object.
|
|
1695
|
+
/**
|
|
1696
|
+
* Add data to an upload's result object.
|
|
1697
|
+
*
|
|
1698
|
+
* @param {string} uploadId The ID of the upload.
|
|
1699
|
+
* @param {object} data Data properties to add to the result object.
|
|
1700
1700
|
*/
|
|
1701
1701
|
}, {
|
|
1702
1702
|
key: "addResultData",
|
|
@@ -1712,10 +1712,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1712
1712
|
});
|
|
1713
1713
|
}
|
|
1714
1714
|
|
|
1715
|
-
/**
|
|
1716
|
-
* Remove an upload, eg. if it has been canceled or completed.
|
|
1717
|
-
*
|
|
1718
|
-
* @param {string} uploadId The ID of the upload.
|
|
1715
|
+
/**
|
|
1716
|
+
* Remove an upload, eg. if it has been canceled or completed.
|
|
1717
|
+
*
|
|
1718
|
+
* @param {string} uploadId The ID of the upload.
|
|
1719
1719
|
*/
|
|
1720
1720
|
}, {
|
|
1721
1721
|
key: "_removeUploadOperation",
|
|
@@ -1723,10 +1723,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1723
1723
|
delete this.uploadOperations[uploadId];
|
|
1724
1724
|
}
|
|
1725
1725
|
|
|
1726
|
-
/**
|
|
1727
|
-
* Edit an upload, eg. if its step/phase is being updated.
|
|
1728
|
-
*
|
|
1729
|
-
* @param {string} updatedUpload - the updated/changed upload operation must contain `id` for the upload's id to be changed.
|
|
1726
|
+
/**
|
|
1727
|
+
* Edit an upload, eg. if its step/phase is being updated.
|
|
1728
|
+
*
|
|
1729
|
+
* @param {string} updatedUpload - the updated/changed upload operation must contain `id` for the upload's id to be changed.
|
|
1730
1730
|
*/
|
|
1731
1731
|
}, {
|
|
1732
1732
|
key: "_updateUploadOperation",
|
|
@@ -1758,10 +1758,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1758
1758
|
});
|
|
1759
1759
|
}
|
|
1760
1760
|
|
|
1761
|
-
/**
|
|
1762
|
-
* Run an upload. This picks up where it left off in case the upload is being restored.
|
|
1763
|
-
*
|
|
1764
|
-
* @private
|
|
1761
|
+
/**
|
|
1762
|
+
* Run an upload. This picks up where it left off in case the upload is being restored.
|
|
1763
|
+
*
|
|
1764
|
+
* @private
|
|
1765
1765
|
*/
|
|
1766
1766
|
}, {
|
|
1767
1767
|
key: "_runUploadOperation",
|
|
@@ -1845,10 +1845,10 @@ var ScaleflexWidget = /*#__PURE__*/function () {
|
|
|
1845
1845
|
});
|
|
1846
1846
|
}
|
|
1847
1847
|
|
|
1848
|
-
/**
|
|
1849
|
-
* Start an upload for all the files that are not currently being uploaded.
|
|
1850
|
-
*
|
|
1851
|
-
* @returns {Promise}
|
|
1848
|
+
/**
|
|
1849
|
+
* Start an upload for all the files that are not currently being uploaded.
|
|
1850
|
+
*
|
|
1851
|
+
* @returns {Promise}
|
|
1852
1852
|
*/
|
|
1853
1853
|
}, {
|
|
1854
1854
|
key: "upload",
|