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
package/es2021/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.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
 
@@ -37947,6 +37949,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
37947
37949
  /* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
37948
37950
  /* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
37949
37951
  /* harmony export */ });
37952
+ /* unused harmony export clearNativeSelection */
37950
37953
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
37951
37954
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
37952
37955
  /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58720);
@@ -38008,8 +38011,9 @@ function getSelectionWrappers(root) {
38008
38011
  /**
38009
38012
  * @private
38010
38013
  */
38011
- function clearSelectionWrappers(root) {
38012
- getSelectionWrappers(root).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
38014
+ function clearSelectionWrappers(jodit) {
38015
+ getSelectionWrappers(jodit.editor).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
38016
+ clearNativeSelection(jodit);
38013
38017
  }
38014
38018
  /**
38015
38019
  * @private
@@ -38034,7 +38038,6 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
38034
38038
  range.setEnd(rng.endContainer, rng.endOffset);
38035
38039
  return range;
38036
38040
  });
38037
- // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
38038
38041
  const searchHighlight = new Highlight(...ranges);
38039
38042
  // @ts-ignore
38040
38043
  CSS.highlights.clear();
@@ -38045,6 +38048,15 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
38045
38048
  }
38046
38049
  return false;
38047
38050
  }
38051
+ function clearNativeSelection(jodit) {
38052
+ if (jodit.o.search.useCustomHighlightAPI &&
38053
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
38054
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow &&
38055
+ typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.Highlight !== 'undefined') {
38056
+ // @ts-ignore
38057
+ CSS.highlights.clear();
38058
+ }
38059
+ }
38048
38060
  function normalizeRanges(rng, restRanges, ci) {
38049
38061
  const startText = rng.startContainer.nodeValue;
38050
38062
  let diff = 0;
@@ -38218,11 +38230,11 @@ class SentenceFinder {
38218
38230
  *
38219
38231
  * @example
38220
38232
  * ```typescript
38221
- * var jodit = Jodit.make('#editor', {
38233
+ * const jodit = Jodit.make('#editor', {
38222
38234
  * useSearch: false
38223
38235
  * });
38224
38236
  * // or
38225
- * var jodit = Jodit.make('#editor', {
38237
+ * const jodit = Jodit.make('#editor', {
38226
38238
  * disablePlugins: 'search'
38227
38239
  * });
38228
38240
  * ```
@@ -38301,7 +38313,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38301
38313
  rng.deleteContents();
38302
38314
  const textNode = this.j.createInside.text(this.ui.replace);
38303
38315
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeInsertNode(rng, textNode);
38304
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
38316
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
38305
38317
  this.j.s.setCursorAfter(textNode);
38306
38318
  this.tryScrollToElement(textNode);
38307
38319
  this.cache = {};
@@ -38328,7 +38340,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38328
38340
  !(0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getSelectionWrappers */ .zy)(this.j.editor).length) {
38329
38341
  this.drawPromise?.rejectCallback();
38330
38342
  this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
38331
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
38343
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
38332
38344
  this.drawPromise = this.__drawSelectionRanges(bounds);
38333
38345
  }
38334
38346
  this.previousQuery = query;
@@ -38441,14 +38453,15 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38441
38453
  this.ui.close();
38442
38454
  })
38443
38455
  .on(this.ui, 'afterClose', () => {
38444
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
38456
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
38445
38457
  this.ui.currentIndex = 0;
38446
38458
  this.ui.count = 0;
38447
38459
  this.cache = {};
38460
+ editor.focus();
38448
38461
  })
38449
38462
  .on('click', () => {
38450
38463
  this.ui.currentIndex = 0;
38451
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
38464
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
38452
38465
  })
38453
38466
  .on('change.search', () => {
38454
38467
  this.cache = {};
@@ -38459,7 +38472,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38459
38472
  this.ui.selInfo = null;
38460
38473
  }
38461
38474
  if (this.ui.isOpened) {
38462
- this.updateCounters();
38475
+ void this.updateCounters();
38463
38476
  }
38464
38477
  }, editor.defaultTimeout))
38465
38478
  .on('searchNext.search searchPrevious.search', () => {
@@ -38639,7 +38652,7 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38639
38652
  return false;
38640
38653
  })
38641
38654
  .on(next, 'pointerdown', () => {
38642
- jodit.e.fire('searchNext');
38655
+ void jodit.e.fire('searchNext');
38643
38656
  return false;
38644
38657
  })
38645
38658
  .on(prev, 'pointerdown', () => {
@@ -38649,12 +38662,12 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38649
38662
  .on(this.queryInput, 'input', () => {
38650
38663
  this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.trim)(this.queryInput.value).length);
38651
38664
  })
38652
- .on(this.queryInput, 'keydown', this.j.async.debounce((e) => {
38665
+ .on(this.queryInput, 'keydown', this.j.async.debounce(async (e) => {
38653
38666
  switch (e.key) {
38654
38667
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER:
38655
38668
  e.preventDefault();
38656
38669
  e.stopImmediatePropagation();
38657
- if (jodit.e.fire('searchNext')) {
38670
+ if (await jodit.e.fire('searchNext')) {
38658
38671
  this.close();
38659
38672
  }
38660
38673
  break;