jodit 4.18.1 → 4.18.2

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 (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +19 -8
  5. package/es2015/jodit.min.js +3 -3
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +3 -3
  13. package/es2018/jodit.min.js +3 -3
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +3 -3
  18. package/es2021/jodit.js +19 -8
  19. package/es2021/jodit.min.js +3 -3
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +24 -24
  28. package/es2021.en/jodit.js +19 -8
  29. package/es2021.en/jodit.min.js +3 -3
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +21 -8
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  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/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/plugins/clean-html/clean-html.d.ts +2 -1
  52. package/esm/plugins/clean-html/clean-html.js +24 -7
  53. package/package.json +1 -1
  54. package/types/plugins/clean-html/clean-html.d.ts +2 -1
@@ -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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.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.18.1
4
+ * Version: v4.18.2
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.18.1
4
+ * Version: v4.18.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.18.1";
6
+ export const APP_VERSION = "4.18.2";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -14,8 +14,9 @@ import "./config";
14
14
  export declare class cleanHtml extends Plugin {
15
15
  /** @override */
16
16
  buttons: Plugin['buttons'];
17
+ constructor(jodit: IJodit);
17
18
  /** @override */
18
- protected afterInit(jodit: IJodit): void;
19
+ protected afterInit(): void;
19
20
  private get isEditMode();
20
21
  /**
21
22
  * Clean HTML code on every change
@@ -13,7 +13,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
13
13
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
- import { hook, watch } from "../../core/decorators/index.js";
16
+ import { autobind, hook, watch } from "../../core/decorators/index.js";
17
17
  import { Dom } from "../../core/dom/dom.js";
18
18
  import { LazyWalker } from "../../core/dom/lazy-walker.js";
19
19
  import { pluginSystem } from "../../core/global.js";
@@ -26,8 +26,8 @@ import { getHash, removeFormatForCollapsedSelection, removeFormatForSelection, v
26
26
  */
27
27
  const TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
28
28
  export class cleanHtml extends Plugin {
29
- constructor() {
30
- super(...arguments);
29
+ constructor(jodit) {
30
+ super(jodit);
31
31
  /** @override */
32
32
  this.buttons = [
33
33
  {
@@ -39,9 +39,22 @@ export class cleanHtml extends Plugin {
39
39
  this.walker = new LazyWalker(this.j.async, {
40
40
  timeout: this.j.o.cleanHTML.timeout
41
41
  });
42
+ // `@watch` binds once the plugin is ready, which is after the initial
43
+ // value has already gone into the editor. The handlers that keep
44
+ // markup out of the live tree have to be there from the start, or
45
+ // event handlers in a textarea's content run before anything
46
+ // sanitises them.
47
+ jodit.e
48
+ .on('safeHTML', this.onSafeHTML)
49
+ .on('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue)
50
+ .on('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
42
51
  }
43
52
  /** @override */
44
- afterInit(jodit) { }
53
+ afterInit() {
54
+ // The walker's own `:afterInit` watcher is bound on that very event,
55
+ // so without this the first pass waited for the first key or click
56
+ this.onChangeCleanHTML();
57
+ }
45
58
  get isEditMode() {
46
59
  return !(this.j.isInDestruct ||
47
60
  !this.j.isEditorMode() ||
@@ -199,6 +212,10 @@ export class cleanHtml extends Plugin {
199
212
  }
200
213
  /** @override */
201
214
  beforeDestruct() {
215
+ this.j.e
216
+ .off('safeHTML', this.onSafeHTML)
217
+ .off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue)
218
+ .off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
202
219
  this.walker.destruct();
203
220
  }
204
221
  }
@@ -212,15 +229,15 @@ __decorate([
212
229
  watch(':beforeCommand')
213
230
  ], cleanHtml.prototype, "beforeCommand", null);
214
231
  __decorate([
215
- watch(':afterSetNativeEditorValue')
232
+ autobind
216
233
  ], cleanHtml.prototype, "onAfterSetNativeEditorValue", null);
217
234
  __decorate([
218
- watch(':beforeSetNativeEditorValue')
235
+ autobind
219
236
  ], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
220
237
  __decorate([
221
238
  watch(':afterGetValueFromEditor')
222
239
  ], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
223
240
  __decorate([
224
- watch(':safeHTML')
241
+ autobind
225
242
  ], cleanHtml.prototype, "onSafeHTML", null);
226
243
  pluginSystem.add('cleanHtml', cleanHtml);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.18.1",
3
+ "version": "4.18.2",
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",
@@ -14,8 +14,9 @@ import "./config";
14
14
  export declare class cleanHtml extends Plugin {
15
15
  /** @override */
16
16
  buttons: Plugin['buttons'];
17
+ constructor(jodit: IJodit);
17
18
  /** @override */
18
- protected afterInit(jodit: IJodit): void;
19
+ protected afterInit(): void;
19
20
  private get isEditMode();
20
21
  /**
21
22
  * Clean HTML code on every change