jodit 4.2.46 → 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 (66) 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 +24 -11
  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 +24 -11
  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 +24 -11
  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 +24 -11
  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 +27 -13
  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/core/view/view.js +3 -3
  60. package/esm/jodit.d.ts +3 -3
  61. package/esm/plugins/size/size.js +10 -3
  62. package/esm/plugins/source/editor/engines/ace.js +9 -3
  63. package/esm/types/types.d.ts +3 -0
  64. package/package.json +1 -1
  65. package/types/jodit.d.ts +3 -3
  66. package/types/types/types.d.ts +3 -0
@@ -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.46
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.46";
1739
+ const APP_VERSION = "4.2.49";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2021";
1742
1742
  const IS_ES_MODERN = true;
@@ -16242,11 +16242,11 @@ let View = View_1 = class View extends jodit_core_component_component__WEBPACK_I
16242
16242
  super.destruct();
16243
16243
  }
16244
16244
  };
16245
- // from webpack.config.js
16245
+ // from webpack.config.ts
16246
16246
  View.ES = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.ES;
16247
16247
  View.version = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.APP_VERSION;
16248
- View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.js
16249
- View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.js
16248
+ View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.ts
16249
+ View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.ts
16250
16250
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16251
16251
  jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16252
16252
  ], View.prototype, "buffer", null);
@@ -38671,6 +38671,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
38671
38671
  * Manually change height
38672
38672
  */
38673
38673
  __setHeight(height) {
38674
+ const { clientHeight, clientWidth } = this.j.container;
38674
38675
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(height)) {
38675
38676
  const { minHeight, maxHeight } = this.j.o;
38676
38677
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(minHeight) && minHeight > height) {
@@ -38684,12 +38685,13 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
38684
38685
  if (this.j.o.saveHeightInStorage) {
38685
38686
  this.j.storage.set('height', height);
38686
38687
  }
38687
- this.__resizeWorkspaceImd();
38688
+ this.__resizeWorkspaceImd({ clientHeight, clientWidth });
38688
38689
  }
38689
38690
  /**
38690
38691
  * Manually change width
38691
38692
  */
38692
38693
  __setWidth(width) {
38694
+ const { clientHeight, clientWidth } = this.j.container;
38693
38695
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(width)) {
38694
38696
  const { minWidth, maxWidth } = this.j.o;
38695
38697
  if ((0,jodit_core_helpers_checker_is_number__WEBPACK_IMPORTED_MODULE_5__/* .isNumber */ .E)(minWidth) && minWidth > width) {
@@ -38700,7 +38702,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
38700
38702
  }
38701
38703
  }
38702
38704
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__/* .css */ .A)(this.j.container, 'width', width);
38703
- this.__resizeWorkspaceImd();
38705
+ this.__resizeWorkspaceImd({ clientHeight, clientWidth });
38704
38706
  }
38705
38707
  /**
38706
38708
  * Returns service spaces: toolbar + statusbar
@@ -38713,7 +38715,7 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
38713
38715
  /**
38714
38716
  * Calculate workspace height
38715
38717
  */
38716
- __resizeWorkspaceImd() {
38718
+ __resizeWorkspaceImd({ clientHeight, clientWidth } = this.j.container) {
38717
38719
  if (!this.j || this.j.isDestructed || !this.j.o || this.j.o.inline) {
38718
38720
  return;
38719
38721
  }
@@ -38740,6 +38742,11 @@ let size = class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_
38740
38742
  ? this.j.container.offsetHeight - this.__getNotWorkHeight()
38741
38743
  : 'auto');
38742
38744
  }
38745
+ const { clientHeight: newClientHeight, clientWidth: newClientWidth } = this.j.container;
38746
+ if (clientHeight !== newClientHeight ||
38747
+ clientWidth !== newClientWidth) {
38748
+ this.j.e.fire(this.j, 'resize');
38749
+ }
38743
38750
  }
38744
38751
  /** @override **/
38745
38752
  beforeDestruct(jodit) {
@@ -38938,10 +38945,12 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
38938
38945
  if (editor.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
38939
38946
  this.setValue(this.getValue());
38940
38947
  }
38941
- const onResize = this.j.async.debounce(() => {
38942
- if (editor.isInDestruct) {
38948
+ const onResize = this.j.async.throttle(() => {
38949
+ if (editor.isInDestruct ||
38950
+ editor.getMode() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
38943
38951
  return;
38944
38952
  }
38953
+ const hasFocus = this.instance.isFocused();
38945
38954
  if (editor.o.height !== 'auto') {
38946
38955
  this.instance.setOption('maxLines', editor.workplace.offsetHeight /
38947
38956
  this.instance.renderer.lineHeight);
@@ -38950,8 +38959,11 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
38950
38959
  this.instance.setOption('maxLines', Infinity);
38951
38960
  }
38952
38961
  this.instance.resize();
38962
+ hasFocus && this.focus();
38953
38963
  }, this.j.defaultTimeout * 2);
38954
- editor.e.on('afterResize afterSetMode', onResize);
38964
+ editor.e
38965
+ .on(editor, 'resize', onResize)
38966
+ .on('afterResize afterSetMode', onResize);
38955
38967
  onResize();
38956
38968
  this.onReady();
38957
38969
  };
@@ -39002,6 +39014,7 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39002
39014
  return this.instance.isFocused();
39003
39015
  }
39004
39016
  focus() {
39017
+ this.instance.container.focus();
39005
39018
  this.instance.focus();
39006
39019
  }
39007
39020
  blur() {