jodit 4.2.5 → 4.2.7

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 (56) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.js +2 -2
  3. package/es2015/jodit.js +43 -7
  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 +43 -7
  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 +43 -7
  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 +43 -7
  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 +43 -7
  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/core/ui/popup/popup.js +1 -1
  52. package/esm/modules/file-browser/data-provider.js +4 -1
  53. package/esm/modules/file-browser/file-browser.js +1 -1
  54. package/esm/plugins/image-properties/image-properties.js +6 -2
  55. package/package.json +1 -1
  56. package/types/config.d.ts +22 -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.2.5
4
+ * Version: v4.2.7
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
  this.timers = new Map();
@@ -1152,6 +1176,11 @@ class Async {
1152
1176
  ? (...args) => {
1153
1177
  const promise = this.promise(res => {
1154
1178
  promises.push(res);
1179
+ }).catch((e) => {
1180
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .isAbortError */ .z)(e)) {
1181
+ return null;
1182
+ }
1183
+ throw e;
1155
1184
  });
1156
1185
  onFire(...args);
1157
1186
  return promise;
@@ -1223,7 +1252,7 @@ class Async {
1223
1252
  promise(executor) {
1224
1253
  let rejectCallback = () => { };
1225
1254
  const promise = new Promise((resolve, reject) => {
1226
- rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_9__/* .abort */ .h)());
1255
+ rejectCallback = () => reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)('Abort async'));
1227
1256
  this.promisesRejections.add(rejectCallback);
1228
1257
  executor(resolve, reject);
1229
1258
  });
@@ -1708,7 +1737,7 @@ __webpack_require__.r(__webpack_exports__);
1708
1737
  * Released under MIT see LICENSE.txt in the project root for license information.
1709
1738
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1710
1739
  */
1711
- const APP_VERSION = "4.2.5";
1740
+ const APP_VERSION = "4.2.7";
1712
1741
  // prettier-ignore
1713
1742
  const ES = "es2021";
1714
1743
  const IS_ES_MODERN = true;
@@ -15397,7 +15426,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15397
15426
  }
15398
15427
  return strategy;
15399
15428
  };
15400
- // Try find match position inside Jodit.container
15429
+ // Try to find match position inside Jodit.container
15401
15430
  let strategy = getMatchStrategy((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.position)(this.j.container, this.j));
15402
15431
  // If not found or is not inside window view
15403
15432
  if (!strategy || !Popup.boxInView(getPointByStrategy(strategy), view)) {
@@ -19122,6 +19151,9 @@ let DataProvider = class DataProvider {
19122
19151
  this.o.permissions.data.source = source;
19123
19152
  if (this.o.permissions.url) {
19124
19153
  return this.get('permissions').then(resp => {
19154
+ if (this.parent.isInDestruct) {
19155
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19156
+ }
19125
19157
  let process = this.o.permissions.process;
19126
19158
  if (!process) {
19127
19159
  process = this.o.ajax.process;
@@ -19745,7 +19777,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19745
19777
  });
19746
19778
  })
19747
19779
  .catch((e) => {
19748
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19780
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19749
19781
  throw e;
19750
19782
  }
19751
19783
  });
@@ -31202,7 +31234,11 @@ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
31202
31234
  this.dialog.open().setModal(true).setPosition();
31203
31235
  this.async
31204
31236
  .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31205
- .catch((e) => this.dialog.message.error(e.message))
31237
+ .catch((e) => {
31238
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31239
+ this.dialog.message.error(e.message);
31240
+ }
31241
+ })
31206
31242
  .finally(() => this.__unlock());
31207
31243
  return false;
31208
31244
  }