jodit 4.18.0 → 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.
- package/CHANGELOG.md +13 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +38 -10
- package/es2015/jodit.min.js +3 -3
- 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 +3 -3
- package/es2018/jodit.min.js +8 -8
- 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 +3 -3
- package/es2021/jodit.js +38 -10
- package/es2021/jodit.min.js +9 -9
- 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 +3 -3
- package/es2021.en/jodit.js +38 -10
- package/es2021.en/jodit.min.js +3 -3
- 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 +40 -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/core/constants.js +1 -1
- package/esm/plugins/clean-html/clean-html.d.ts +2 -1
- package/esm/plugins/clean-html/clean-html.js +24 -7
- package/esm/plugins/dtd/after-insert/remove-extra-br.js +6 -1
- package/esm/plugins/dtd/before-insert/check-block-nesting.js +16 -1
- package/esm/plugins/dtd/config.js +3 -0
- package/package.json +1 -1
- package/types/plugins/clean-html/clean-html.d.ts +2 -1
package/es5/jodit.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.
|
|
4
|
+
* Version: v4.18.2
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -2154,7 +2154,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2154
2154
|
* @packageDocumentation
|
|
2155
2155
|
* @module constants
|
|
2156
2156
|
*/
|
|
2157
|
-
var APP_VERSION = "4.18.
|
|
2157
|
+
var APP_VERSION = "4.18.2";
|
|
2158
2158
|
// prettier-ignore
|
|
2159
2159
|
var ES = "es5";
|
|
2160
2160
|
var IS_ES_MODERN = false;
|
|
@@ -34887,10 +34887,12 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
|
|
|
34887
34887
|
var cleanHtml = /*#__PURE__*/ function(Plugin) {
|
|
34888
34888
|
"use strict";
|
|
34889
34889
|
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(cleanHtml, Plugin);
|
|
34890
|
-
function cleanHtml() {
|
|
34890
|
+
function cleanHtml(jodit) {
|
|
34891
34891
|
(0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, cleanHtml);
|
|
34892
34892
|
var _this;
|
|
34893
|
-
_this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, cleanHtml,
|
|
34893
|
+
_this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, cleanHtml, [
|
|
34894
|
+
jodit
|
|
34895
|
+
]), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "buttons", [
|
|
34894
34896
|
{
|
|
34895
34897
|
name: 'eraser',
|
|
34896
34898
|
group: 'font-style'
|
|
@@ -34898,12 +34900,22 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
|
|
|
34898
34900
|
]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "currentSelectionNode", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "walker", new jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_11__.LazyWalker(_this.j.async, {
|
|
34899
34901
|
timeout: _this.j.o.cleanHTML.timeout
|
|
34900
34902
|
}));
|
|
34903
|
+
// `@watch` binds once the plugin is ready, which is after the initial
|
|
34904
|
+
// value has already gone into the editor. The handlers that keep
|
|
34905
|
+
// markup out of the live tree have to be there from the start, or
|
|
34906
|
+
// event handlers in a textarea's content run before anything
|
|
34907
|
+
// sanitises them.
|
|
34908
|
+
jodit.e.on('safeHTML', _this.onSafeHTML).on('beforeSetNativeEditorValue', _this.onBeforeSetNativeEditorValue).on('afterSetNativeEditorValue', _this.onAfterSetNativeEditorValue);
|
|
34901
34909
|
return _this;
|
|
34902
34910
|
}
|
|
34903
34911
|
;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(cleanHtml, [
|
|
34904
34912
|
{
|
|
34905
34913
|
key: "afterInit",
|
|
34906
|
-
value: /** @override */ function afterInit(
|
|
34914
|
+
value: /** @override */ function afterInit() {
|
|
34915
|
+
// The walker's own `:afterInit` watcher is bound on that very event,
|
|
34916
|
+
// so without this the first pass waited for the first key or click
|
|
34917
|
+
this.onChangeCleanHTML();
|
|
34918
|
+
}
|
|
34907
34919
|
},
|
|
34908
34920
|
{
|
|
34909
34921
|
key: "isEditMode",
|
|
@@ -35079,6 +35091,7 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
|
|
|
35079
35091
|
{
|
|
35080
35092
|
key: "beforeDestruct",
|
|
35081
35093
|
value: /** @override */ function beforeDestruct() {
|
|
35094
|
+
this.j.e.off('safeHTML', this.onSafeHTML).off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue).off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
|
|
35082
35095
|
this.walker.destruct();
|
|
35083
35096
|
}
|
|
35084
35097
|
}
|
|
@@ -35101,16 +35114,16 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
|
|
|
35101
35114
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':beforeCommand')
|
|
35102
35115
|
], cleanHtml.prototype, "beforeCommand", null);
|
|
35103
35116
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
35104
|
-
|
|
35117
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
|
|
35105
35118
|
], cleanHtml.prototype, "onAfterSetNativeEditorValue", null);
|
|
35106
35119
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
35107
|
-
|
|
35120
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
|
|
35108
35121
|
], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
|
|
35109
35122
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
35110
35123
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':afterGetValueFromEditor')
|
|
35111
35124
|
], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
|
|
35112
35125
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
35113
|
-
|
|
35126
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
|
|
35114
35127
|
], cleanHtml.prototype, "onSafeHTML", null);
|
|
35115
35128
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('cleanHtml', cleanHtml);
|
|
35116
35129
|
|
|
@@ -37894,7 +37907,12 @@ var brBoxes = new Set([
|
|
|
37894
37907
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(br, false)) {
|
|
37895
37908
|
return;
|
|
37896
37909
|
}
|
|
37897
|
-
|
|
37910
|
+
// After a block is inserted the caret is already at the end of its
|
|
37911
|
+
// text; moving it before the `<br>` would put it on a line of its own
|
|
37912
|
+
// below the block (#1315)
|
|
37913
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(node, jodit.s.range.startContainer)) {
|
|
37914
|
+
jodit.s.setCursorBefore(br);
|
|
37915
|
+
}
|
|
37898
37916
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(br);
|
|
37899
37917
|
}
|
|
37900
37918
|
}
|
|
@@ -37933,13 +37951,22 @@ var brBoxes = new Set([
|
|
|
37933
37951
|
var current = (_ref = (_jodit_s_current = jodit.s.current()) === null || _jodit_s_current === void 0 ? void 0 : _jodit_s_current.parentElement) !== null && _ref !== void 0 ? _ref : null;
|
|
37934
37952
|
while(current && current !== jodit.editor){
|
|
37935
37953
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
|
|
37936
|
-
|
|
37954
|
+
// In DIV mode the caret's own empty block is a line, like
|
|
37955
|
+
// `<p><br></p>`, not a container to insert into (#1315)
|
|
37956
|
+
var isEmptyLine = !parent && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(current, jodit.o.enter) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(current);
|
|
37957
|
+
if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()] && !isEmptyLine) {
|
|
37937
37958
|
break;
|
|
37938
37959
|
}
|
|
37939
37960
|
parent = current;
|
|
37940
37961
|
}
|
|
37941
37962
|
current = current.parentElement;
|
|
37942
37963
|
}
|
|
37964
|
+
// A list that is all of the inserted content adds its items to the
|
|
37965
|
+
// list of the item it goes into, as the browsers' own paste does
|
|
37966
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(current) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(node) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node.parentNode) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(node, false)) {
|
|
37967
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(node);
|
|
37968
|
+
parent = current;
|
|
37969
|
+
}
|
|
37943
37970
|
if (parent) {
|
|
37944
37971
|
jodit.s.setCursorAfter(parent);
|
|
37945
37972
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
|
|
@@ -37994,10 +38021,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
|
|
|
37994
38021
|
audio: 1,
|
|
37995
38022
|
body: 1,
|
|
37996
38023
|
caption: 1,
|
|
38024
|
+
dd: 1,
|
|
37997
38025
|
details: 1,
|
|
37998
38026
|
dir: 1,
|
|
37999
38027
|
div: 1,
|
|
38000
38028
|
dl: 1,
|
|
38029
|
+
dt: 1,
|
|
38001
38030
|
fieldset: 1,
|
|
38002
38031
|
figcaption: 1,
|
|
38003
38032
|
figure: 1,
|
|
@@ -38005,6 +38034,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.dtd = {
|
|
|
38005
38034
|
form: 1,
|
|
38006
38035
|
header: 1,
|
|
38007
38036
|
hgroup: 1,
|
|
38037
|
+
li: 1,
|
|
38008
38038
|
main: 1,
|
|
38009
38039
|
menu: 1,
|
|
38010
38040
|
nav: 1,
|
package/es5/jodit.min.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.
|
|
4
|
+
* Version: v4.18.2
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
/*!
|
|
9
9
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
10
10
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
11
|
-
* Version: v4.18.
|
|
11
|
+
* Version: v4.18.2
|
|
12
12
|
* Url: https://xdsoft.net/jodit/
|
|
13
13
|
* License(s): MIT
|
|
14
14
|
*/
|