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.
Files changed (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +27 -7
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +2 -2
  13. package/es2018/jodit.min.js +2 -2
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +3 -3
  18. package/es2021/jodit.js +27 -7
  19. package/es2021/jodit.min.js +3 -3
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +3 -3
  28. package/es2021.en/jodit.js +27 -7
  29. package/es2021.en/jodit.min.js +3 -3
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +52 -7
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
  52. package/esm/core/selection/style/api/list/toggle-ordered-list.js +30 -4
  53. package/esm/core/selection/style/transactions.js +1 -1
  54. package/package.json +1 -1
  55. package/types/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -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.11
4
+ * Version: v4.18.12
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2153,7 +2153,7 @@ __webpack_require__.r(__webpack_exports__);
2153
2153
  * @packageDocumentation
2154
2154
  * @module constants
2155
2155
  */
2156
- var APP_VERSION = "4.18.11";
2156
+ var APP_VERSION = "4.18.12";
2157
2157
  // prettier-ignore
2158
2158
  var ES = "es5";
2159
2159
  var IS_ES_MODERN = false;
@@ -15209,6 +15209,7 @@ function elementsEqualAttributes(elm1, elm2) {
15209
15209
  * Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
15210
15210
  * @private
15211
15211
  */ function toggleOrderedList(commitStyle, li, jodit, mode) {
15212
+ var collapsed = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
15212
15213
  if (!li) {
15213
15214
  return mode;
15214
15215
  }
@@ -15237,16 +15238,60 @@ function elementsEqualAttributes(elm1, elm2) {
15237
15238
  }
15238
15239
  // ul => ol, ol => ul or ul => ul.class1
15239
15240
  if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
15240
- var wrapper = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, list, li, jodit, commitStyle);
15241
- var newList = (0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, wrapper, jodit);
15241
+ // With just a caret, Word converts the whole list
15242
+ var items = collapsed && !isSameList ? Array.from(list.children).filter(function(item) {
15243
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(item);
15244
+ }) : [
15245
+ li
15246
+ ];
15247
+ var newList;
15248
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
15249
+ try {
15250
+ var _loop = function() {
15251
+ var item = _step.value;
15252
+ newList = keepNumbering(item, function(itemList) {
15253
+ return (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);
15254
+ });
15255
+ };
15256
+ for(var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
15257
+ } catch (err) {
15258
+ _didIteratorError = true;
15259
+ _iteratorError = err;
15260
+ } finally{
15261
+ try {
15262
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
15263
+ _iterator.return();
15264
+ }
15265
+ } finally{
15266
+ if (_didIteratorError) {
15267
+ throw _iteratorError;
15268
+ }
15269
+ }
15270
+ }
15242
15271
  hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
15243
15272
  return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
15244
15273
  }
15245
15274
  }
15246
- var wrapper1 = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, list, li, jodit, commitStyle);
15247
- hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, wrapper1, commitStyle);
15275
+ var wrapper = keepNumbering(li, function(itemList) {
15276
+ return unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, itemList, li, jodit, commitStyle);
15277
+ });
15278
+ hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, wrapper, commitStyle);
15248
15279
  return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP;
15249
15280
  }
15281
+ /**
15282
+ * Takes `item` out of its list with `takeOut`, and carries a numbered list's
15283
+ * count on past it, as Word does: 1, a bullet, then 2
15284
+ */ function keepNumbering(item, takeOut) {
15285
+ var list = item.parentElement;
15286
+ var rest = item.nextElementSibling;
15287
+ var 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;
15288
+ var result = takeOut(list);
15289
+ var restList = rest === null || rest === void 0 ? void 0 : rest.parentElement;
15290
+ if (next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(restList, 'ol')) {
15291
+ next > 1 ? restList.setAttribute('start', String(next)) : restList.removeAttribute('start');
15292
+ }
15293
+ return result;
15294
+ }
15250
15295
  /**
15251
15296
  * Other attributes, such as a class, still move the items into a new list,
15252
15297
  * where the `beforeWrapList` hook can add markup to each of them
@@ -16117,7 +16162,7 @@ var transactions = (_obj = {}, (0,_swc_helpers_define_property__WEBPACK_IMPORTED
16117
16162
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(_obj, states.TOGGLE_LIST, {
16118
16163
  exec: function exec(value) {
16119
16164
  return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, value), {
16120
- mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_6__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode),
16165
+ mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_6__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode, value.collapsed),
16121
16166
  next: states.END
16122
16167
  });
16123
16168
  }
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.11
4
+ * Version: v4.18.12
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
11
+ * Version: v4.18.12
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */