jodit 4.2.32 → 4.2.34

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 (63) hide show
  1. package/CHANGELOG.md +17 -5
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +30 -17
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.js +1 -1
  7. package/es2015/plugins/debug/debug.min.js +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  11. package/es2018/jodit.css +1 -1
  12. package/es2018/jodit.fat.min.js +2 -2
  13. package/es2018/jodit.js +29 -16
  14. package/es2018/jodit.min.js +2 -2
  15. package/es2018/plugins/debug/debug.js +1 -1
  16. package/es2018/plugins/debug/debug.min.js +1 -1
  17. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +1 -1
  21. package/es2021/jodit.fat.min.js +2 -2
  22. package/es2021/jodit.js +29 -16
  23. package/es2021/jodit.min.js +2 -2
  24. package/es2021/plugins/debug/debug.js +1 -1
  25. package/es2021/plugins/debug/debug.min.js +1 -1
  26. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  29. package/es2021.en/jodit.css +1 -1
  30. package/es2021.en/jodit.fat.min.js +2 -2
  31. package/es2021.en/jodit.js +29 -16
  32. package/es2021.en/jodit.min.js +2 -2
  33. package/es2021.en/plugins/debug/debug.js +1 -1
  34. package/es2021.en/plugins/debug/debug.min.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  38. package/es5/164.fat.min.js +1 -1
  39. package/es5/164.min.js +1 -1
  40. package/es5/5.fat.min.js +1 -1
  41. package/es5/5.min.js +1 -1
  42. package/es5/jodit.css +2 -2
  43. package/es5/jodit.fat.min.js +2 -2
  44. package/es5/jodit.js +53 -28
  45. package/es5/jodit.min.css +2 -2
  46. package/es5/jodit.min.js +2 -2
  47. package/es5/plugins/debug/debug.js +1 -1
  48. package/es5/plugins/debug/debug.min.js +1 -1
  49. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  50. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  51. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  52. package/esm/core/constants.js +1 -1
  53. package/esm/core/selection/style/api/list/toggle-ordered-list.js +3 -1
  54. package/esm/core/selection/style/api/list/wrap-list.d.ts +1 -1
  55. package/esm/plugins/search/helpers/highlight-text-ranges.d.ts +2 -1
  56. package/esm/plugins/search/helpers/highlight-text-ranges.js +12 -3
  57. package/esm/plugins/search/search.d.ts +2 -2
  58. package/esm/plugins/search/search.js +8 -7
  59. package/esm/plugins/search/ui/search.js +3 -3
  60. package/package.json +1 -1
  61. package/types/core/selection/style/api/list/wrap-list.d.ts +1 -1
  62. package/types/plugins/search/helpers/highlight-text-ranges.d.ts +2 -1
  63. package/types/plugins/search/search.d.ts +2 -2
@@ -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.2.32
4
+ * Version: v4.2.34
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
1736
1736
  * Released under MIT see LICENSE.txt in the project root for license information.
1737
1737
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1738
1738
  */
1739
- const APP_VERSION = "4.2.32";
1739
+ const APP_VERSION = "4.2.34";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2021";
1742
1742
  const IS_ES_MODERN = true;
@@ -11810,7 +11810,9 @@ function unwrapList(mode, list, li, jodit, cs) {
11810
11810
  (0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_2__/* .extractSelectedPart */ .y)(list, li, jodit);
11811
11811
  void 0;
11812
11812
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.unwrap(li.parentElement);
11813
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.replace(li, jodit.o.enter, jodit.createInside);
11813
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.replace(li, jodit.o.enter.toLowerCase() !== 'br'
11814
+ ? jodit.o.enter
11815
+ : jodit.createInside.fragment(), jodit.createInside);
11814
11816
  }
11815
11817
 
11816
11818
 
@@ -37062,6 +37064,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
37062
37064
  /* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
37063
37065
  /* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
37064
37066
  /* harmony export */ });
37067
+ /* unused harmony export clearNativeSelection */
37065
37068
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
37066
37069
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
37067
37070
  /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58720);
