jodit 4.7.4 → 4.7.5
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 +46 -31
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +20 -13
- package/es2015/jodit.min.js +3 -3
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +3 -3
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +4 -4
- package/es2021/jodit.js +20 -13
- package/es2021/jodit.min.js +4 -4
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +4 -4
- package/es2021.en/jodit.js +20 -13
- package/es2021.en/jodit.min.js +4 -4
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +22 -13
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/modules/uploader/helpers/send.js +17 -11
- package/esm/modules/widget/file-selector/file-selector.js +5 -3
- package/esm/types/uploader.d.ts +14 -0
- package/package.json +1 -1
- package/types/types/uploader.d.ts +14 -0
package/es2021.en/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.7.
|
|
4
|
+
* Version: v4.7.5
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -8049,10 +8049,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
8049
8049
|
*/ const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true)=>{
|
|
8050
8050
|
let currentImage;
|
|
8051
8051
|
const tabs = [];
|
|
8052
|
-
|
|
8052
|
+
const options = editor.o.uploader;
|
|
8053
|
+
if (callbacks.upload && (options.url || options.insertImageAsBase64URI || options.customUploadFunction)) {
|
|
8053
8054
|
const dragBox = editor.c.fromHTML('<div class="jodit-drag-and-drop__file-box">' + `<strong>${editor.i18n(isImage ? 'Drop image' : 'Drop file')}</strong>` + `<span><br>${editor.i18n('or click')}</span>` + `<input type="file" accept="${isImage ? 'image/*' : '*'}" tabindex="-1" dir="auto" multiple=""/>` + '</div>');
|
|
8054
8055
|
editor.uploader.bind(dragBox, (resp)=>{
|
|
8055
|
-
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload :
|
|
8056
|
+
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload : options.defaultHandlerSuccess;
|
|
8056
8057
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) {
|
|
8057
8058
|
handler.call(editor, resp);
|
|
8058
8059
|
}
|
|
@@ -31514,24 +31515,27 @@ function ConfigFlatten(obj) {
|
|
|
31514
31515
|
const ajaxInstances = new WeakMap();
|
|
31515
31516
|
function send(uploader, data) {
|
|
31516
31517
|
const requestData = (0,jodit_modules_uploader_helpers_build_data__WEBPACK_IMPORTED_MODULE_2__.buildData)(uploader, data);
|
|
31517
|
-
const
|
|
31518
|
+
const showProgress = (progress)=>{
|
|
31519
|
+
uploader.j.progressbar.show().progress(progress);
|
|
31520
|
+
if (progress >= 100) {
|
|
31521
|
+
uploader.j.progressbar.hide();
|
|
31522
|
+
}
|
|
31523
|
+
};
|
|
31524
|
+
let sendData = (request, showProgress)=>{
|
|
31518
31525
|
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_1__.Ajax({
|
|
31519
31526
|
xhr: ()=>{
|
|
31520
31527
|
const xhr = new XMLHttpRequest();
|
|
31521
31528
|
if (uploader.j.ow.FormData !== undefined && xhr.upload) {
|
|
31522
|
-
|
|
31529
|
+
showProgress(10);
|
|
31523
31530
|
xhr.upload.addEventListener('progress', (evt)=>{
|
|
31524
31531
|
if (evt.lengthComputable) {
|
|
31525
31532
|
let percentComplete = evt.loaded / evt.total;
|
|
31526
31533
|
percentComplete *= 100;
|
|
31527
|
-
|
|
31528
|
-
if (percentComplete >= 100) {
|
|
31529
|
-
uploader.j.progressbar.hide();
|
|
31530
|
-
}
|
|
31534
|
+
showProgress(percentComplete);
|
|
31531
31535
|
}
|
|
31532
31536
|
}, false);
|
|
31533
31537
|
} else {
|
|
31534
|
-
|
|
31538
|
+
showProgress(100);
|
|
31535
31539
|
}
|
|
31536
31540
|
return xhr;
|
|
31537
31541
|
},
|
|
@@ -31564,12 +31568,15 @@ function send(uploader, data) {
|
|
|
31564
31568
|
instances?.delete(ajax);
|
|
31565
31569
|
});
|
|
31566
31570
|
};
|
|
31571
|
+
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(uploader.o.customUploadFunction)) {
|
|
31572
|
+
sendData = uploader.o.customUploadFunction;
|
|
31573
|
+
}
|
|
31567
31574
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isPromise)(requestData)) {
|
|
31568
|
-
return requestData.then(sendData).catch((error)=>{
|
|
31575
|
+
return requestData.then((data)=>sendData(data, showProgress)).catch((error)=>{
|
|
31569
31576
|
uploader.o.error.call(uploader, error);
|
|
31570
31577
|
});
|
|
31571
31578
|
}
|
|
31572
|
-
return sendData(requestData);
|
|
31579
|
+
return sendData(requestData, showProgress);
|
|
31573
31580
|
}
|
|
31574
31581
|
|
|
31575
31582
|
|
|
@@ -33052,7 +33059,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33052
33059
|
* ```
|
|
33053
33060
|
* @packageDocumentation
|
|
33054
33061
|
* @module constants
|
|
33055
|
-
*/ const APP_VERSION = "4.7.
|
|
33062
|
+
*/ const APP_VERSION = "4.7.5";
|
|
33056
33063
|
// prettier-ignore
|
|
33057
33064
|
const ES = "es2021";
|
|
33058
33065
|
const IS_ES_MODERN = true;
|