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/es2015/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
|
*/
|
|
@@ -8463,10 +8463,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
8463
8463
|
*/ const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true)=>{
|
|
8464
8464
|
let currentImage;
|
|
8465
8465
|
const tabs = [];
|
|
8466
|
-
|
|
8466
|
+
const options = editor.o.uploader;
|
|
8467
|
+
if (callbacks.upload && (options.url || options.insertImageAsBase64URI || options.customUploadFunction)) {
|
|
8467
8468
|
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>');
|
|
8468
8469
|
editor.uploader.bind(dragBox, (resp)=>{
|
|
8469
|
-
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload :
|
|
8470
|
+
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload : options.defaultHandlerSuccess;
|
|
8470
8471
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) {
|
|
8471
8472
|
handler.call(editor, resp);
|
|
8472
8473
|
}
|
|
@@ -33050,24 +33051,27 @@ function ConfigFlatten(obj) {
|
|
|
33050
33051
|
const ajaxInstances = new WeakMap();
|
|
33051
33052
|
function send(uploader, data) {
|
|
33052
33053
|
const requestData = (0,jodit_modules_uploader_helpers_build_data__WEBPACK_IMPORTED_MODULE_2__.buildData)(uploader, data);
|
|
33053
|
-
const
|
|
33054
|
+
const showProgress = (progress)=>{
|
|
33055
|
+
uploader.j.progressbar.show().progress(progress);
|
|
33056
|
+
if (progress >= 100) {
|
|
33057
|
+
uploader.j.progressbar.hide();
|
|
33058
|
+
}
|
|
33059
|
+
};
|
|
33060
|
+
let sendData = (request, showProgress)=>{
|
|
33054
33061
|
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_1__.Ajax({
|
|
33055
33062
|
xhr: ()=>{
|
|
33056
33063
|
const xhr = new XMLHttpRequest();
|
|
33057
33064
|
if (uploader.j.ow.FormData !== undefined && xhr.upload) {
|
|
33058
|
-
|
|
33065
|
+
showProgress(10);
|
|
33059
33066
|
xhr.upload.addEventListener('progress', (evt)=>{
|
|
33060
33067
|
if (evt.lengthComputable) {
|
|
33061
33068
|
let percentComplete = evt.loaded / evt.total;
|
|
33062
33069
|
percentComplete *= 100;
|
|
33063
|
-
|
|
33064
|
-
if (percentComplete >= 100) {
|
|
33065
|
-
uploader.j.progressbar.hide();
|
|
33066
|
-
}
|
|
33070
|
+
showProgress(percentComplete);
|
|
33067
33071
|
}
|
|
33068
33072
|
}, false);
|
|
33069
33073
|
} else {
|
|
33070
|
-
|
|
33074
|
+
showProgress(100);
|
|
33071
33075
|
}
|
|
33072
33076
|
return xhr;
|
|
33073
33077
|
},
|
|
@@ -33100,12 +33104,15 @@ function send(uploader, data) {
|
|
|
33100
33104
|
instances === null || instances === void 0 ? void 0 : instances.delete(ajax);
|
|
33101
33105
|
});
|
|
33102
33106
|
};
|
|
33107
|
+
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(uploader.o.customUploadFunction)) {
|
|
33108
|
+
sendData = uploader.o.customUploadFunction;
|
|
33109
|
+
}
|
|
33103
33110
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isPromise)(requestData)) {
|
|
33104
|
-
return requestData.then(sendData).catch((error)=>{
|
|
33111
|
+
return requestData.then((data)=>sendData(data, showProgress)).catch((error)=>{
|
|
33105
33112
|
uploader.o.error.call(uploader, error);
|
|
33106
33113
|
});
|
|
33107
33114
|
}
|
|
33108
|
-
return sendData(requestData);
|
|
33115
|
+
return sendData(requestData, showProgress);
|
|
33109
33116
|
}
|
|
33110
33117
|
|
|
33111
33118
|
|
|
@@ -34623,7 +34630,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34623
34630
|
* ```
|
|
34624
34631
|
* @packageDocumentation
|
|
34625
34632
|
* @module constants
|
|
34626
|
-
*/ const APP_VERSION = "4.7.
|
|
34633
|
+
*/ const APP_VERSION = "4.7.5";
|
|
34627
34634
|
// prettier-ignore
|
|
34628
34635
|
const ES = "es2015";
|
|
34629
34636
|
const IS_ES_MODERN = true;
|