@@ -37123,8 +37126,9 @@ function getSelectionWrappers(root) {
37123
37126
  /**
37124
37127
  * @private
37125
37128
  */
37126
- function clearSelectionWrappers(root) {
37127
- getSelectionWrappers(root).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
37129
+ function clearSelectionWrappers(jodit) {
37130
+ getSelectionWrappers(jodit.editor).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
37131
+ clearNativeSelection(jodit);
37128
37132
  }
37129
37133
  /**
37130
37134
  * @private
@@ -37149,7 +37153,6 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
37149
37153
  range.setEnd(rng.endContainer, rng.endOffset);
37150
37154
  return range;
37151
37155
  });
37152
- // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
37153
37156
  const searchHighlight = new Highlight(...ranges);
37154
37157
  // @ts-ignore
37155
37158
  CSS.highlights.clear();
@@ -37160,6 +37163,15 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
37160
37163
  }
37161
37164
  return false;
37162
37165
  }
37166
+ function clearNativeSelection(jodit) {
37167
+ if (jodit.o.search.useCustomHighlightAPI &&
37168
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
37169
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow &&
37170
+ typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.Highlight !== 'undefined') {
37171
+ // @ts-ignore
37172
+ CSS.highlights.clear();
37173
+ }
37174
+ }
37163
37175
  function normalizeRanges(rng, restRanges, ci) {
37164
37176
  const startText = rng.startContainer.nodeValue;
37165
37177
  let diff = 0;
@@ -37333,11 +37345,11 @@ class SentenceFinder {
37333
37345
  *
37334
37346
  * @example
37335
37347
  * ```typescript
37336
- * var jodit = Jodit.make('#editor', {
37348
+ * const jodit = Jodit.make('#editor', {
37337
37349
  * useSearch: false
37338
37350
  * });
37339
37351
  * // or
37340
- * var jodit = Jodit.make('#editor', {
37352
+ * const jodit = Jodit.make('#editor', {
37341
37353
  * disablePlugins: 'search'
37342
37354
  * });
37343
37355
  * ```
@@ -37416,7 +37428,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
37416
37428
  rng.deleteContents();
37417
37429
  const textNode = this.j.createInside.text(this.ui.replace);
37418
37430
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeInsertNode(rng, textNode);
37419
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
37431
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
37420
37432
  this.j.s.setCursorAfter(textNode);
37421
37433
  this.tryScrollToElement(textNode);
37422
37434
  this.cache = {};
@@ -37443,7 +37455,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
37443
37455
  !(0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getSelectionWrappers */ .zy)(this.j.editor).length) {
37444
37456
  this.drawPromise?.rejectCallback();
37445
37457
  this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
37446
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
37458
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
37447
37459
  this.drawPromise = this.__drawSelectionRanges(bounds);
37448
37460
  }
37449
37461
  this.previousQuery = query;
@@ -37556,14 +37568,15 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
37556
37568
  this.ui.close();
37557
37569
  })
37558
37570
  .on(this.ui, 'afterClose', () => {
37559
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
37571
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
37560
37572
  this.ui.currentIndex = 0;
37561
37573
  this.ui.count = 0;
37562
37574
  this.cache = {};
37575
+ editor.focus();
37563
37576
  })
37564
37577
  .on('click', () => {
37565
37578
  this.ui.currentIndex = 0;
37566
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
37579
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
37567
37580
  })
37568
37581
  .on('change.search', () => {
37569
37582
  this.cache = {};
@@ -37574,7 +37587,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
37574
37587
  this.ui.selInfo = null;
37575
37588
  }
37576
37589
  if (this.ui.isOpened) {
37577
- this.updateCounters();
37590
+ void this.updateCounters();
37578
37591
  }
37579
37592
  }, editor.defaultTimeout))
37580
37593
  .on('searchNext.search searchPrevious.search', () => {
@@ -37754,7 +37767,7 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
37754
37767
  return false;
37755
37768
  })
37756
37769
  .on(next, 'pointerdown', () => {
37757
- jodit.e.fire('searchNext');
37770
+ void jodit.e.fire('searchNext');
37758
37771
  return false;
37759
37772
  })
37760
37773
  .on(prev, 'pointerdown', () => {
@@ -37764,12 +37777,12 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
37764
37777
  .on(this.queryInput, 'input', () => {
37765
37778
  this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.trim)(this.queryInput.value).length);
37766
37779
  })
37767
- .on(this.queryInput, 'keydown', this.j.async.debounce((e) => {
37780
+ .on(this.queryInput, 'keydown', this.j.async.debounce(async (e) => {
37768
37781
  switch (e.key) {
37769
37782
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER:
37770
37783
  e.preventDefault();
37771
37784
  e.stopImmediatePropagation();
37772
- if (jodit.e.fire('searchNext')) {
37785
+ if (await jodit.e.fire('searchNext')) {
37773
37786
  this.close();
37774
37787
  }
37775
37788
  break;