jodit 4.2.39 → 4.2.40

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 (88) hide show
  1. package/CHANGELOG.md +18 -9
  2. package/es2015/jodit.css +7 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +48 -34
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.css +53 -0
  9. package/es2015/plugins/debug/debug.js +162 -24
  10. package/es2015/plugins/debug/debug.min.css +1 -0
  11. package/es2015/plugins/debug/debug.min.js +2 -2
  12. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  14. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  15. package/es2018/jodit.css +7 -1
  16. package/es2018/jodit.fat.min.css +1 -1
  17. package/es2018/jodit.fat.min.js +2 -2
  18. package/es2018/jodit.js +48 -34
  19. package/es2018/jodit.min.css +1 -1
  20. package/es2018/jodit.min.js +2 -2
  21. package/es2018/plugins/debug/debug.css +53 -0
  22. package/es2018/plugins/debug/debug.js +162 -24
  23. package/es2018/plugins/debug/debug.min.css +1 -0
  24. package/es2018/plugins/debug/debug.min.js +2 -2
  25. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  26. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  27. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  28. package/es2021/jodit.css +7 -1
  29. package/es2021/jodit.fat.min.css +1 -1
  30. package/es2021/jodit.fat.min.js +2 -2
  31. package/es2021/jodit.js +48 -33
  32. package/es2021/jodit.min.css +1 -1
  33. package/es2021/jodit.min.js +2 -2
  34. package/es2021/plugins/debug/debug.css +53 -0
  35. package/es2021/plugins/debug/debug.js +161 -24
  36. package/es2021/plugins/debug/debug.min.css +1 -0
  37. package/es2021/plugins/debug/debug.min.js +2 -2
  38. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  39. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  40. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  41. package/es2021.en/jodit.css +7 -1
  42. package/es2021.en/jodit.fat.min.css +1 -1
  43. package/es2021.en/jodit.fat.min.js +2 -2
  44. package/es2021.en/jodit.js +48 -33
  45. package/es2021.en/jodit.min.css +1 -1
  46. package/es2021.en/jodit.min.js +2 -2
  47. package/es2021.en/plugins/debug/debug.css +53 -0
  48. package/es2021.en/plugins/debug/debug.js +161 -24
  49. package/es2021.en/plugins/debug/debug.min.css +1 -0
  50. package/es2021.en/plugins/debug/debug.min.js +2 -2
  51. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  52. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  53. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  54. package/es5/164.fat.min.js +1 -1
  55. package/es5/164.min.js +1 -1
  56. package/es5/5.fat.min.js +1 -1
  57. package/es5/5.min.js +1 -1
  58. package/es5/jodit.css +11 -2
  59. package/es5/jodit.fat.min.css +1 -1
  60. package/es5/jodit.fat.min.js +2 -2
  61. package/es5/jodit.js +54 -43
  62. package/es5/jodit.min.css +3 -3
  63. package/es5/jodit.min.js +2 -2
  64. package/es5/plugins/debug/debug.css +53 -0
  65. package/es5/plugins/debug/debug.js +161 -24
  66. package/es5/plugins/debug/debug.min.css +1 -0
  67. package/es5/plugins/debug/debug.min.js +2 -2
  68. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  69. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  70. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  71. package/esm/core/constants.js +1 -1
  72. package/esm/core/ui/button/tooltip/tooltip.d.ts +1 -0
  73. package/esm/core/ui/button/tooltip/tooltip.js +19 -8
  74. package/esm/core/view/view-with-toolbar.d.ts +1 -0
  75. package/esm/core/view/view-with-toolbar.js +3 -0
  76. package/esm/modules/toolbar/collection/collection.d.ts +0 -1
  77. package/esm/modules/toolbar/collection/collection.js +1 -4
  78. package/esm/plugins/debug/debug.d.ts +1 -0
  79. package/esm/plugins/enter/helpers/check-br.js +2 -0
  80. package/esm/plugins/index.js +1 -0
  81. package/esm/plugins/inline-popup/inline-popup.d.ts +0 -1
  82. package/esm/plugins/inline-popup/inline-popup.js +7 -7
  83. package/package.json +1 -1
  84. package/types/core/ui/button/tooltip/tooltip.d.ts +1 -0
  85. package/types/core/view/view-with-toolbar.d.ts +1 -0
  86. package/types/modules/toolbar/collection/collection.d.ts +0 -1
  87. package/types/plugins/debug/debug.d.ts +1 -0
  88. package/types/plugins/inline-popup/inline-popup.d.ts +0 -1
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.39
4
+ * Version: v4.2.40
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.39";
1739
+ const APP_VERSION = "4.2.40";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2021";
1742
1742
  const IS_ES_MODERN = true;
@@ -13410,6 +13410,7 @@ const JODIT_EVENTS_ON_HIDE = [
13410
13410
  'changePlace.tooltip',
13411
13411
  'afterOpenPopup.tooltip',
13412
13412
  'hidePopup.tooltip',
13413
+ 'beforePopupClose.tooltip',
13413
13414
  'closeAllPopups.tooltip'
13414
13415
  ];
13415
13416
  let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__/* .UIElement */ .D {
@@ -13422,6 +13423,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13422
13423
  constructor(view) {
13423
13424
  super(view);
13424
13425
  this.__isOpened = false;
13426
+ this.__attachedContainers = new Set();
13425
13427
  this.__listenClose = false;
13426
13428
  this.__currentTarget = null;
13427
13429
  this.__delayShowTimeout = 0;
@@ -13440,7 +13442,16 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13440
13442
  __onAttach(container) {
13441
13443
  // TODO Move it inside __show method. Now it is here because testcase failed with capturing
13442
13444
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13443
- this.j.e.on(container, 'mouseenter.tooltip', this.__onMouseEnter, {
13445
+ this.__attachedContainers.add(container);
13446
+ this.__attachedContainers.add(this.j.container);
13447
+ this.j.e
13448
+ .on(container, 'mouseenter.tooltip', this.__onMouseEnter, {
13449
+ capture: true
13450
+ })
13451
+ .on(container, 'mouseleave.tooltip', this.__onMouseLeave, {
13452
+ capture: true
13453
+ })
13454
+ .on(this.j.container, 'mouseleave.tooltip', this.__onMouseLeave, {
13444
13455
  capture: true
13445
13456
  });
13446
13457
  }
@@ -13452,10 +13463,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13452
13463
  const view = this.j;
13453
13464
  view.e
13454
13465
  .on(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
13455
- .on(JODIT_EVENTS_ON_HIDE, this.__hide)
13456
- .on(view.container, 'mouseleave.tooltip', this.__onMouseLeave, {
13457
- capture: true
13458
- });
13466
+ .on(JODIT_EVENTS_ON_HIDE, this.__hide);
13459
13467
  }
13460
13468
  __removeListenersOnLeave() {
13461
13469
  if (!this.__listenClose) {
@@ -13465,8 +13473,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13465
13473
  const view = this.j;
13466
13474
  view.e
13467
13475
  .off(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
13468
- .off(JODIT_EVENTS_ON_HIDE, this.__hide)
13469
- .off(view.container, 'mouseleave.tooltip', this.__onMouseLeave);
13476
+ .off(JODIT_EVENTS_ON_HIDE, this.__hide);
13470
13477
  }
13471
13478
  __onMouseLeave(e) {
13472
13479
  if (this.__currentTarget === e.target) {
@@ -13543,7 +13550,11 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13543
13550
  this.__hideTimeout = this.async.setTimeout(this.__hide, this.j.defaultTimeout);
13544
13551
  }
13545
13552
  destruct() {
13546
- this.j.e.off(this.j.container, 'mouseenter.tooltip', this.__onMouseEnter);
13553
+ this.__attachedContainers.forEach(container => {
13554
+ this.j.e
13555
+ .off(container, 'mouseenter.tooltip', this.__onMouseEnter)
13556
+ .off(container, 'mouseleave.tooltip', this.__onMouseLeave);
13557
+ });
13547
13558
  this.__hide();
13548
13559
  super.destruct();
13549
13560
  }
@@ -15762,17 +15773,18 @@ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__/* .
15762
15773
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15763
15774
  /* harmony export */ T: function() { return /* binding */ ViewWithToolbar; }
15764
15775
  /* harmony export */ });
15765
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31635);
15776
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(31635);
15766
15777
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64567);
15767
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26318);
15778
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(26318);
15768
15779
  /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
15769
15780
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55186);
15770
15781
  /* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32709);
15771
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
15782
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98253);
15772
15783
  /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58720);
15773
- /* harmony import */ var jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(39611);
15774
- /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77782);
15775
- /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8809);
15784
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53048);
15785
+ /* harmony import */ var jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39611);
15786
+ /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(77782);
15787
+ /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8809);
15776
15788
  /*!
15777
15789
  * Jodit Editor (https://xdsoft.net/jodit/)
15778
15790
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -15790,13 +15802,14 @@ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__/* .
15790
15802
 
15791
15803
 
15792
15804
 
15793
- class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/* .View */ .S {
15805
+
15806
+ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_6__/* .View */ .S {
15794
15807
  /**
15795
15808
  * Container for toolbar
15796
15809
  */
15797
15810
  get toolbarContainer() {
15798
15811
  if (!this.o.fullsize &&
15799
- ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(this.o.toolbar) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isHTMLElement(this.o.toolbar))) {
15812
+ ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__/* .isString */ .K)(this.o.toolbar) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isHTMLElement(this.o.toolbar))) {
15800
15813
  return (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_4__/* .resolveElement */ .tI)(this.o.toolbar, this.o.shadowRoot || this.od);
15801
15814
  }
