jodit 4.4.7 → 4.4.8
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 +6 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +71 -35
- package/es2015/jodit.min.js +2 -2
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +71 -35
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.css +1 -1
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.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 +2 -2
- package/es2021/jodit.js +71 -35
- package/es2021/jodit.min.js +2 -2
- 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 +2 -2
- package/es2021.en/jodit.js +71 -35
- package/es2021.en/jodit.min.js +2 -2
- 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/5.fat.min.js +1 -1
- package/es5/5.min.js +1 -1
- package/es5/975.fat.min.js +1 -1
- package/es5/975.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +71 -35
- 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/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.d.ts +5 -0
- package/esm/core/dom/dom.js +36 -12
- package/esm/plugins/indent/indent.js +34 -22
- package/package.json +1 -1
- package/types/core/dom/dom.d.ts +5 -0
package/es2018/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.4.
|
|
4
|
+
* Version: v4.4.8
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1742,7 +1742,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1742
1742
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1743
1743
|
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1744
1744
|
*/
|
|
1745
|
-
const APP_VERSION = "4.4.
|
|
1745
|
+
const APP_VERSION = "4.4.8";
|
|
1746
1746
|
// prettier-ignore
|
|
1747
1747
|
const ES = "es2018";
|
|
1748
1748
|
const IS_ES_MODERN = true;
|
|
@@ -2887,28 +2887,25 @@ class Dom {
|
|
|
2887
2887
|
}
|
|
2888
2888
|
}
|
|
2889
2889
|
/**
|
|
2890
|
-
* Wrap all inline siblings
|
|
2890
|
+
* Wrap all inline next siblings
|
|
2891
2891
|
*/
|
|
2892
|
-
static
|
|
2893
|
-
let tmp
|
|
2892
|
+
static wrapNextInline(current, tag, editor) {
|
|
2893
|
+
let tmp;
|
|
2894
|
+
const first = current;
|
|
2895
|
+
let last = current;
|
|
2894
2896
|
editor.s.save();
|
|
2895
2897
|
let needFindNext = false;
|
|
2896
|
-
do {
|
|
2897
|
-
needFindNext = false;
|
|
2898
|
-
tmp = first.previousSibling;
|
|
2899
|
-
if (tmp && !Dom.isBlock(tmp)) {
|
|
2900
|
-
needFindNext = true;
|
|
2901
|
-
first = tmp;
|
|
2902
|
-
}
|
|
2903
|
-
} while (needFindNext);
|
|
2904
2898
|
do {
|
|
2905
2899
|
needFindNext = false;
|
|
2906
2900
|
tmp = last.nextSibling;
|
|
2907
|
-
if (tmp && !Dom.isBlock(tmp)) {
|
|
2901
|
+
if (tmp && !Dom.isBlock(tmp) && !Dom.isTag(tmp, 'br')) {
|
|
2908
2902
|
needFindNext = true;
|
|
2909
2903
|
last = tmp;
|
|
2910
2904
|
}
|
|
2911
2905
|
} while (needFindNext);
|
|
2906
|
+
return Dom.__wrapElements(tag, editor, first, last);
|
|
2907
|
+
}
|
|
2908
|
+
static __wrapElements(tag, editor, first, last) {
|
|
2912
2909
|
const wrapper = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .Kg)(tag) ? editor.createInside.element(tag) : tag;
|
|
2913
2910
|
if (first.parentNode) {
|
|
2914
2911
|
first.parentNode.insertBefore(wrapper, first);
|
|
@@ -2925,6 +2922,33 @@ class Dom {
|
|
|
2925
2922
|
editor.s.restore();
|
|
2926
2923
|
return wrapper;
|
|
2927
2924
|
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Wrap all inline siblings
|
|
2927
|
+
*/
|
|
2928
|
+
static wrapInline(current, tag, editor) {
|
|
2929
|
+
let tmp;
|
|
2930
|
+
let first = current;
|
|
2931
|
+
let last = current;
|
|
2932
|
+
editor.s.save();
|
|
2933
|
+
let needFindNext = false;
|
|
2934
|
+
do {
|
|
2935
|
+
needFindNext = false;
|
|
2936
|
+
tmp = first.previousSibling;
|
|
2937
|
+
if (tmp && !Dom.isBlock(tmp)) {
|
|
2938
|
+
needFindNext = true;
|
|
2939
|
+
first = tmp;
|
|
2940
|
+
}
|
|
2941
|
+
} while (needFindNext);
|
|
2942
|
+
do {
|
|
2943
|
+
needFindNext = false;
|
|
2944
|
+
tmp = last.nextSibling;
|
|
2945
|
+
if (tmp && !Dom.isBlock(tmp)) {
|
|
2946
|
+
needFindNext = true;
|
|
2947
|
+
last = tmp;
|
|
2948
|
+
}
|
|
2949
|
+
} while (needFindNext);
|
|
2950
|
+
return Dom.__wrapElements(tag, editor, first, last);
|
|
2951
|
+
}
|
|
2928
2952
|
/**
|
|
2929
2953
|
* Wrap node inside another node
|
|
2930
2954
|
*/
|
|
@@ -33254,7 +33278,7 @@ const getKey = (direction, box) => `${jodit_core_dom_dom__WEBPACK_IMPORTED_MODUL
|
|
|
33254
33278
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
|
|
33255
33279
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71842);
|
|
33256
33280
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
|
|
33257
|
-
/* harmony import */ var
|
|
33281
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97369);
|
|
33258
33282
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97767);
|
|
33259
33283
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3392);
|
|
33260
33284
|
/*!
|
|
@@ -33268,6 +33292,22 @@ const getKey = (direction, box) => `${jodit_core_dom_dom__WEBPACK_IMPORTED_MODUL
|
|
|
33268
33292
|
|
|
33269
33293
|
|
|
33270
33294
|
|
|
33295
|
+
const applyIndentToBox = (processedElements, currentBox, editor, command) => {
|
|
33296
|
+
if (!currentBox) {
|
|
33297
|
+
return;
|
|
33298
|
+
}
|
|
33299
|
+
if (processedElements.has(currentBox)) {
|
|
33300
|
+
return;
|
|
33301
|
+
}
|
|
33302
|
+
const key = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__/* .getKey */ .i)(editor.o.direction, currentBox);
|
|
33303
|
+
processedElements.add(currentBox);
|
|
33304
|
+
let value = currentBox.style[key] ? parseInt(currentBox.style[key], 10) : 0;
|
|
33305
|
+
value += editor.o.indentMargin * (command === 'outdent' ? -1 : 1);
|
|
33306
|
+
currentBox.style[key] = value > 0 ? value + 'px' : '';
|
|
33307
|
+
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style')) {
|
|
33308
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style', null);
|
|
33309
|
+
}
|
|
33310
|
+
};
|
|
33271
33311
|
/**
|
|
33272
33312
|
* Indents the line containing the selection or insertion point.
|
|
33273
33313
|
*/
|
|
@@ -33281,46 +33321,42 @@ function indent(editor) {
|
|
|
33281
33321
|
name: 'outdent',
|
|
33282
33322
|
group: 'indent'
|
|
33283
33323
|
});
|
|
33284
|
-
const
|
|
33285
|
-
const processedElements =
|
|
33324
|
+
const indentCommand = (command) => {
|
|
33325
|
+
const processedElements = new Set();
|
|
33326
|
+
const { enter, enterBlock } = editor.o;
|
|
33327
|
+
const isBrMode = enter.toLowerCase() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.BR;
|
|
33328
|
+
const current = editor.s.current();
|
|
33329
|
+
if (isBrMode && editor.s.isCollapsed()) {
|
|
33330
|
+
if (current) {
|
|
33331
|
+
const box = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.wrapNextInline(current, enterBlock, editor);
|
|
33332
|
+
applyIndentToBox(processedElements, box, editor, command);
|
|
33333
|
+
return false;
|
|
33334
|
+
}
|
|
33335
|
+
}
|
|
33286
33336
|
editor.s.eachSelection((current) => {
|
|
33287
33337
|
editor.s.save();
|
|
33288
33338
|
let currentBox = current
|
|
33289
33339
|
? jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.up(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isBlock, editor.editor)
|
|
33290
33340
|
: false;
|
|
33291
|
-
const { enter } = editor.o;
|
|
33292
33341
|
if (!currentBox && current) {
|
|
33293
|
-
currentBox = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.wrapInline
|
|
33342
|
+
currentBox = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.call)(!isBrMode ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.wrapInline : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.wrapNextInline, current, !isBrMode ? enter.toLowerCase() : enterBlock, editor);
|
|
33294
33343
|
}
|
|
33295
33344
|
if (!currentBox) {
|
|
33296
33345
|
editor.s.restore();
|
|
33297
33346
|
return false;
|
|
33298
33347
|
}
|
|
33299
|
-
|
|
33300
|
-
if (currentBox && !alreadyIndented) {
|
|
33301
|
-
const key = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__/* .getKey */ .i)(editor.o.direction, currentBox);
|
|
33302
|
-
processedElements.push(currentBox);
|
|
33303
|
-
let value = currentBox.style[key]
|
|
33304
|
-
? parseInt(currentBox.style[key], 10)
|
|
33305
|
-
: 0;
|
|
33306
|
-
value +=
|
|
33307
|
-
editor.o.indentMargin * (command === 'outdent' ? -1 : 1);
|
|
33308
|
-
currentBox.style[key] = value > 0 ? value + 'px' : '';
|
|
33309
|
-
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style')) {
|
|
33310
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(currentBox, 'style', null);
|
|
33311
|
-
}
|
|
33312
|
-
}
|
|
33348
|
+
applyIndentToBox(processedElements, currentBox, editor, command);
|
|
33313
33349
|
editor.s.restore();
|
|
33314
33350
|
});
|
|
33315
33351
|
editor.synchronizeValues();
|
|
33316
33352
|
return false;
|
|
33317
33353
|
};
|
|
33318
33354
|
editor.registerCommand('indent', {
|
|
33319
|
-
exec:
|
|
33355
|
+
exec: indentCommand,
|
|
33320
33356
|
hotkeys: ['ctrl+]', 'cmd+]']
|
|
33321
33357
|
});
|
|
33322
33358
|
editor.registerCommand('outdent', {
|
|
33323
|
-
exec:
|
|
33359
|
+
exec: indentCommand,
|
|
33324
33360
|
hotkeys: ['ctrl+[', 'cmd+[']
|
|
33325
33361
|
});
|
|
33326
33362
|
}
|