jodit 4.15.14 → 4.15.16
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 +14 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +25 -10
- package/es2015/jodit.min.js +4 -4
- 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 +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +4 -4
- package/es2018/jodit.min.js +4 -4
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +4 -4
- package/es2021/jodit.js +25 -10
- package/es2021/jodit.min.js +4 -4
- 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 +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +4 -4
- package/es2021.en/jodit.js +25 -10
- package/es2021.en/jodit.min.js +4 -4
- 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 +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +25 -10
- 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 +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +4 -2
- package/esm/core/constants.js +1 -1
- package/esm/plugins/clean-html/clean-html.js +4 -1
- package/esm/plugins/clean-html/config.d.ts +4 -2
- package/esm/plugins/color/config.js +16 -6
- package/esm/plugins/paste/helpers.js +6 -1
- package/esm/plugins/placeholder/placeholder.js +2 -1
- package/package.json +1 -1
- package/types/config.d.ts +4 -2
- package/types/plugins/clean-html/config.d.ts +4 -2
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/config.d.ts
CHANGED
|
@@ -1028,8 +1028,10 @@ interface Config {
|
|
|
1028
1028
|
removeEmptyElements: boolean;
|
|
1029
1029
|
/**
|
|
1030
1030
|
* Return an empty string from `editor.value` (and the synced source
|
|
1031
|
-
* element) when the editor holds only a single empty block
|
|
1032
|
-
*
|
|
1031
|
+
* element) when the editor holds only a single empty text block
|
|
1032
|
+
* (`p`, `div`, a heading, `blockquote` or `pre`) — e.g.
|
|
1033
|
+
* `<p><br></p>` left after the user deletes all the content. A lone
|
|
1034
|
+
* video, iframe or other element that is content in itself is kept.
|
|
1033
1035
|
* `contenteditable` keeps that caret container in the DOM, so by
|
|
1034
1036
|
* default the value getter returns it as-is; enable this to collapse
|
|
1035
1037
|
* it to `''` for form submission.
|
package/esm/core/constants.js
CHANGED
|
@@ -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.15.
|
|
6
|
+
export const APP_VERSION = "4.15.16";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -112,7 +112,10 @@ export class cleanHtml extends Plugin {
|
|
|
112
112
|
if (!this.j.o.cleanHTML.collapseEmptyValueToEmptyString) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
// Only a text block can be an empty caret container; a lone video,
|
|
116
|
+
// iframe or icon has no children but is content in itself
|
|
117
|
+
const lone = /^<([a-z][a-z0-9]*)\b[^>]*>(?:<br\/?>)?<\/\1>$/i.exec(data.value.trim());
|
|
118
|
+
if (lone && /^(p|div|h[1-6]|blockquote|pre)$/i.test(lone[1])) {
|
|
116
119
|
data.value = '';
|
|
117
120
|
}
|
|
118
121
|
}
|
|
@@ -26,8 +26,10 @@ declare module 'jodit/config' {
|
|
|
26
26
|
removeEmptyElements: boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Return an empty string from `editor.value` (and the synced source
|
|
29
|
-
* element) when the editor holds only a single empty block
|
|
30
|
-
*
|
|
29
|
+
* element) when the editor holds only a single empty text block
|
|
30
|
+
* (`p`, `div`, a heading, `blockquote` or `pre`) — e.g.
|
|
31
|
+
* `<p><br></p>` left after the user deletes all the content. A lone
|
|
32
|
+
* video, iframe or other element that is content in itself is kept.
|
|
31
33
|
* `contenteditable` keeps that caret container in the DOM, so by
|
|
32
34
|
* default the value getter returns it as-is; enable this to collapse
|
|
33
35
|
* it to `''` for form submission.
|
|
@@ -4,12 +4,22 @@
|
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import { Dom } from "../../core/dom/dom.js";
|
|
7
|
-
import { css, dataBind, isJoditObject } from "../../core/helpers/index.js";
|
|
7
|
+
import { attr, css, dataBind, isJoditObject } from "../../core/helpers/index.js";
|
|
8
8
|
import { Icon } from "../../core/ui/icon.js";
|
|
9
9
|
import { Config } from "../../config.js";
|
|
10
10
|
import { ColorPickerWidget, TabsWidget } from "../../modules/widget/index.js";
|
|
11
11
|
import brushIcon from "./brush.svg.js";
|
|
12
12
|
Icon.set('brush', brushIcon);
|
|
13
|
+
/**
|
|
14
|
+
* Set a color style; an empty value removes it, and with it the `style`
|
|
15
|
+
* attribute once nothing else is left in it
|
|
16
|
+
*/
|
|
17
|
+
function setColorStyle(elm, key, value) {
|
|
18
|
+
css(elm, key, value);
|
|
19
|
+
if (!attr(elm, 'style')) {
|
|
20
|
+
attr(elm, 'style', null);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
Config.prototype.controls.brushCell = {
|
|
14
24
|
isVisible: (editor) => {
|
|
15
25
|
return !editor.o.disablePlugins.includes('color');
|
|
@@ -25,7 +35,7 @@ Config.prototype.controls.brushCell = {
|
|
|
25
35
|
}
|
|
26
36
|
const makeColorPicker = (key) => ColorPickerWidget(editor, (value) => {
|
|
27
37
|
selected.forEach(cell => {
|
|
28
|
-
|
|
38
|
+
setColorStyle(cell, key, value);
|
|
29
39
|
});
|
|
30
40
|
editor.lock();
|
|
31
41
|
editor.synchronizeValues();
|
|
@@ -105,7 +115,7 @@ Config.prototype.controls.brush = {
|
|
|
105
115
|
editor.execCommand('background', false, value);
|
|
106
116
|
}
|
|
107
117
|
else {
|
|
108
|
-
|
|
118
|
+
setColorStyle(currentElement, 'backgroundColor', value);
|
|
109
119
|
}
|
|
110
120
|
dataBind(button, 'color', value);
|
|
111
121
|
dataBind(button, 'color-mode', 'background');
|
|
@@ -116,7 +126,7 @@ Config.prototype.controls.brush = {
|
|
|
116
126
|
editor.execCommand('forecolor', false, value);
|
|
117
127
|
}
|
|
118
128
|
else {
|
|
119
|
-
|
|
129
|
+
setColorStyle(currentElement, 'color', value);
|
|
120
130
|
}
|
|
121
131
|
dataBind(button, 'color', value);
|
|
122
132
|
dataBind(button, 'color-mode', 'color');
|
|
@@ -148,10 +158,10 @@ Config.prototype.controls.brush = {
|
|
|
148
158
|
Dom.isElement(current)) {
|
|
149
159
|
switch (mode) {
|
|
150
160
|
case 'color':
|
|
151
|
-
|
|
161
|
+
setColorStyle(current, 'color', color);
|
|
152
162
|
break;
|
|
153
163
|
case 'background':
|
|
154
|
-
|
|
164
|
+
setColorStyle(current, 'backgroundColor', color);
|
|
155
165
|
break;
|
|
156
166
|
}
|
|
157
167
|
}
|
|
@@ -85,10 +85,15 @@ export function askInsertTypeDialog(jodit, msg, title, callback, buttonList) {
|
|
|
85
85
|
dialog.close();
|
|
86
86
|
callback(value);
|
|
87
87
|
}));
|
|
88
|
-
dialog.e
|
|
88
|
+
dialog.e
|
|
89
|
+
.on(dialog, 'beforeClose', () => {
|
|
90
|
+
jodit.e.fire('beforeClosePasteDialog', dialog);
|
|
91
|
+
})
|
|
92
|
+
.one(dialog, 'afterClose', () => {
|
|
89
93
|
if (!jodit.s.isFocused()) {
|
|
90
94
|
jodit.s.focus();
|
|
91
95
|
}
|
|
96
|
+
jodit.e.fire('afterClosePasteDialog', dialog);
|
|
92
97
|
});
|
|
93
98
|
const cancel = Button(jodit, {
|
|
94
99
|
text: 'Cancel',
|
|
@@ -68,7 +68,8 @@ export class placeholder extends Plugin {
|
|
|
68
68
|
.off('.placeholder')
|
|
69
69
|
.on('changePlace.placeholder', this.addNativeListeners)
|
|
70
70
|
.on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' +
|
|
71
|
-
'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder'
|
|
71
|
+
'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' +
|
|
72
|
+
'internalChange.placeholder', this.toggle)
|
|
72
73
|
.on(window, 'load', this.toggle);
|
|
73
74
|
this.addNativeListeners();
|
|
74
75
|
this.toggle();
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -1028,8 +1028,10 @@ interface Config {
|
|
|
1028
1028
|
removeEmptyElements: boolean;
|
|
1029
1029
|
/**
|
|
1030
1030
|
* Return an empty string from `editor.value` (and the synced source
|
|
1031
|
-
* element) when the editor holds only a single empty block
|
|
1032
|
-
*
|
|
1031
|
+
* element) when the editor holds only a single empty text block
|
|
1032
|
+
* (`p`, `div`, a heading, `blockquote` or `pre`) — e.g.
|
|
1033
|
+
* `<p><br></p>` left after the user deletes all the content. A lone
|
|
1034
|
+
* video, iframe or other element that is content in itself is kept.
|
|
1033
1035
|
* `contenteditable` keeps that caret container in the DOM, so by
|
|
1034
1036
|
* default the value getter returns it as-is; enable this to collapse
|
|
1035
1037
|
* it to `''` for form submission.
|
|
@@ -26,8 +26,10 @@ declare module 'jodit/config' {
|
|
|
26
26
|
removeEmptyElements: boolean;
|
|
27
27
|
/**
|
|
28
28
|
* Return an empty string from `editor.value` (and the synced source
|
|
29
|
-
* element) when the editor holds only a single empty block
|
|
30
|
-
*
|
|
29
|
+
* element) when the editor holds only a single empty text block
|
|
30
|
+
* (`p`, `div`, a heading, `blockquote` or `pre`) — e.g.
|
|
31
|
+
* `<p><br></p>` left after the user deletes all the content. A lone
|
|
32
|
+
* video, iframe or other element that is content in itself is kept.
|
|
31
33
|
* `contenteditable` keeps that caret container in the DOM, so by
|
|
32
34
|
* default the value getter returns it as-is; enable this to collapse
|
|
33
35
|
* it to `''` for form submission.
|