jodit 4.2.32 → 4.2.33

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