jodit 4.13.21 → 4.13.23
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 +12 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +29 -34
- package/es2015/jodit.min.css +1 -1
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +4 -4
- package/es2018/jodit.min.css +1 -1
- 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.css +1 -1
- package/es2021/jodit.fat.min.js +4 -4
- package/es2021/jodit.js +27 -34
- package/es2021/jodit.min.css +1 -1
- 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.css +1 -1
- package/es2021.en/jodit.fat.min.js +4 -4
- package/es2021.en/jodit.js +27 -34
- package/es2021.en/jodit.min.css +1 -1
- 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.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +55 -34
- package/es5/jodit.min.css +3 -3
- 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 +2 -2
- package/es5/polyfills.js +213 -87
- package/es5/polyfills.min.js +2 -2
- package/esm/core/constants.js +1 -1
- package/esm/modules/uploader/helpers/data-uri-to-blob.d.ts +3 -1
- package/esm/modules/uploader/helpers/data-uri-to-blob.js +7 -8
- package/esm/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.js +7 -1
- package/esm/plugins/clean-html/helpers/visitor/filters/remove-inv-text-nodes.js +4 -1
- package/esm/plugins/image-processor/image-processor.js +11 -19
- package/package.json +1 -1
- package/types/modules/uploader/helpers/data-uri-to-blob.d.ts +3 -1
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.13.
|
|
4
|
+
* Version: v4.13.23
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1843,7 +1843,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1843
1843
|
* ```
|
|
1844
1844
|
* @packageDocumentation
|
|
1845
1845
|
* @module constants
|
|
1846
|
-
*/ const APP_VERSION = "4.13.
|
|
1846
|
+
*/ const APP_VERSION = "4.13.23";
|
|
1847
1847
|
// prettier-ignore
|
|
1848
1848
|
const ES = "es2021";
|
|
1849
1849
|
const IS_ES_MODERN = true;
|
|
@@ -24807,13 +24807,11 @@ function buildData(uploader, data) {
|
|
|
24807
24807
|
*/ /**
|
|
24808
24808
|
* @module modules/uploader
|
|
24809
24809
|
*/ /**
|
|
24810
|
-
* Convert dataURI to Blob
|
|
24810
|
+
* Convert dataURI to Blob. Both base64 and percent-encoded payloads are
|
|
24811
|
+
* supported — `data:image/svg+xml,%3Csvg...` is as valid as
|
|
24812
|
+
* `data:image/png;base64,...`
|
|
24811
24813
|
*/ function dataURItoBlob(dataURI) {
|
|
24812
|
-
|
|
24813
|
-
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
|
|
24814
|
-
const byteString = atob(dataURI.split(',')[1]), // separate out the mime component
|
|
24815
|
-
mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0], // write the bytes of the string to an ArrayBuffer
|
|
24816
|
-
ab = new ArrayBuffer(byteString.length), ia = new Uint8Array(ab);
|
|
24814
|
+
const [header, ...rest] = dataURI.split(','), payload = rest.join(','), mimeString = header.split(':')[1]?.split(';')[0] ?? '', byteString = /;base64/i.test(header) ? atob(payload) : decodeURIComponent(payload), ab = new ArrayBuffer(byteString.length), ia = new Uint8Array(ab);
|
|
24817
24815
|
for(let i = 0; i < byteString.length; i += 1){
|
|
24818
24816
|
ia[i] = byteString.charCodeAt(i);
|
|
24819
24817
|
}
|
|
@@ -28478,7 +28476,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
28478
28476
|
* @private
|
|
28479
28477
|
*/ function removeEmptyTextNode(jodit, node, hadEffect, arg, argi, currentNode) {
|
|
28480
28478
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node) && !node.nodeValue) {
|
|
28481
|
-
|
|
28479
|
+
// Restore the caret only while the editor owns focus. The walker runs
|
|
28480
|
+
// asynchronously, so the user may have already tabbed away — moving the
|
|
28481
|
+
// selection here would call `focus()` and steal focus back from the
|
|
28482
|
+
// element the user navigated to (e.g. Shift+Tab accessibility flow).
|
|
28483
|
+
if (node === currentNode && jodit.s.isFocused() && jodit.s.isCollapsed()) {
|
|
28482
28484
|
jodit.s.setCursorAfter(node);
|
|
28483
28485
|
}
|
|
28484
28486
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(node);
|
|
@@ -28521,7 +28523,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
28521
28523
|
return hadEffect;
|
|
28522
28524
|
}
|
|
28523
28525
|
node.nodeValue = node.nodeValue.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP)(), '');
|
|
28524
|
-
|
|
28526
|
+
// Same guard as in `removeEmptyTextNode`: the walker is asynchronous, so
|
|
28527
|
+
// never move the selection (it re-focuses the editor) once the user has
|
|
28528
|
+
// moved focus elsewhere.
|
|
28529
|
+
if (node === currentNode && jodit.s.isFocused() && jodit.s.isCollapsed()) {
|
|
28525
28530
|
jodit.s.setCursorAfter(node);
|
|
28526
28531
|
}
|
|
28527
28532
|
if (!node.nodeValue) {
|
|
@@ -32298,7 +32303,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
32298
32303
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28077);
|
|
32299
32304
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65946);
|
|
32300
32305
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91206);
|
|
32301
|
-
/* harmony import */ var
|
|
32306
|
+
/* harmony import */ var jodit_modules_uploader_helpers_data_uri_to_blob__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(23112);
|
|
32307
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(51034);
|
|
32302
32308
|
/*!
|
|
32303
32309
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32304
32310
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32314,6 +32320,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
32314
32320
|
|
|
32315
32321
|
|
|
32316
32322
|
|
|
32323
|
+
|
|
32317
32324
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
32318
32325
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
32319
32326
|
/**
|
|
@@ -32396,7 +32403,15 @@ function replaceDataURIToBlobUUID(editor, elm) {
|
|
|
32396
32403
|
if (typeof ArrayBuffer === 'undefined' || typeof URL === 'undefined') {
|
|
32397
32404
|
return;
|
|
32398
32405
|
}
|
|
32399
|
-
const dataUri = elm.src
|
|
32406
|
+
const dataUri = elm.src;
|
|
32407
|
+
let blob;
|
|
32408
|
+
try {
|
|
32409
|
+
blob = (0,jodit_modules_uploader_helpers_data_uri_to_blob__WEBPACK_IMPORTED_MODULE_6__.dataURItoBlob)(dataUri);
|
|
32410
|
+
} catch {
|
|
32411
|
+
// A data URI the browser accepts but we cannot decode is not worth
|
|
32412
|
+
// breaking the editor over — keep the image as it is
|
|
32413
|
+
return;
|
|
32414
|
+
}
|
|
32400
32415
|
elm.src = URL.createObjectURL(blob);
|
|
32401
32416
|
editor.e.fire('internalUpdate');
|
|
32402
32417
|
const { buffer } = editor;
|
|
@@ -32404,28 +32419,6 @@ function replaceDataURIToBlobUUID(editor, elm) {
|
|
|
32404
32419
|
list[elm.src] = dataUri;
|
|
32405
32420
|
editor.buffer.set(JODIT_IMAGE_BLOB_ID, list);
|
|
32406
32421
|
}
|
|
32407
|
-
// https://stackoverflow.com/a/12300351
|
|
32408
|
-
function dataURItoBlob(dataURI) {
|
|
32409
|
-
// convert base64 to raw binary data held in a string
|
|
32410
|
-
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
|
|
32411
|
-
const byteString = atob(dataURI.split(',')[1]);
|
|
32412
|
-
// separate out the mime component
|
|
32413
|
-
const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
|
|
32414
|
-
// write the bytes of the string to an ArrayBuffer
|
|
32415
|
-
const ab = new ArrayBuffer(byteString.length);
|
|
32416
|
-
// create a view into the buffer
|
|
32417
|
-
const ia = new Uint8Array(ab);
|
|
32418
|
-
// set the bytes of the buffer to the correct values
|
|
32419
|
-
for(let i = 0; i < byteString.length; i++){
|
|
32420
|
-
ia[i] = byteString.charCodeAt(i);
|
|
32421
|
-
}
|
|
32422
|
-
// write the ArrayBuffer to a blob, and you're done
|
|
32423
|
-
return new Blob([
|
|
32424
|
-
ab
|
|
32425
|
-
], {
|
|
32426
|
-
type: mimeString
|
|
32427
|
-
});
|
|
32428
|
-
}
|
|
32429
32422
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('imageProcessor', imageProcessor);
|
|
32430
32423
|
|
|
32431
32424
|
|