jodit 4.10.2 → 4.11.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 (87) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +121 -121
  4. package/es2015/jodit.js +36183 -35886
  5. package/es2015/jodit.min.js +121 -121
  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 +724 -724
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  12. package/es2018/jodit.fat.min.js +121 -121
  13. package/es2018/jodit.min.js +121 -121
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +135 -135
  18. package/es2021/jodit.js +35482 -35186
  19. package/es2021/jodit.min.js +135 -135
  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 +681 -681
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +151 -151
  28. package/es2021.en/jodit.js +34392 -34096
  29. package/es2021.en/jodit.min.js +135 -135
  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 +306 -306
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +44054 -43700
  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 +839 -839
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  47. package/es5/polyfills.fat.min.js +2 -2
  48. package/es5/polyfills.js +4211 -4211
  49. package/es5/polyfills.min.js +2 -2
  50. package/esm/config.d.ts +85 -0
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/dom/dom.d.ts +1 -0
  53. package/esm/core/helpers/html/safe-html.d.ts +3 -2
  54. package/esm/core/helpers/html/safe-html.js +42 -3
  55. package/esm/plugins/clean-html/clean-html.js +4 -0
  56. package/esm/plugins/clean-html/config.d.ts +85 -0
  57. package/esm/plugins/clean-html/config.js +7 -1
  58. package/esm/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.d.ts +14 -0
  59. package/esm/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.js +37 -0
  60. package/esm/plugins/clean-html/helpers/visitor/filters/index.d.ts +4 -0
  61. package/esm/plugins/clean-html/helpers/visitor/filters/index.js +4 -0
  62. package/esm/plugins/clean-html/helpers/visitor/filters/safe-links-target.d.ts +14 -0
  63. package/esm/plugins/clean-html/helpers/visitor/filters/safe-links-target.js +38 -0
  64. package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.d.ts +14 -0
  65. package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +24 -0
  66. package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-attributes.js +10 -5
  67. package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-styles.d.ts +14 -0
  68. package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-styles.js +70 -0
  69. package/esm/plugins/drag-and-drop/drag-and-drop.js +1 -1
  70. package/esm/plugins/enter/helpers/insert-paragraph.js +2 -1
  71. package/esm/plugins/file/file.js +3 -2
  72. package/esm/plugins/iframe/iframe.js +8 -6
  73. package/esm/plugins/image/image.js +3 -2
  74. package/esm/plugins/image-properties/writers/link.js +6 -0
  75. package/esm/plugins/link/link.js +15 -3
  76. package/esm/plugins/resizer/resizer.js +2 -2
  77. package/esm/plugins/source/editor/engines/area.js +3 -7
  78. package/package.json +1 -1
  79. package/types/config.d.ts +85 -0
  80. package/types/core/dom/dom.d.ts +1 -0
  81. package/types/core/helpers/html/safe-html.d.ts +3 -2
  82. package/types/plugins/clean-html/config.d.ts +85 -0
  83. package/types/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.d.ts +14 -0
  84. package/types/plugins/clean-html/helpers/visitor/filters/index.d.ts +4 -0
  85. package/types/plugins/clean-html/helpers/visitor/filters/safe-links-target.d.ts +14 -0
  86. package/types/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.d.ts +14 -0
  87. package/types/plugins/clean-html/helpers/visitor/filters/sanitize-styles.d.ts +14 -0
@@ -41,13 +41,98 @@ declare module 'jodit/config' {
41
41
  */
42
42
  useIframeSandbox: boolean;
43
43
  /**
44
+ * @deprecated Use `removeEventAttributes` instead
44
45
  * Remove onError attributes
45
46
  */
46
47
  removeOnError: boolean;
48
+ /**
49
+ * Remove all `on*` event handler attributes (onerror, onclick, onload, onmouseover, etc.)
50
+ * When enabled, this replaces the legacy `removeOnError` behavior with comprehensive protection.
51
+ *
52
+ * ```javascript
53
+ * Jodit.make('#editor', {
54
+ * cleanHTML: {
55
+ * removeEventAttributes: true
56
+ * }
57
+ * });
58
+ * ```
59
+ */
60
+ removeEventAttributes: boolean;
47
61
  /**
48
62
  * Safe href="javascript:" links
49
63
  */
50
64
  safeJavaScriptLink: boolean;
65
+ /**
66
+ * Automatically add `rel="noopener noreferrer"` to links with `target="_blank"`
67
+ *
68
+ * ```javascript
69
+ * Jodit.make('#editor', {
70
+ * cleanHTML: {
71
+ * safeLinksTarget: true
72
+ * }
73
+ * });
74
+ * ```
75
+ */
76
+ safeLinksTarget: boolean;
77
+ /**
78
+ * Whitelist of allowed CSS properties inside `style` attributes.
79
+ * If set, all CSS properties not in the list will be removed.
80
+ *
81
+ * ```javascript
82
+ * Jodit.make('#editor', {
83
+ * cleanHTML: {
84
+ * allowedStyles: {
85
+ * '*': ['color', 'background-color', 'font-size', 'text-align'],
86
+ * img: ['width', 'height']
87
+ * }
88
+ * }
89
+ * });
90
+ * ```
91
+ */
92
+ allowedStyles: false | IDictionary<string[]>;
93
+ /**
94
+ * Custom sanitizer function. Called after Jodit's built-in sanitization.
95
+ * Use this to integrate DOMPurify or other external sanitizers.
96
+ *
97
+ * ```javascript
98
+ * import DOMPurify from 'dompurify';
99
+ *
100
+ * Jodit.make('#editor', {
101
+ * cleanHTML: {
102
+ * sanitizer: (html) => DOMPurify.sanitize(html)
103
+ * }
104
+ * });
105
+ * ```
106
+ */
107
+ sanitizer: false | ((value: string) => string);
108
+ /**
109
+ * Automatically add `sandbox=""` attribute to all `<iframe>` elements in editor content.
110
+ * Prevents embedded content from running scripts or accessing the parent page.
111
+ *
112
+ * ```javascript
113
+ * Jodit.make('#editor', {
114
+ * cleanHTML: {
115
+ * sandboxIframesInContent: true
116
+ * }
117
+ * });
118
+ * ```
119
+ */
120
+ sandboxIframesInContent: boolean;
121
+ /**
122
+ * Convert unsafe embed elements to sandboxed `<iframe>`.
123
+ * - `['object', 'embed']` — default
124
+ * - `false` — disabled
125
+ * - `string[]` — custom list of tag names to convert
126
+ *
127
+ * ```javascript
128
+ * Jodit.make('#editor', {
129
+ * cleanHTML: {
130
+ * convertUnsafeEmbeds: Jodit.atom(['object', 'embed', 'applet'])
131
+ * }
132
+ * });
133
+ * ```
134
+ */
135
+ convertUnsafeEmbeds: false | string[];
51
136
  /**
52
137
  * The allowTags option defines which elements will remain in the
53
138
  * edited text when the editor saves. You can use this limit the returned HTML.
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module plugins/clean-html
8
+ */
9
+ import type { IJodit } from "../../../../../types/index";
10
+ /**
11
+ * Convert `<object>` and `<embed>` elements to safer `<iframe>` elements.
12
+ * @private
13
+ */
14
+ export declare function convertUnsafeEmbeds(jodit: IJodit, nodeElm: Node, hadEffect: boolean): boolean;
@@ -10,9 +10,13 @@
10
10
  * @private
11
11
  */
12
12
  export * from "./allow-attributes";
13
+ export * from "./convert-unsafe-embeds";
13
14
  export * from "./fill-empty-paragraph";
14
15
  export * from "./remove-empty-text-node";
15
16
  export * from "./remove-inv-text-nodes";
16
17
  export * from "./replace-old-tags";
18
+ export * from "./safe-links-target";
19
+ export * from "./sandbox-iframes-in-content";
17
20
  export * from "./sanitize-attributes";
21
+ export * from "./sanitize-styles";
18
22
  export * from "./try-remove-node";
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module plugins/clean-html
8
+ */
9
+ import type { IJodit } from "../../../../../types/index";
10
+ /**
11
+ * Automatically add `rel="noopener noreferrer"` to links with `target="_blank"`
12
+ * @private
13
+ */
14
+ export declare function safeLinksTarget(jodit: IJodit, nodeElm: Node, hadEffect: boolean): boolean;
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module plugins/clean-html
8
+ */
9
+ import type { IJodit } from "../../../../../types/index";
10
+ /**
11
+ * Add `sandbox=""` attribute to all `<iframe>` elements in the editor content
12
+ * @private
13
+ */
14
+ export declare function sandboxIframesInContent(jodit: IJodit, nodeElm: Node, hadEffect: boolean): boolean;
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module plugins/clean-html
8
+ */
9
+ import type { IJodit } from "../../../../../types/index";
10
+ /**
11
+ * Filter CSS properties in style attributes based on allowedStyles whitelist
12
+ * @private
13
+ */
14
+ export declare function sanitizeStyles(jodit: IJodit, nodeElm: Node, hadEffect: boolean): boolean;