jodit 4.18.11 → 4.18.12
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 +27 -7
- 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.fat.min.js +2 -2
- package/es2018/jodit.min.js +2 -2
- 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 +27 -7
- package/es2021/jodit.min.js +3 -3
- 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 +27 -7
- 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 +52 -7
- 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/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
- package/esm/core/selection/style/api/list/toggle-ordered-list.js +30 -4
- package/esm/core/selection/style/transactions.js +1 -1
- package/package.json +1 -1
- package/types/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
package/es2015/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.12
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1829,7 +1829,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1829
1829
|
* ```
|
|
1830
1830
|
* @packageDocumentation
|
|
1831
1831
|
* @module constants
|
|
1832
|
-
*/ const APP_VERSION = "4.18.
|
|
1832
|
+
*/ const APP_VERSION = "4.18.12";
|
|
1833
1833
|
// prettier-ignore
|
|
1834
1834
|
const ES = "es2015";
|
|
1835
1835
|
const IS_ES_MODERN = true;
|
|
@@ -13294,7 +13294,7 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
13294
13294
|
/**
|
|
13295
13295
|
* Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
|
|
13296
13296
|
* @private
|
|
13297
|
-
*/ function toggleOrderedList(commitStyle, li, jodit, mode) {
|
|
13297
|
+
*/ function toggleOrderedList(commitStyle, li, jodit, mode, collapsed = false) {
|
|
13298
13298
|
if (!li) {
|
|
13299
13299
|
return mode;
|
|
13300
13300
|
}
|
|
@@ -13323,16 +13323,36 @@ function elementsEqualAttributes(elm1, elm2) {
|
|
|
13323
13323
|
}
|
|
13324
13324
|
// ul => ol, ol => ul or ul => ul.class1
|
|
13325
13325
|
if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
|
|
13326
|
-
|
|
13327
|
-
const
|
|
13326
|
+
// With just a caret, Word converts the whole list
|
|
13327
|
+
const items = collapsed && !isSameList ? Array.from(list.children).filter((item)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(item)) : [
|
|
13328
|
+
li
|
|
13329
|
+
];
|
|
13330
|
+
let newList;
|
|
13331
|
+
for (const item of items){
|
|
13332
|
+
newList = keepNumbering(item, (itemList)=>(0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, itemList, item, jodit, commitStyle), jodit));
|
|
13333
|
+
}
|
|
13328
13334
|
hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
|
|
13329
13335
|
return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
|
|
13330
13336
|
}
|
|
13331
13337
|
}
|
|
13332
|
-
const wrapper = unwrapList((/* inlined export .UNWRAP */"unwrap"),
|
|
13338
|
+
const wrapper = keepNumbering(li, (itemList)=>unwrapList((/* inlined export .UNWRAP */"unwrap"), itemList, li, jodit, commitStyle));
|
|
13333
13339
|
hook((/* inlined export .UNWRAP */"unwrap"), wrapper, commitStyle);
|
|
13334
13340
|
return (/* inlined export .UNWRAP */"unwrap");
|
|
13335
13341
|
}
|
|
13342
|
+
/**
|
|
13343
|
+
* Takes `item` out of its list with `takeOut`, and carries a numbered list's
|
|
13344
|
+
* count on past it, as Word does: 1, a bullet, then 2
|
|
13345
|
+
*/ function keepNumbering(item, takeOut) {
|
|
13346
|
+
const list = item.parentElement;
|
|
13347
|
+
const rest = item.nextElementSibling;
|
|
13348
|
+
const next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, 'ol') ? (parseInt(list.getAttribute('start') || '1', 10) || 1) + Array.from(list.children).indexOf(item) : 0;
|
|
13349
|
+
const result = takeOut(list);
|
|
13350
|
+
const restList = rest === null || rest === void 0 ? void 0 : rest.parentElement;
|
|
13351
|
+
if (next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(restList, 'ol')) {
|
|
13352
|
+
next > 1 ? restList.setAttribute('start', String(next)) : restList.removeAttribute('start');
|
|
13353
|
+
}
|
|
13354
|
+
return result;
|
|
13355
|
+
}
|
|
13336
13356
|
/**
|
|
13337
13357
|
* Other attributes, such as a class, still move the items into a new list,
|
|
13338
13358
|
* where the `beforeWrapList` hook can add markup to each of them
|
|
@@ -14107,7 +14127,7 @@ const transactions = {
|
|
|
14107
14127
|
[states.TOGGLE_LIST]: {
|
|
14108
14128
|
exec (value) {
|
|
14109
14129
|
return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, value), {
|
|
14110
|
-
mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_5__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode),
|
|
14130
|
+
mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_5__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode, value.collapsed),
|
|
14111
14131
|
next: states.END
|
|
14112
14132
|
});
|
|
14113
14133
|
}
|