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.
Files changed (66) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +4 -4
  5. package/es2015/jodit.js +29 -34
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +4 -4
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +4 -4
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +4 -4
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +1 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +4 -4
  23. package/es2021/jodit.js +27 -34
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +4 -4
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +1 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +4 -4
  35. package/es2021.en/jodit.js +27 -34
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +4 -4
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +2 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +55 -34
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +2 -2
  57. package/es5/polyfills.js +213 -87
  58. package/es5/polyfills.min.js +2 -2
  59. package/esm/core/constants.js +1 -1
  60. package/esm/modules/uploader/helpers/data-uri-to-blob.d.ts +3 -1
  61. package/esm/modules/uploader/helpers/data-uri-to-blob.js +7 -8
  62. package/esm/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.js +7 -1
  63. package/esm/plugins/clean-html/helpers/visitor/filters/remove-inv-text-nodes.js +4 -1
  64. package/esm/plugins/image-processor/image-processor.js +11 -19
  65. package/package.json +1 -1
  66. package/types/modules/uploader/helpers/data-uri-to-blob.d.ts +3 -1
package/es5/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.21
4
+ * Version: v4.13.23
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2107,7 +2107,7 @@ __webpack_require__.r(__webpack_exports__);
2107
2107
  * @packageDocumentation
2108
2108
  * @module constants
2109
2109
  */
2110
- var APP_VERSION = "4.13.21";
2110
+ var APP_VERSION = "4.13.23";
2111
2111
  // prettier-ignore
2112
2112
  var ES = "es5";
2113
2113
  var IS_ES_MODERN = false;
@@ -30100,6 +30100,8 @@ function buildData(uploader, data) {
30100
30100
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
30101
30101
  /* harmony export */ dataURItoBlob: function() { return /* binding */ dataURItoBlob; }
30102
30102
  /* harmony export */ });
30103
+ /* harmony import */ var _swc_helpers_to_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90625);
30104
+
30103
30105
  /*!
30104
30106
  * Jodit Editor (https://xdsoft.net/jodit/)
30105
30107
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -30107,13 +30109,13 @@ function buildData(uploader, data) {
30107
30109
  */ /**
30108
30110
  * @module modules/uploader
30109
30111
  */ /**
30110
- * Convert dataURI to Blob
30112
+ * Convert dataURI to Blob. Both base64 and percent-encoded payloads are
30113
+ * supported — `data:image/svg+xml,%3Csvg...` is as valid as
30114
+ * `data:image/png;base64,...`
30111
30115
  */ function dataURItoBlob(dataURI) {
30112
- // convert base64 to raw binary data held in a string
30113
- // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
30114
- var byteString = atob(dataURI.split(',')[1]), // separate out the mime component
30115
- mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0], // write the bytes of the string to an ArrayBuffer
30116
- ab = new ArrayBuffer(byteString.length), ia = new Uint8Array(ab);
30116
+ var _ref;
30117
+ var _header_split_;
30118
+ var _dataURI_split = (0,_swc_helpers_to_array__WEBPACK_IMPORTED_MODULE_0__._)(dataURI.split(',')), header = _dataURI_split[0], rest = _dataURI_split.slice(1), payload = rest.join(','), mimeString = (_ref = (_header_split_ = header.split(':')[1]) === null || _header_split_ === void 0 ? void 0 : _header_split_.split(';')[0]) !== null && _ref !== void 0 ? _ref : '', byteString = /;base64/i.test(header) ? atob(payload) : decodeURIComponent(payload), ab = new ArrayBuffer(byteString.length), ia = new Uint8Array(ab);
30117
30119
  for(var i = 0; i < byteString.length; i += 1){
30118
30120
  ia[i] = byteString.charCodeAt(i);
30119
30121
  }
@@ -34143,7 +34145,11 @@ __webpack_require__.r(__webpack_exports__);
34143
34145
  * @private
34144
34146
  */ function removeEmptyTextNode(jodit, node, hadEffect, arg, argi, currentNode) {
34145
34147
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node) && !node.nodeValue) {
34146
- if (node === currentNode && jodit.s.isCollapsed()) {
34148
+ // Restore the caret only while the editor owns focus. The walker runs
34149
+ // asynchronously, so the user may have already tabbed away — moving the
34150
+ // selection here would call `focus()` and steal focus back from the
34151
+ // element the user navigated to (e.g. Shift+Tab accessibility flow).
34152
+ if (node === currentNode && jodit.s.isFocused() && jodit.s.isCollapsed()) {
34147
34153
  jodit.s.setCursorAfter(node);
34148
34154
  }
34149
34155
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(node);
@@ -34186,7 +34192,10 @@ __webpack_require__.r(__webpack_exports__);
34186
34192
  return hadEffect;
34187
34193
  }
34188
34194
  node.nodeValue = node.nodeValue.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP)(), '');
