jodit 4.2.47 → 4.2.49

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 (65) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -0
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +21 -8
  6. package/es2015/jodit.min.js +2 -2
  7. package/es2015/plugins/debug/debug.css +1 -1
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +1 -1
  14. package/es2018/jodit.fat.min.js +2 -2
  15. package/es2018/jodit.js +21 -8
  16. package/es2018/jodit.min.js +2 -2
  17. package/es2018/plugins/debug/debug.css +1 -1
  18. package/es2018/plugins/debug/debug.js +1 -1
  19. package/es2018/plugins/debug/debug.min.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  23. package/es2021/jodit.css +1 -1
  24. package/es2021/jodit.fat.min.js +2 -2
  25. package/es2021/jodit.js +21 -8
  26. package/es2021/jodit.min.js +2 -2
  27. package/es2021/plugins/debug/debug.css +1 -1
  28. package/es2021/plugins/debug/debug.js +1 -1
  29. package/es2021/plugins/debug/debug.min.js +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  33. package/es2021.en/jodit.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +2 -2
  35. package/es2021.en/jodit.js +21 -8
  36. package/es2021.en/jodit.min.js +2 -2
  37. package/es2021.en/plugins/debug/debug.css +1 -1
  38. package/es2021.en/plugins/debug/debug.js +1 -1
  39. package/es2021.en/plugins/debug/debug.min.js +1 -1
  40. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  43. package/es5/164.fat.min.js +1 -1
  44. package/es5/164.min.js +1 -1
  45. package/es5/5.fat.min.js +1 -1
  46. package/es5/5.min.js +1 -1
  47. package/es5/jodit.css +2 -2
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +24 -10
  50. package/es5/jodit.min.css +2 -2
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.css +1 -1
  53. package/es5/plugins/debug/debug.js +1 -1
  54. package/es5/plugins/debug/debug.min.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  57. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  58. package/esm/core/constants.js +1 -1
  59. package/esm/jodit.d.ts +3 -3
  60. package/esm/plugins/size/size.js +10 -3
  61. package/esm/plugins/source/editor/engines/ace.js +9 -3
  62. package/esm/types/types.d.ts +3 -0
  63. package/package.json +1 -1
  64. package/types/jodit.d.ts +3 -3
  65. package/types/types/types.d.ts +3 -0
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.47
4
+ * Version: v4.2.49
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.47";
1739
+ const APP_VERSION = "4.2.49";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2021";
1742
1742
  const IS_ES_MODERN = true;
@@ -39556,6 +39556,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39556
39556
  * Manually change height
39557
39557
  */
39558
39558
  __setHeight(height) {
39559
+ const { clientHeight, clientWidth } = this.j.container;
39559
39560
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(height)) {
39560
39561
  const { minHeight, maxHeight } = this.j.o;
39561
39562
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(minHeight) && minHeight > height) {
@@ -39569,12 +39570,13 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39569
39570
  if (this.j.o.saveHeightInStorage) {
39570
39571
  this.j.storage.set('height', height);
39571
39572
  }
39572
- this.__resizeWorkspaceImd();
39573
+ this.__resizeWorkspaceImd({ clientHeight, clientWidth });
39573
39574
  }
39574
39575
  /**
39575
39576
  * Manually change width
39576
39577
  */
39577
39578
  __setWidth(width) {
39579
+ const { clientHeight, clientWidth } = this.j.container;
39578
39580
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(width)) {
39579
39581
  const { minWidth, maxWidth } = this.j.o;
39580
39582
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(minWidth) && minWidth > width) {
@@ -39585,7 +39587,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39585
39587
  }
39586
39588
  }
39587
39589
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__/* .css */ .A)(this.j.container, 'width', width);
39588
- this.__resizeWorkspaceImd();
39590
+ this.__resizeWorkspaceImd({ clientHeight, clientWidth });
39589
39591
  }
39590
39592
  /**
39591
39593
  * Returns service spaces: toolbar + statusbar
@@ -39598,7 +39600,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39598
39600
  /**
39599
39601
  * Calculate workspace height
39600
39602
  */
39601
- __resizeWorkspaceImd() {
39603
+ __resizeWorkspaceImd({ clientHeight, clientWidth } = this.j.container) {
39602
39604
  if (!this.j || this.j.isDestructed || !this.j.o || this.j.o.inline) {
39603
39605
  return;
39604
39606
  }
@@ -39625,6 +39627,11 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39625
39627
  ? this.j.container.offsetHeight - this.__getNotWorkHeight()
39626
39628
  : 'auto');
39627
39629
  }
39630
+ const { clientHeight: newClientHeight, clientWidth: newClientWidth } = this.j.container;
39631
+ if (clientHeight !== newClientHeight ||
39632
+ clientWidth !== newClientWidth) {
39633
+ this.j.e.fire(this.j, 'resize');
39634
+ }
39628
39635
  }
39629
39636
  /** @override **/
39630
39637
  beforeDestruct(jodit) {
@@ -39823,10 +39830,12 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39823
39830
  if (editor.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
39824
39831
  this.setValue(this.getValue());
39825
39832
  }
39826
- const onResize = this.j.async.debounce(() => {
39827
- if (editor.isInDestruct) {
39833
+ const onResize = this.j.async.throttle(() => {
39834
+ if (editor.isInDestruct ||
39835
+ editor.getMode() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
39828
39836
  return;
39829
39837
  }
39838
+ const hasFocus = this.instance.isFocused();
39830
39839
  if (editor.o.height !== 'auto') {
39831
39840
  this.instance.setOption('maxLines', editor.workplace.offsetHeight /
39832
39841
  this.instance.renderer.lineHeight);
@@ -39835,8 +39844,11 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39835
39844
  this.instance.setOption('maxLines', Infinity);
39836
39845
  }
39837
39846
  this.instance.resize();
39847
+ hasFocus && this.focus();
39838
39848
  }, this.j.defaultTimeout * 2);
39839
- editor.e.on('afterResize afterSetMode', onResize);
39849
+ editor.e
39850
+ .on(editor, 'resize', onResize)
39851
+ .on('afterResize afterSetMode', onResize);
39840
39852
  onResize();
39841
39853
  this.onReady();
39842
39854
  };
@@ -39887,6 +39899,7 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39887
39899
  return this.instance.isFocused();
39888
39900
  }
39889
39901
  focus() {
39902
+ this.instance.container.focus();
39890
39903
  this.instance.focus();
39891
39904
  }
39892
39905
  blur() {