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/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.34
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.34";
1739
1739
  // prettier-ignore
1740
1740
  const ES = "es2015";
1741
1741
  const IS_ES_MODERN = true;
@@ -11857,7 +11857,9 @@ function unwrapList(mode, list, li, jodit, cs) {
11857
11857
  (0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_2__/* .extractSelectedPart */ .y)(list, li, jodit);
11858
11858
  void 0;
11859
11859
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.unwrap(li.parentElement);
11860
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.replace(li, jodit.o.enter, jodit.createInside);
11860
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.replace(li, jodit.o.enter.toLowerCase() !== 'br'
11861
+ ? jodit.o.enter
11862
+ : jodit.createInside.fragment(), jodit.createInside);
11861
11863
  }
11862
11864
 
11863
11865
 
@@ -37985,6 +37987,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
37985
37987
  /* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
37986
37988
  /* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
37987
37989
  /* harmony export */ });
37990
+ /* unused harmony export clearNativeSelection */
37988
37991
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
37989
37992
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
37990
37993
  /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58720);
@@ -38046,8 +38049,9 @@ function getSelectionWrappers(root) {
38046
38049
  /**
38047
38050
  * @private
38048
38051
  */
38049
- function clearSelectionWrappers(root) {
38050
- getSelectionWrappers(root).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
38052
+ function clearSelectionWrappers(jodit) {
38053
+ getSelectionWrappers(jodit.editor).forEach(span => jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.unwrap(span));
38054
+ clearNativeSelection(jodit);
38051
38055
  }
38052
38056
  /**
38053
38057
  * @private
@@ -38072,7 +38076,6 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
38072
38076
  range.setEnd(rng.endContainer, rng.endOffset);
38073
38077
  return range;
38074
38078
  });
38075
- // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
38076
38079
  const searchHighlight = new Highlight(...ranges);
38077
38080
  // @ts-ignore
38078
38081
  CSS.highlights.clear();
@@ -38083,6 +38086,15 @@ function checkNativeSelectionMethod(jodit, rng, restRanges) {
38083
38086
  }
38084
38087
  return false;
38085
38088
  }
38089
+ function clearNativeSelection(jodit) {
38090
+ if (jodit.o.search.useCustomHighlightAPI &&
38091
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
38092
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow &&
38093
+ typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.Highlight !== 'undefined') {
38094
+ // @ts-ignore
38095
+ CSS.highlights.clear();
38096
+ }
38097
+ }
38086
38098
  function normalizeRanges(rng, restRanges, ci) {
38087
38099
  const startText = rng.startContainer.nodeValue;
38088
38100
  let diff = 0;
@@ -38257,11 +38269,11 @@ class SentenceFinder {
38257
38269
  *
38258
38270
  * @example
38259
38271
  * ```typescript
38260
- * var jodit = Jodit.make('#editor', {
38272
+ * const jodit = Jodit.make('#editor', {
38261
38273
  * useSearch: false
38262
38274
  * });
38263
38275
  * // or
38264
- * var jodit = Jodit.make('#editor', {
38276
+ * const jodit = Jodit.make('#editor', {
38265
38277
  * disablePlugins: 'search'
38266
38278
  * });
38267
38279
  * ```
@@ -38347,7 +38359,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38347
38359
  rng.deleteContents();
38348
38360
  const textNode = this.j.createInside.text(this.ui.replace);
38349
38361
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeInsertNode(rng, textNode);
38350
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
38362
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
38351
38363
  this.j.s.setCursorAfter(textNode);
38352
38364
  this.tryScrollToElement(textNode);
38353
38365
  this.cache = {};
@@ -38377,7 +38389,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38377
38389
  !(0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .getSelectionWrappers */ .zy)(this.j.editor).length) {
38378
38390
  (_a = this.drawPromise) === null || _a === void 0 ? void 0 : _a.rejectCallback();
38379
38391
  this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
38380
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j.editor);
38392
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(this.j);
38381
38393
  this.drawPromise = this.__drawSelectionRanges(bounds);
38382
38394
  }
38383
38395
  this.previousQuery = query;
@@ -38499,14 +38511,15 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38499
38511
  this.ui.close();
38500
38512
  })
38501
38513
  .on(this.ui, 'afterClose', () => {
38502
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
38514
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
38503
38515
  this.ui.currentIndex = 0;
38504
38516
  this.ui.count = 0;
38505
38517
  this.cache = {};
38518
+ editor.focus();
38506
38519
  })
38507
38520
  .on('click', () => {
38508
38521
  this.ui.currentIndex = 0;
38509
- (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor.editor);
38522
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_7__/* .clearSelectionWrappers */ .IJ)(editor);
38510
38523
  })
38511
38524
  .on('change.search', () => {
38512
38525
  this.cache = {};
@@ -38517,7 +38530,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */
38517
38530
  this.ui.selInfo = null;
38518
38531
  }
38519
38532
  if (this.ui.isOpened) {
38520
- this.updateCounters();
38533
+ void this.updateCounters();
38521
38534
  }
38522
38535
  }, editor.defaultTimeout))
38523
38536
  .on('searchNext.search searchPrevious.search', () => {
@@ -38697,7 +38710,7 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38697
38710
  return false;
38698
38711
  })
38699
38712
  .on(next, 'pointerdown', () => {
38700
- jodit.e.fire('searchNext');
38713
+ void jodit.e.fire('searchNext');
38701
38714
  return false;
38702
38715
  })
38703
38716
  .on(prev, 'pointerdown', () => {
@@ -38707,12 +38720,12 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38707
38720
  .on(this.queryInput, 'input', () => {
38708
38721
  this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.trim)(this.queryInput.value).length);
38709
38722
  })
38710
- .on(this.queryInput, 'keydown', this.j.async.debounce((e) => {
38723
+ .on(this.queryInput, 'keydown', this.j.async.debounce((e) => (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
38711
38724
  switch (e.key) {
38712
38725
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER:
38713
38726
  e.preventDefault();
38714
38727
  e.stopImmediatePropagation();
38715
- if (jodit.e.fire('searchNext')) {
38728
+ if (yield jodit.e.fire('searchNext')) {
38716
38729
  this.close();
38717
38730
  }
38718
38731
  break;
@@ -38720,7 +38733,7 @@ let UISearch = class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__
38720
38733
  jodit.e.fire(this, 'needUpdateCounters');
38721
38734
  break;
38722
38735
  }
38723
- }, this.j.defaultTimeout));
38736
+ }), this.j.defaultTimeout));
38724
38737
  }
38725
38738
  onEditorKeyDown(e) {
38726
38739
  if (!this.isOpened) {