15802
15815
  this.o.toolbar &&
@@ -15868,7 +15881,7 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15868
15881
  beforeToolbarBuild(items) {
15869
15882
  if (Object.keys(this.groupToButtons).length) {
15870
15883
  return items.map(item => {
15871
- if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_8__/* .isButtonGroup */ .i)(item) &&
15884
+ if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_9__/* .isButtonGroup */ .i)(item) &&
15872
15885
  item.group &&
15873
15886
  this.groupToButtons[item.group]) {
15874
15887
  return {
@@ -15886,11 +15899,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15886
15899
  /** @override **/
15887
15900
  constructor(options, isJodit = false) {
15888
15901
  super(options, isJodit);
15889
- this.toolbar = (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_6__/* .makeCollection */ .$K)(this);
15902
+ this.toolbar = (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_7__/* .makeCollection */ .$K)(this);
15890
15903
  this.__defaultToolbarContainer = this.c.div('jodit-toolbar__box');
15891
15904
  this.registeredButtons = new Set();
15892
15905
  this.groupToButtons = {};
15893
15906
  this.isJodit = false;
15907
+ this.__tooltip = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_5__/* .UITooltip */ .SB(this);
15894
15908
  this.isJodit = isJodit;
15895
15909
  this.e.on('beforeToolbarBuild', this.beforeToolbarBuild);
15896
15910
  }
@@ -15900,17 +15914,18 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15900
15914
  }
15901
15915
  this.setStatus(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.beforeDestruct);
15902
15916
  this.e.off('beforeToolbarBuild', this.beforeToolbarBuild);
15917
+ this.__tooltip.destruct();
15903
15918
  this.toolbar.destruct();
15904
15919
  // @ts-ignore After destruct, we are not responsible for anything
15905
15920
  this.toolbar = undefined;
15906
15921
  super.destruct();
15907
15922
  }
15908
15923
  }
15909
- (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15924
+ (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__decorate */ .Cg)([
15910
15925
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':rebuildToolbar')
15911
15926
  ], ViewWithToolbar.prototype, "buildToolbar", null);
15912
- (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15913
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Ay
15927
+ (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__decorate */ .Cg)([
15928
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay
15914
15929
  ], ViewWithToolbar.prototype, "beforeToolbarBuild", null);
15915
15930
 
15916
15931
 
@@ -23598,7 +23613,6 @@ let ToolbarCollection = class ToolbarCollection extends jodit_core_ui__WEBPACK_I
23598
23613
  super(jodit);
23599
23614
  this.__listenEvents = 'updatePlugins updateToolbar changeStack mousedown mouseup keydown change afterInit readonly afterResize ' +
23600
23615
  'selectionchange changeSelection focus afterSetMode touchstart focus blur';
23601
- this.__tooltip = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__/* .UITooltip */ .SB(this.jodit);
23602
23616
  }
23603
23617
  __initEvents() {
23604
23618
  this.j.e
@@ -23628,8 +23642,6 @@ let ToolbarCollection = class ToolbarCollection extends jodit_core_ui__WEBPACK_I
23628
23642
  if (this.isDestructed) {
23629
23643
  return;
23630
23644
  }
23631
- this.__tooltip?.destruct();
23632
- this.__tooltip = null;
23633
23645
  this.j.e
23634
23646
  .off(this.__listenEvents, this.update)
23635
23647
  .off('afterSetMode focus', this.__immediateUpdate);
@@ -29606,9 +29618,11 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('enter
29606
29618
  */
29607
29619
  function checkBR(fake, jodit, shiftKeyPressed) {
29608
29620
  const isMultiLineBlock = Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(fake, ['pre', 'blockquote'], jodit.editor));
29621
+ const isCell = !isMultiLineBlock && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(fake, ['td', 'th'], jodit.editor);
29609
29622
  const isBRMode = jodit.o.enter.toLowerCase() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.BR.toLowerCase();
29610
29623
  // if you use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
29611
29624
  if (isBRMode ||
29625
+ isCell ||
29612
29626
  (shiftKeyPressed && !isMultiLineBlock) ||
29613
29627
  (!shiftKeyPressed && isMultiLineBlock)) {
29614
29628
  // 2 BR before
@@ -33085,6 +33099,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('inden
33085
33099
 
33086
33100
 
33087
33101
 
33102
+ // import 'jodit/plugins/debug/debug';
33088
33103
 
33089
33104
 
33090
33105
 
@@ -33714,10 +33729,10 @@ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plug
33714
33729
  if (!this.j.o.toolbarInlineForSelection) {
33715
33730
  return;
33716
33731
  }
33717
- const type = 'selection', sel = this.j.s.sel, range = this.j.s.range;
33718
- if (sel?.isCollapsed ||
33719
- this.isSelectedTarget(range) ||
33720
- this.tableModule.getAllSelectedCells().length) {
33732
+ const type = 'selection';
33733
+ const sel = this.j.s.sel;
33734
+ const range = this.j.s.range;
33735
+ if (sel?.isCollapsed || this.isSelectedTarget(range)) {
33721
33736
  if (this.type === type && this.popup.isOpened) {
33722
33737
  this.hidePopup();
33723
33738
  }
@@ -33742,9 +33757,9 @@ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plug
33742
33757
  /**
33743
33758
  * Shortcut for Table module
33744
33759
  */
33745
- get tableModule() {
33746
- return this.j.getInstance('Table', this.j.o);
33747
- }
33760
+ // private get tableModule(): Table {
33761
+ // return this.j.getInstance<Table>('Table', this.j.o);
33762
+ // }
33748
33763
  /** @override **/
33749
33764
  beforeDestruct(jodit) {
33750
33765
  jodit.e