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/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.2.32
4
+ * Version: v4.2.33
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1735,7 +1735,7 @@ __webpack_require__.r(__webpack_exports__);
1735
1735
  * Released under MIT see LICENSE.txt in the project root for license information.
1736
1736
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1737
1737
  */
1738
- const APP_VERSION = "4.2.32";
1738
+ const APP_VERSION = "4.2.33";
1739
1739
  // prettier-ignore
1740
1740
  const ES = "es2015";
1741
1741
  const IS_ES_MODERN = true;
@@ -37985,6 +37985,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
37985
37985
  /* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
37986
37986
  /* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
37987
37987
  /* harmony export */ });
37988
+ /* unused harmony export clearNativeSelection */
37988
37989
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
37989
37990
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
37990
37991
  /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58720);
@@ -38046,8 +38047,9 @@ function getSelectionWrappers(root) {
38046
38047
  /**
38047
38048
  * @private
38048
38049
  */
38049
- function clearSelectionWrappers(root) {
38050
- getSelectionWrappers(root).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
38050
+ function clearSelectionWrappers(jodit) {
38051
+ getSelectionWrappers(jodit.editor).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
38052
+ clearNativeSelection(jodit);
38051
38053
  }
38052
38054
  /**
38053
38055
  * @private
@@ -38072,7 +38074,6 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
38072
38074
  range.setEnd(rng.endContainer, rng.endOffset);
38073
38075
  return range;
38074
38076
  });
38075
- // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
38076
38077
  const searchHighlight = new Highlight(...ranges);
38077
38078
  // @ts-ignore
38078
38079
  CSS.highlights.clear();
@@ -38083,6 +38084,15 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
38083
38084
  }
38084
38085
  return false;
38085
38086
  }
38087
+ function clearNativeSelection(jodit) {
38088
+ if (jodit.o.search.useCustomHighlightAPI &&
38089
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
38090
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow &&
38091
+ typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.Highlight !== 'undefined') {
38092
+ // @ts-ignore
38093
+ CSS.highlights.clear();
38094
+ }
38095
+ }
38086
38096
  function normalizeRanges(rng, restRanges, ci) {
38087
38097
  const startText = rng.startContainer.nodeValue;
38088
38098
  let diff = 0;
@@ -38257,11 +38267,11 @@ class SentenceFinder {
38257
38267
  *
38258
38268
  * @example
38259
38269
  * ```typescript
38260
- * var jodit = Jodit.make('#editor', {
38270
+ * const jodit = Jodit.make('#editor', {
38261
38271
  * useSearch: false
38262
38272
  * });
38263
38273
  * // or
38264
- * var jodit = Jodit.make('#editor', {
38274
+ * const jodit = Jodit.make('#editor', {
38265
38275
  * disablePlugins: 'search'
38266
38276
  * });
38267
38277
  * ```
@@ -38347,7 +38357,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38347
38357
  rng.deleteContents();
38348
38358
  const textNode = this.j.createInside.text(this.ui.replace);
38349
38359
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeInsertNode(rng, textNode);
38350
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
38360
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
38351
38361
  this.j.s.setCursorAfter(textNode);
38352
38362
  this.tryScrollToElement(textNode);
38353
38363
  this.cache = {};
@@ -38377,7 +38387,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38377
38387
  !(0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getSelectionWrappers */ .zy)(this.j.editor).length) {
38378
38388
  (_a = this.drawPromise) === null || _a === void 0 ? void 0 : _a.rejectCallback();
38379
38389
  this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
38380
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
38390
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
38381
38391
  this.drawPromise = this.__drawSelectionRanges(bounds);
38382
38392
  }
38383
38393
  this.previousQuery = query;
@@ -38499,14 +38509,15 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38499
38509
  this.ui.close();
38500
38510
  })
38501
38511
  .on(this.ui, 'afterClose', () => {
38502
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
38512
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
38503
38513
  this.ui.currentIndex = 0;
38504
38514
  this.ui.count = 0;
38505
38515
  this.cache = {};
38516
+ editor.focus();
38506
38517
  })
38507
38518
  .on('click', () => {
38508
38519
  this.ui.currentIndex = 0;
38509
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
38520
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
38510
38521
  })
38511
38522
  .on('change.search', () => {
38512
38523
  this.cache = {};
@@ -38517,7 +38528,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38517
38528
  this.ui.selInfo = null;
38518
38529
  }
38519
38530
  if (this.ui.isOpened) {
38520
- this.updateCounters();
38531
+ void this.updateCounters();
38521
38532
  }
38522
38533
  }, editor.defaultTimeout))
38523
38534
  .on('searchNext.search searchPrevious.search', () => {
@@ -38697,7 +38708,7 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38697
38708
  return false;
38698
38709
  })
38699
38710
  .on(next, 'pointerdown', () => {
38700
- jodit.e.fire('searchNext');
38711
+ void jodit.e.fire('searchNext');
38701
38712
  return false;
38702
38713
  })
38703
38714
  .on(prev, 'pointerdown', () => {
@@ -38707,12 +38718,12 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38707
38718
  .on(this.queryInput, 'input', () => {
38708
38719
  this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.trim)(this.queryInput.value).length);
38709
38720
  })
38710
- .on(this.queryInput, 'keydown', this.j.async.debounce((e) => {
38721
+ .on(this.queryInput, 'keydown', this.j.async.debounce((e) => (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
38711
38722
  switch (e.key) {
38712
38723
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER:
38713
38724
  e.preventDefault();
38714
38725
  e.stopImmediatePropagation();
38715
- if (jodit.e.fire('searchNext')) {
38726
+ if (yield jodit.e.fire('searchNext')) {
38716
38727
  this.close();
38717
38728
  }
38718
38729
  break;
@@ -38720,7 +38731,7 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38720
38731
  jodit.e.fire(this, 'needUpdateCounters');
38721
38732
  break;
38722
38733
  }
38723
- }, this.j.defaultTimeout));
38734
+ }), this.j.defaultTimeout));
38724
38735
  }
38725
38736
  onEditorKeyDown(e) {
38726
38737
  if (!this.isOpened) {