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/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.2.32
4
+ * Version: v4.2.33
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1838,7 +1838,7 @@ __webpack_require__.r(__webpack_exports__);
1838
1838
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1839
1839
  */
1840
1840
 
1841
- var APP_VERSION = "4.2.32";
1841
+ var APP_VERSION = "4.2.33";
1842
1842
  // prettier-ignore
1843
1843
  var ES = "es5";
1844
1844
  var IS_ES_MODERN = false;
@@ -39526,6 +39526,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
39526
39526
  /* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
39527
39527
  /* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
39528
39528
  /* harmony export */ });
39529
+ /* unused harmony export clearNativeSelection */
39529
39530
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
39530
39531
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
39531
39532
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
@@ -39590,8 +39591,9 @@ function getSelectionWrappers(root) {
39590
39591
  /**
39591
39592
  * @private
39592
39593
  */
39593
- function clearSelectionWrappers(root) {
39594
- getSelectionWrappers(root).forEach(function (span) { return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span); });
39594
+ function clearSelectionWrappers(jodit) {
39595
+ getSelectionWrappers(jodit.editor).forEach(function (span) { return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span); });
39596
+ clearNativeSelection(jodit);
39595
39597
  }
39596
39598
  /**
39597
39599
  * @private
@@ -39616,7 +39618,6 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
39616
39618
  range.setEnd(rng.endContainer, rng.endOffset);
39617
39619
  return range;
39618
39620
  });
39619
- // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
39620
39621
  var searchHighlight = new (Highlight.bind.apply(Highlight, (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__spreadArray */ .fX)([void 0], (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__read */ .zs)(ranges), false)))();
39621
39622
  // @ts-ignore
39622
39623
  CSS.highlights.clear();
@@ -39627,6 +39628,15 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
39627
39628
  }
39628
39629
  return false;
39629
39630
  }
39631
+ function clearNativeSelection(jodit) {
39632
+ if (jodit.o.search.useCustomHighlightAPI &&
39633
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
39634
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow &&
39635
+ typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.Highlight !== 'undefined') {
39636
+ // @ts-ignore
39637
+ CSS.highlights.clear();
39638
+ }
39639
+ }
39630
39640
  function normalizeRanges(rng, restRanges, ci) {
39631
39641
  var e_1, _a;
39632
39642
  var startText = rng.startContainer.nodeValue;
@@ -39819,11 +39829,11 @@ var SentenceFinder = /** @class */ (function () {
39819
39829
  *
39820
39830
  * @example
39821
39831
  * ```typescript
39822
- * var jodit = Jodit.make('#editor', {
39832
+ * const jodit = Jodit.make('#editor', {
39823
39833
  * useSearch: false
39824
39834
  * });
39825
39835
  * // or
39826
- * var jodit = Jodit.make('#editor', {
39836
+ * const jodit = Jodit.make('#editor', {
39827
39837
  * disablePlugins: 'search'
39828
39838
  * });
39829
39839
  * ```
@@ -39940,7 +39950,7 @@ var search = /** @class */ (function (_super) {
39940
39950
  rng.deleteContents();
39941
39951
  textNode = this.j.createInside.text(this.ui.replace);
39942
39952
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeInsertNode(rng, textNode);
39943
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
39953
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
39944
39954
  this.j.s.setCursorAfter(textNode);
39945
39955
  this.tryScrollToElement(textNode);
39946
39956
  this.cache = {};
@@ -39979,7 +39989,7 @@ var search = /** @class */ (function (_super) {
39979
39989
  !(0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getSelectionWrappers */ .zy)(this.j.editor).length) {
39980
39990
  (_a = this.drawPromise) === null || _a === void 0 ? void 0 : _a.rejectCallback();
39981
39991
  this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
39982
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
39992
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
39983
39993
  this.drawPromise = this.__drawSelectionRanges(bounds);
39984
39994
  }
39985
39995
  this.previousQuery = query;
@@ -40131,14 +40141,15 @@ var search = /** @class */ (function (_super) {
40131
40141
  _this.ui.close();
40132
40142
  })
40133
40143
  .on(this.ui, 'afterClose', function () {
40134
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
40144
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
40135
40145
  _this.ui.currentIndex = 0;
40136
40146
  _this.ui.count = 0;
40137
40147
  _this.cache = {};
40148
+ editor.focus();
40138
40149
  })
40139
40150
  .on('click', function () {
40140
40151
  _this.ui.currentIndex = 0;
40141
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
40152
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
40142
40153
  })
40143
40154
  .on('change.search', function () {
40144
40155
  _this.cache = {};
@@ -40149,7 +40160,7 @@ var search = /** @class */ (function (_super) {
40149
40160
  _this.ui.selInfo = null;
40150
40161
  }
40151
40162
  if (_this.ui.isOpened) {
40152
- _this.updateCounters();
40163
+ void _this.updateCounters();
40153
40164
  }
40154
40165
  }, editor.defaultTimeout))
40155
40166
  .on('searchNext.search searchPrevious.search', function () {
@@ -40294,7 +40305,7 @@ var UISearch = /** @class */ (function (_super) {
40294
40305
  return false;
40295
40306
  })
40296
40307
  .on(next, 'pointerdown', function () {
40297
- jodit.e.fire('searchNext');
40308
+ void jodit.e.fire('searchNext');
40298
40309
  return false;
40299
40310
  })
40300
40311
  .on(prev, 'pointerdown', function () {
@@ -40304,20 +40315,32 @@ var UISearch = /** @class */ (function (_super) {
40304
40315
  .on(_this.queryInput, 'input', function () {
40305
40316
  _this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.trim)(_this.queryInput.value).length);
40306
40317
  })
40307
- .on(_this.queryInput, 'keydown', _this.j.async.debounce(function (e) {
40308
- switch (e.key) {
40309
- case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER:
40310
- e.preventDefault();
40311
- e.stopImmediatePropagation();
40312
- if (jodit.e.fire('searchNext')) {
40313
- _this.close();
40314
- }
40315
- break;
40316
- default:
40317
- jodit.e.fire(_this, 'needUpdateCounters');
40318
- break;
40319
- }
40320
- }, _this.j.defaultTimeout));
40318
+ .on(_this.queryInput, 'keydown', _this.j.async.debounce(function (e) { return (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__awaiter */ .sH)(_this, void 0, void 0, function () {
40319
+ var _a;
40320
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__generator */ .YH)(this, function (_b) {
40321
+ switch (_b.label) {
40322
+ case 0:
40323
+ _a = e.key;
40324
+ switch (_a) {
40325
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER: return [3 /*break*/, 1];
40326
+ }
40327
+ return [3 /*break*/, 3];
40328
+ case 1:
40329
+ e.preventDefault();
40330
+ e.stopImmediatePropagation();
40331
+ return [4 /*yield*/, jodit.e.fire('searchNext')];
40332
+ case 2:
40333
+ if (_b.sent()) {
40334
+ this.close();
40335
+ }
40336
+ return [3 /*break*/, 4];
40337
+ case 3:
40338
+ jodit.e.fire(this, 'needUpdateCounters');
40339
+ return [3 /*break*/, 4];
40340
+ case 4: return [2 /*return*/];
40341
+ }
40342
+ });
40343
+ }); }, _this.j.defaultTimeout));
40321
40344
  return _this;
40322
40345
  }
40323
40346
  UISearch.prototype.className = function () {
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.2.32
4
+ * Version: v4.2.33
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.2.32
11
+ * Version: v4.2.33
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */