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/es2018/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
  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.7";
1711
1740
  // prettier-ignore
1712
1741
  const ES = "es2018";
1713
1742
  const IS_ES_MODERN = true;
@@ -15446,7 +15475,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_7__/* .UI
15446
15475
  }
15447
15476
  return strategy;
15448
15477
  };
15449
- // Try find match position inside Jodit.container
15478
+ // Try to find match position inside Jodit.container
15450
15479
  let strategy = getMatchStrategy((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.position)(this.j.container, this.j));
15451
15480
  // If not found or is not inside window view
15452
15481
  if (!strategy || !Popup.boxInView(getPointByStrategy(strategy), view)) {
@@ -19175,6 +19204,9 @@ let DataProvider = class DataProvider {
19175
19204
  this.o.permissions.data.source = source;
19176
19205
  if (this.o.permissions.url) {
19177
19206
  return this.get('permissions').then(resp => {
19207
+ if (this.parent.isInDestruct) {
19208
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
19209
+ }
19178
19210
  let process = this.o.permissions.process;
19179
19211
  if (!process) {
19180
19212
  process = this.o.ajax.process;
@@ -19804,7 +19836,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19804
19836
  });
19805
19837
  })
19806
19838
  .catch((e) => {
19807
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19839
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(e) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
19808
19840
  throw e;
19809
19841
  }
19810
19842
  });
@@ -31301,7 +31333,11 @@ class imageProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
31301
31333
  this.dialog.open().setModal(true).setPosition();
31302
31334
  this.async
31303
31335
  .promise((resolve, reject) => (0,_readers__WEBPACK_IMPORTED_MODULE_10__/* .readValuesFromImage */ .U)(this.j, this.state).then(resolve, reject))
31304
- .catch((e) => this.dialog.message.error(e.message))
31336
+ .catch((e) => {
31337
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbortError)(e)) {
31338
+ this.dialog.message.error(e.message);
31339
+ }
31340
+ })
31305
31341
  .finally(() => this.__unlock());
31306
31342
  return false;
31307
31343
  }