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
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
package/esm/config.d.ts CHANGED
@@ -104,6 +104,28 @@ declare class Config implements IViewOptions {
104
104
  ownerWindow: Window;
105
105
  /**
106
106
  * Shadow root if Jodit was created in it
107
+ *
108
+ * ```html
109
+ * <div id="editor"></div>
110
+ * ```
111
+ *
112
+ * ```js
113
+ * const app = document.getElementById('editor');
114
+ * app.attachShadow({ mode: 'open' });
115
+ * const root = app.shadowRoot;
116
+ *
117
+ * root.innerHTML = `
118
+ * <link rel="stylesheet" href="./build/jodit.css"/>
119
+ * <h1>Jodit example in Shadow DOM</h1>
120
+ * <div id="edit"></div>
121
+ * `;
122
+ *
123
+ * const editor = Jodit.make(root.getElementById('edit'), {
124
+ * globalFullSize: false,
125
+ * shadowRoot: root
126
+ * });
127
+ * editor.value = '<p>start</p>';
128
+ * ```
107
129
  */
108
130
  shadowRoot: Nullable<ShadowRoot>;
109
131
  /**
package/esm/config.js CHANGED
@@ -139,6 +139,28 @@ class Config {
139
139
  : null);
140
140
  /**
141
141
  * Shadow root if Jodit was created in it
142
+ *
143
+ * ```html
144
+ * <div id="editor"></div>
145
+ * ```
146
+ *
147
+ * ```js
148
+ * const app = document.getElementById('editor');
149
+ * app.attachShadow({ mode: 'open' });
150
+ * const root = app.shadowRoot;
151
+ *
152
+ * root.innerHTML = `
153
+ * <link rel="stylesheet" href="./build/jodit.css"/>
154
+ * <h1>Jodit example in Shadow DOM</h1>
155
+ * <div id="edit"></div>
156
+ * `;
157
+ *
158
+ * const editor = Jodit.make(root.getElementById('edit'), {
159
+ * globalFullSize: false,
160
+ * shadowRoot: root
161
+ * });
162
+ * editor.value = '<p>start</p>';
163
+ * ```
142
164
  */
143
165
  this.shadowRoot = null;
144
166
  /**
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { IS_ES_NEXT } from "jodit/esm/core/constants.js";
7
7
  import { clearTimeout, setTimeout } from "jodit/esm/core/helpers/async/index.js";
8
+ import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error.js";
8
9
  import { isFunction } from "jodit/esm/core/helpers/checker/is-function.js";
9
10
  import { isNumber } from "jodit/esm/core/helpers/checker/is-number.js";
10
11
  import { isPlainObject } from "jodit/esm/core/helpers/checker/is-plain-object.js";
@@ -132,6 +133,11 @@ export class Async {
132
133
  ? (...args) => {
133
134
  const promise = this.promise(res => {
134
135
  promises.push(res);
136
+ }).catch((e) => {
137
+ if (isAbortError(e)) {
138
+ return null;
139
+ }
140
+ throw e;
135
141
  });
136
142
  onFire(...args);
137
143
  return promise;
@@ -203,7 +209,7 @@ export class Async {
203
209
  promise(executor) {
204
210
  let rejectCallback = () => { };
205
211
  const promise = new Promise((resolve, reject) => {
206
- rejectCallback = () => reject(abort());
212
+ rejectCallback = () => reject(abort('Abort async'));
207
213
  this.promisesRejections.add(rejectCallback);
208
214
  executor(resolve, reject);
209
215
  });
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.2.5";
6
+ export const APP_VERSION = "4.2.6";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  import { IS_PROD } from "jodit/esm/core/constants.js";
17
17
  import { autobind } from "jodit/esm/core/decorators/index.js";
18
- import { ConfigProto, error, isFunction, normalizeRelativePath, set } from "jodit/esm/core/helpers/index.js";
18
+ import { abort, ConfigProto, error, isFunction, normalizeRelativePath, set } from "jodit/esm/core/helpers/index.js";
19
19
  import { Ajax } from "jodit/esm/core/request/index.js";
20
20
  import { FileBrowserItem } from "jodit/esm/modules/file-browser/builders/item.js";
21
21
  export const DEFAULT_SOURCE_NAME = 'default';
@@ -96,6 +96,9 @@ let DataProvider = class DataProvider {
96
96
  this.o.permissions.data.source = source;
97
97
  if (this.o.permissions.url) {
98
98
  return this.get('permissions').then(resp => {
99
+ if (this.parent.isInDestruct) {
100
+ throw abort();
101
+ }
99
102
  let process = this.o.permissions.process;
100
103
  if (!process) {
101
104
  process = this.o.ajax.process;
@@ -163,7 +163,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
163
163
  });
164
164
  })
165
165
  .catch((e) => {
166
- if (!IS_PROD) {
166
+ if (!isAbortError(e) && !IS_PROD) {
167
167
  throw e;
168
168
  }
169
169
  });
@@ -16,7 +16,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
16
16
  import { cache, cached, watch } from "jodit/esm/core/decorators/index.js";
17
17
  import { Dom } from "jodit/esm/core/dom/dom.js";
18
18
  import { pluginSystem } from "jodit/esm/core/global.js";
19
- import { isNumeric, markOwner } from "jodit/esm/core/helpers/index.js";
19
+ import { isAbortError, isNumeric, markOwner } from "jodit/esm/core/helpers/index.js";
20
20
  import { Plugin } from "jodit/esm/core/plugin/plugin.js";
21
21
  import { Button } from "jodit/esm/core/ui/button/index.js";
22
22
  import "./config";
@@ -146,7 +146,11 @@ export class imageProperties extends Plugin {
146
146
  this.dialog.open().setModal(true).setPosition();
147
147
  this.async
148
148
  .promise((resolve, reject) => readValuesFromImage(this.j, this.state).then(resolve, reject))
149
- .catch((e) => this.dialog.message.error(e.message))
149
+ .catch((e) => {
150
+ if (!isAbortError(e)) {
151
+ this.dialog.message.error(e.message);
152
+ }
153
+ })
150
154
  .finally(() => this.__unlock());
151
155
  return false;
152
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
package/types/config.d.ts CHANGED
@@ -104,6 +104,28 @@ declare class Config implements IViewOptions {
104
104
  ownerWindow: Window;
105
105
  /**
106
106
  * Shadow root if Jodit was created in it
107
+ *
108
+ * ```html
109
+ * <div id="editor"></div>
110
+ * ```
111
+ *
112
+ * ```js
113
+ * const app = document.getElementById('editor');
114
+ * app.attachShadow({ mode: 'open' });
115
+ * const root = app.shadowRoot;
116
+ *
117
+ * root.innerHTML = `
118
+ * <link rel="stylesheet" href="./build/jodit.css"/>
119
+ * <h1>Jodit example in Shadow DOM</h1>
120
+ * <div id="edit"></div>
121
+ * `;
122
+ *
123
+ * const editor = Jodit.make(root.getElementById('edit'), {
124
+ * globalFullSize: false,
125
+ * shadowRoot: root
126
+ * });
127
+ * editor.value = '<p>start</p>';
128
+ * ```
107
129
  */
108
130
  shadowRoot: Nullable<ShadowRoot>;
109
131
  /**