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/es2018/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
  */
@@ -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.47";
1738
+ const APP_VERSION = "4.2.49";
1739
1739
  // prettier-ignore
1740
1740
  const ES = "es2018";
1741
1741
  const IS_ES_MODERN = true;
@@ -39673,6 +39673,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39673
39673
  * Manually change height
39674
39674
  */
39675
39675
  __setHeight(height) {
39676
+ const { clientHeight, clientWidth } = this.j.container;
39676
39677
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(height)) {
39677
39678
  const { minHeight, maxHeight } = this.j.o;
39678
39679
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(minHeight) && minHeight > height) {
@@ -39686,12 +39687,13 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39686
39687
  if (this.j.o.saveHeightInStorage) {
39687
39688
  this.j.storage.set('height', height);
39688
39689
  }
39689
- this.__resizeWorkspaceImd();
39690
+ this.__resizeWorkspaceImd({ clientHeight, clientWidth });
39690
39691
  }
39691
39692
  /**
39692
39693
  * Manually change width
39693
39694
  */
39694
39695
  __setWidth(width) {
39696
+ const { clientHeight, clientWidth } = this.j.container;
39695
39697
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(width)) {
39696
39698
  const { minWidth, maxWidth } = this.j.o;
39697
39699
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(minWidth) && minWidth > width) {
@@ -39702,7 +39704,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39702
39704
  }
39703
39705
  }
39704
39706
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__/* .css */ .A)(this.j.container, 'width', width);
39705
- this.__resizeWorkspaceImd();
39707
+ this.__resizeWorkspaceImd({ clientHeight, clientWidth });
39706
39708
  }
39707
39709
  /**
39708
39710
  * Returns service spaces: toolbar + statusbar
@@ -39716,7 +39718,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39716
39718
  /**
39717
39719
  * Calculate workspace height
39718
39720
  */
39719
- __resizeWorkspaceImd() {
39721
+ __resizeWorkspaceImd({ clientHeight, clientWidth } = this.j.container) {
39720
39722
  if (!this.j || this.j.isDestructed || !this.j.o || this.j.o.inline) {
39721
39723
  return;
39722
39724
  }
@@ -39743,6 +39745,11 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
39743
39745
  ? this.j.container.offsetHeight - this.__getNotWorkHeight()
39744
39746
  : 'auto');
39745
39747
  }
39748
+ const { clientHeight: newClientHeight, clientWidth: newClientWidth } = this.j.container;
39749
+ if (clientHeight !== newClientHeight ||
39750
+ clientWidth !== newClientWidth) {
39751
+ this.j.e.fire(this.j, 'resize');
39752
+ }
39746
39753
  }
39747
39754
  /** @override **/
39748
39755
  beforeDestruct(jodit) {
@@ -39941,10 +39948,12 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39941
39948
  if (editor.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
39942
39949
  this.setValue(this.getValue());
39943
39950
  }
39944
- const onResize = this.j.async.debounce(() => {
39945
- if (editor.isInDestruct) {
39951
+ const onResize = this.j.async.throttle(() => {
39952
+ if (editor.isInDestruct ||
39953
+ editor.getMode() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
39946
39954
  return;
39947
39955
  }
39956
+ const hasFocus = this.instance.isFocused();
39948
39957
  if (editor.o.height !== 'auto') {
39949
39958
  this.instance.setOption('maxLines', editor.workplace.offsetHeight /
39950
39959
  this.instance.renderer.lineHeight);
@@ -39953,8 +39962,11 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39953
39962
  this.instance.setOption('maxLines', Infinity);
39954
39963
  }
39955
39964
  this.instance.resize();
39965
+ hasFocus && this.focus();
39956
39966
  }, this.j.defaultTimeout * 2);
39957
- editor.e.on('afterResize afterSetMode', onResize);
39967
+ editor.e
39968
+ .on(editor, 'resize', onResize)
39969
+ .on('afterResize afterSetMode', onResize);
39958
39970
  onResize();
39959
39971
  this.onReady();
39960
39972
  };
@@ -40006,6 +40018,7 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
40006
40018
  return this.instance.isFocused();
40007
40019
  }
40008
40020
  focus() {
40021
+ this.instance.container.focus();
40009
40022
  this.instance.focus();
40010
40023
  }
40011
40024
  blur() {