jodit 4.7.3 → 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 +4 -4
- package/es2015/jodit.js +22 -14
- package/es2015/jodit.min.js +4 -4
- 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 +4 -4
- package/es2018/jodit.min.js +4 -4
- 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 +5 -5
- package/es2021/jodit.js +22 -14
- package/es2021/jodit.min.js +5 -5
- 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 +5 -5
- package/es2021.en/jodit.js +22 -14
- package/es2021.en/jodit.min.js +5 -5
- 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 +24 -14
- 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/core/view/view.d.ts +1 -1
- package/esm/jodit.js +2 -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/core/view/view.d.ts +1 -1
- package/types/types/uploader.d.ts +14 -0
package/es2021/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
|
*/
|
|
@@ -8364,10 +8364,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
8364
8364
|
*/ const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true)=>{
|
|
8365
8365
|
let currentImage;
|
|
8366
8366
|
const tabs = [];
|
|
8367
|
-
|
|
8367
|
+
const options = editor.o.uploader;
|
|
8368
|
+
if (callbacks.upload && (options.url || options.insertImageAsBase64URI || options.customUploadFunction)) {
|
|
8368
8369
|
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>');
|
|
8369
8370
|
editor.uploader.bind(dragBox, (resp)=>{
|
|
8370
|
-
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload :
|
|
8371
|
+
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload : options.defaultHandlerSuccess;
|
|
8371
8372
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) {
|
|
8372
8373
|
handler.call(editor, resp);
|
|
8373
8374
|
}
|
|
@@ -30469,7 +30470,8 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_9__.ViewWithToolbar {
|
|
|
30469
30470
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "editorIsActive", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selection", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__mode", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_WYSIWYG), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__callChangeCount", 0), /**
|
|
30470
30471
|
* Don't raise a change event
|
|
30471
30472
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isSilentChange", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "currentPlace", {
|
|
30472
|
-
options: this.__options
|
|
30473
|
+
options: this.__options,
|
|
30474
|
+
container: this.__container
|
|
30473
30475
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "places", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__elementToPlace", new Map());
|
|
30474
30476
|
try {
|
|
30475
30477
|
const elementSource = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.resolveElement)(element, this.options.shadowRoot || this.od);
|
|
@@ -32717,24 +32719,27 @@ function ConfigFlatten(obj) {
|
|
|
32717
32719
|
const ajaxInstances = new WeakMap();
|
|
32718
32720
|
function send(uploader, data) {
|
|
32719
32721
|
const requestData = (0,jodit_modules_uploader_helpers_build_data__WEBPACK_IMPORTED_MODULE_2__.buildData)(uploader, data);
|
|
32720
|
-
const
|
|
32722
|
+
const showProgress = (progress)=>{
|
|
32723
|
+
uploader.j.progressbar.show().progress(progress);
|
|
32724
|
+
if (progress >= 100) {
|
|
32725
|
+
uploader.j.progressbar.hide();
|
|
32726
|
+
}
|
|
32727
|
+
};
|
|
32728
|
+
let sendData = (request, showProgress)=>{
|
|
32721
32729
|
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_1__.Ajax({
|
|
32722
32730
|
xhr: ()=>{
|
|
32723
32731
|
const xhr = new XMLHttpRequest();
|
|
32724
32732
|
if (uploader.j.ow.FormData !== undefined && xhr.upload) {
|
|
32725
|
-
|
|
32733
|
+
showProgress(10);
|
|
32726
32734
|
xhr.upload.addEventListener('progress', (evt)=>{
|
|
32727
32735
|
if (evt.lengthComputable) {
|
|
32728
32736
|
let percentComplete = evt.loaded / evt.total;
|
|
32729
32737
|
percentComplete *= 100;
|
|
32730
|
-
|
|
32731
|
-
if (percentComplete >= 100) {
|
|
32732
|
-
uploader.j.progressbar.hide();
|
|
32733
|
-
}
|
|
32738
|
+
showProgress(percentComplete);
|
|
32734
32739
|
}
|
|
32735
32740
|
}, false);
|
|
32736
32741
|
} else {
|
|
32737
|
-
|
|
32742
|
+
showProgress(100);
|
|
32738
32743
|
}
|
|
32739
32744
|
return xhr;
|
|
32740
32745
|
},
|
|
@@ -32767,12 +32772,15 @@ function send(uploader, data) {
|
|
|
32767
32772
|
instances?.delete(ajax);
|
|
32768
32773
|
});
|
|
32769
32774
|
};
|
|
32775
|
+
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(uploader.o.customUploadFunction)) {
|
|
32776
|
+
sendData = uploader.o.customUploadFunction;
|
|
32777
|
+
}
|
|
32770
32778
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isPromise)(requestData)) {
|
|
32771
|
-
return requestData.then(sendData).catch((error)=>{
|
|
32779
|
+
return requestData.then((data)=>sendData(data, showProgress)).catch((error)=>{
|
|
32772
32780
|
uploader.o.error.call(uploader, error);
|
|
32773
32781
|
});
|
|
32774
32782
|
}
|
|
32775
|
-
return sendData(requestData);
|
|
32783
|
+
return sendData(requestData, showProgress);
|
|
32776
32784
|
}
|
|
32777
32785
|
|
|
32778
32786
|
|
|
@@ -34304,7 +34312,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34304
34312
|
* ```
|
|
34305
34313
|
* @packageDocumentation
|
|
34306
34314
|
* @module constants
|
|
34307
|
-
*/ const APP_VERSION = "4.7.
|
|
34315
|
+
*/ const APP_VERSION = "4.7.5";
|
|
34308
34316
|
// prettier-ignore
|
|
34309
34317
|
const ES = "es2021";
|
|
34310
34318
|
const IS_ES_MODERN = true;
|