jodit 4.2.5 → 4.2.6

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 (55) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.js +2 -2
  3. package/es2015/jodit.js +42 -6
  4. package/es2015/jodit.min.js +2 -2
  5. package/es2015/plugins/debug/debug.js +1 -1
  6. package/es2015/plugins/debug/debug.min.js +1 -1
  7. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  10. package/es2018/jodit.css +1 -1
  11. package/es2018/jodit.fat.min.js +2 -2
  12. package/es2018/jodit.js +42 -6
  13. package/es2018/jodit.min.js +2 -2
  14. package/es2018/plugins/debug/debug.js +1 -1
  15. package/es2018/plugins/debug/debug.min.js +1 -1
  16. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  17. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  19. package/es2021/jodit.css +1 -1
  20. package/es2021/jodit.fat.min.js +2 -2
  21. package/es2021/jodit.js +42 -6
  22. package/es2021/jodit.min.js +2 -2
  23. package/es2021/plugins/debug/debug.js +1 -1
  24. package/es2021/plugins/debug/debug.min.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  26. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  28. package/es2021.en/jodit.css +1 -1
  29. package/es2021.en/jodit.fat.min.js +2 -2
  30. package/es2021.en/jodit.js +42 -6
  31. package/es2021.en/jodit.min.js +2 -2
  32. package/es2021.en/plugins/debug/debug.js +1 -1
  33. package/es2021.en/plugins/debug/debug.min.js +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  37. package/es5/jodit.css +2 -2
  38. package/es5/jodit.fat.min.js +2 -2
  39. package/es5/jodit.js +42 -6
  40. package/es5/jodit.min.css +2 -2
  41. package/es5/jodit.min.js +2 -2
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/esm/config.d.ts +22 -0
  48. package/esm/config.js +22 -0
  49. package/esm/core/async/async.js +7 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/modules/file-browser/data-provider.js +4 -1
  52. package/esm/modules/file-browser/file-browser.js +1 -1
  53. package/esm/plugins/image-properties/image-properties.js +6 -2
  54. package/package.json +1 -1
  55. package/types/config.d.ts +22 -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.2.5
4
+ * Version: v4.2.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -259,6 +259,28 @@ class Config {
259
259
  : null);
260
260
  /**
261
261
  * Shadow root if Jodit was created in it
262
+ *
263
+ * ```html
264
+ * <div id="editor"></div>
265
+ * ```
266
+ *
267
+ * ```js
268
+ * const app = document.getElementById('editor');
269
+ * app.attachShadow({ mode: 'open' });
270
+ * const root = app.shadowRoot;
271
+ *
272
+ * root.innerHTML = `
273
+ * <link rel="stylesheet" href="./build/jodit.css"/>
274
+ * <h1>Jodit example in Shadow DOM</h1>
275
+ * <div id="edit"></div>
276
+ * `;
277
+ *
278
+ * const editor = Jodit.make(root.getElementById('edit'), {
279
+ * globalFullSize: false,
280
+ * shadowRoot: root
281
+ * });
282
+ * editor.value = '<p>start</p>';
283
+ * ```
262
284
  */
263
285
  this.shadowRoot = null;
264
286
  /**
@@ -1009,6 +1031,7 @@ Config.prototype.controls = {};
1009
1031
  /* harmony export */ });
1010
1032
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
1011
1033
  /* harmony import */ var jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59146);
1034
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99951);
1012
1035
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(69052);
1013
1036
  /* harmony import */ var jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2461);
1014
1037
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25376);
@@ -1017,7 +1040,7 @@ Config.prototype.controls = {};
1017
1040
  /* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35642);
1018
1041
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28712);
1019
1042
  /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__);
1020
- /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(21567);
1043
+ /* harmony import */ var jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(21567);
1021
1044
  /*!
1022
1045
  * Jodit Editor (https://xdsoft.net/jodit/)
1023
1046
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -1033,6 +1056,7 @@ Config.prototype.controls = {};
1033
1056
 
1034
1057
 
1035
1058
 
1059
+
1036
1060
  class Async {
1037
1061
  constructor() {
1038
1062
  var _a, _b, _c, _d, _e;
@@ -1151,6 +1175,11 @@ class Async {
1151
1175
  ? (...args) => {
1152
1176
  const promise = this.promise(res => {
1153
1177
  promises.push(res);
1178
+ }).catch((e) => {
1179
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1180
+ return null;
1181
+ }
1182
+ throw e;
1154
1183
  });
1155
1184
  onFire(...args);
1156
1185
  return promise;
@@ -1222,7 +1251,7 @@ class Async {
1222
1251
  promise(executor) {
1223
1252
  let rejectCallback = () => { };
1224
1253
  const promise = new Promise((resolve, reject) => {
1225
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1254
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1226
1255
  this.promisesRejections.add(rejectCallback);
1227
1256
  executor(resolve, reject);
1228
1257
  });
@@ -1707,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
1707
1736
  * Released under MIT see LICENSE.txt in the project root for license information.
1708
1737
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1709
1738
  */
1710
- const APP_VERSION = "4.2.5";
1739
+ const APP_VERSION = "4.2.6";
1711
1740
  // prettier-ignore
1712
1741
  const ES = "es2015";
1713
1742
  const IS_ES_MODERN = true;
@@ -19104,6 +19133,9 @@ let DataProvider = class DataProvider {
19104
19133
  this.o.permissions.data.source = source;
19105
19134
  if (this.o.permissions.url) {
19106
19135
  return this.get('permissions').then(resp => {
19136
+ if (this.parent.isInDestruct) {
19137
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19138
+ }
19107
19139
  let process = this.o.permissions.process;
19108
19140
  if (!process) {
19109
19141
  process = this.o.ajax.process;
@@ -19736,7 +19768,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19736
19768
  });
19737
19769
  })
19738
19770
  .catch((e) => {
19739
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19771
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19740
19772
  throw e;
19741
19773
  }
19742
19774
  });
@@ -31210,7 +31242,11 @@ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
31210
31242
  this.dialog.open().setModal(true).setPosition();
31211
31243
  this.async
31212
31244
  .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31213
- .catch((e) => this.dialog.message.error(e.message))
31245
+ .catch((e) => {
31246
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31247
+ this.dialog.message.error(e.message);
31248
+ }
31249
+ })
31214
31250
  .finally(() => this.__unlock());
31215
31251
  return false;
31216
31252
  }