34189
- if (node === currentNode && jodit.s.isCollapsed()) {
34195
+ // Same guard as in `removeEmptyTextNode`: the walker is asynchronous, so
34196
+ // never move the selection (it re-focuses the editor) once the user has
34197
+ // moved focus elsewhere.
34198
+ if (node === currentNode && jodit.s.isFocused() && jodit.s.isCollapsed()) {
34190
34199
  jodit.s.setCursorAfter(node);
34191
34200
  }
34192
34201
  if (!node.nodeValue) {
@@ -38346,7 +38355,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
38346
38355
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
38347
38356
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65946);
38348
38357
  /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
38349
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(51034);
38358
+ /* harmony import */ var jodit_modules_uploader_helpers_data_uri_to_blob__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(23112);
38359
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(51034);
38350
38360
  /*!
38351
38361
  * Jodit Editor (https://xdsoft.net/jodit/)
38352
38362
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -38369,6 +38379,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
38369
38379
 
38370
38380
 
38371
38381
 
38382
+
38372
38383
  var JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
38373
38384
  var JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
38374
38385
  /**
@@ -38520,7 +38531,15 @@ function replaceDataURIToBlobUUID(editor, elm) {
38520
38531
  if (typeof ArrayBuffer === 'undefined' || typeof URL === 'undefined') {
38521
38532
  return;
38522
38533
  }
38523
- var dataUri = elm.src, blob = dataURItoBlob(dataUri);
38534
+ var dataUri = elm.src;
38535
+ var blob;
38536
+ try {
38537
+ blob = (0,jodit_modules_uploader_helpers_data_uri_to_blob__WEBPACK_IMPORTED_MODULE_13__.dataURItoBlob)(dataUri);
38538
+ } catch (unused) {
38539
+ // A data URI the browser accepts but we cannot decode is not worth
38540
+ // breaking the editor over — keep the image as it is
38541
+ return;
38542
+ }
38524
38543
  elm.src = URL.createObjectURL(blob);
38525
38544
  editor.e.fire('internalUpdate');
38526
38545
  var buffer = editor.buffer;
@@ -38528,28 +38547,6 @@ function replaceDataURIToBlobUUID(editor, elm) {
38528
38547
  list[elm.src] = dataUri;
38529
38548
  editor.buffer.set(JODIT_IMAGE_BLOB_ID, list);
38530
38549
  }
38531
- // https://stackoverflow.com/a/12300351
38532
- function dataURItoBlob(dataURI) {
38533
- // convert base64 to raw binary data held in a string
38534
- // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
38535
- var byteString = atob(dataURI.split(',')[1]);
38536
- // separate out the mime component
38537
- var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
38538
- // write the bytes of the string to an ArrayBuffer
38539
- var ab = new ArrayBuffer(byteString.length);
38540
- // create a view into the buffer
38541
- var ia = new Uint8Array(ab);
38542
- // set the bytes of the buffer to the correct values
38543
- for(var i = 0; i < byteString.length; i++){
38544
- ia[i] = byteString.charCodeAt(i);
38545
- }
38546
- // write the ArrayBuffer to a blob, and you're done
38547
- return new Blob([
38548
- ab
38549
- ], {
38550
- type: mimeString
38551
- });
38552
- }
38553
38550
  jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.pluginSystem.add('imageProcessor', imageProcessor);
38554
38551
 
38555
38552
 
@@ -54015,6 +54012,7 @@ function _inherits(subClass, superClass) {
54015
54012
  /* harmony export */ _: function() { return /* binding */ _instanceof; }
54016
54013
  /* harmony export */ });
54017
54014
  function _instanceof(left, right) {
54015
+ "@swc/helpers - instanceof";
54018
54016
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
54019
54017
  return !!right[Symbol.hasInstance](left);
54020
54018
  } else return left instanceof right;
@@ -54309,6 +54307,29 @@ function _super_prop_base(object, property) {
54309
54307
 
54310
54308
 
54311
54309
 
54310
+ /***/ }),
54311
+
54312
+ /***/ 90625:
54313
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
54314
+
54315
+ "use strict";
54316
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
54317
+ /* harmony export */ _: function() { return /* binding */ _to_array; }
54318
+ /* harmony export */ });
54319
+ /* harmony import */ var _array_with_holes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43456);
54320
+ /* harmony import */ var _iterable_to_array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43232);
54321
+ /* harmony import */ var _non_iterable_rest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27301);
54322
+ /* harmony import */ var _unsupported_iterable_to_array_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12600);
54323
+
54324
+
54325
+
54326
+
54327
+ function _to_array(arr) {
54328
+ return (0,_array_with_holes_js__WEBPACK_IMPORTED_MODULE_0__._)(arr) || (0,_iterable_to_array_js__WEBPACK_IMPORTED_MODULE_1__._)(arr) || (0,_unsupported_iterable_to_array_js__WEBPACK_IMPORTED_MODULE_3__._)(arr) || (0,_non_iterable_rest_js__WEBPACK_IMPORTED_MODULE_2__._)();
54329
+ }
54330
+
54331
+
54332
+
54312
54333
  /***/ }),
54313
54334
 
54314
54335
  /***/ 42395: