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.
- package/CHANGELOG.md +28 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +121 -121
- package/es2015/jodit.js +36183 -35886
- package/es2015/jodit.min.js +121 -121
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +724 -724
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.fat.min.js +121 -121
- package/es2018/jodit.min.js +121 -121
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +135 -135
- package/es2021/jodit.js +35482 -35186
- package/es2021/jodit.min.js +135 -135
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +681 -681
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +151 -151
- package/es2021.en/jodit.js +34392 -34096
- package/es2021.en/jodit.min.js +135 -135
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +306 -306
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +44054 -43700
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +839 -839
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/polyfills.fat.min.js +2 -2
- package/es5/polyfills.js +4211 -4211
- package/es5/polyfills.min.js +2 -2
- package/esm/config.d.ts +85 -0
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.d.ts +1 -0
- package/esm/core/helpers/html/safe-html.d.ts +3 -2
- package/esm/core/helpers/html/safe-html.js +42 -3
- package/esm/plugins/clean-html/clean-html.js +4 -0
- package/esm/plugins/clean-html/config.d.ts +85 -0
- package/esm/plugins/clean-html/config.js +7 -1
- package/esm/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.js +37 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/index.d.ts +4 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/index.js +4 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/safe-links-target.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/safe-links-target.js +38 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +24 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-attributes.js +10 -5
- package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-styles.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-styles.js +70 -0
- package/esm/plugins/drag-and-drop/drag-and-drop.js +1 -1
- package/esm/plugins/enter/helpers/insert-paragraph.js +2 -1
- package/esm/plugins/file/file.js +3 -2
- package/esm/plugins/iframe/iframe.js +8 -6
- package/esm/plugins/image/image.js +3 -2
- package/esm/plugins/image-properties/writers/link.js +6 -0
- package/esm/plugins/link/link.js +15 -3
- package/esm/plugins/resizer/resizer.js +2 -2
- package/esm/plugins/source/editor/engines/area.js +3 -7
- package/package.json +1 -1
- package/types/config.d.ts +85 -0
- package/types/core/dom/dom.d.ts +1 -0
- package/types/core/helpers/html/safe-html.d.ts +3 -2
- package/types/plugins/clean-html/config.d.ts +85 -0
- package/types/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.d.ts +14 -0
- package/types/plugins/clean-html/helpers/visitor/filters/index.d.ts +4 -0
- package/types/plugins/clean-html/helpers/visitor/filters/safe-links-target.d.ts +14 -0
- package/types/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.d.ts +14 -0
- 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;
|