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/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.39
4
+ * Version: v4.2.40
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.39";
1738
+ const APP_VERSION = "4.2.40";
1739
1739
  // prettier-ignore
1740
1740
  const ES = "es2015";
1741
1741
  const IS_ES_MODERN = true;
@@ -13427,6 +13427,7 @@ const JODIT_EVENTS_ON_HIDE = [
13427
13427
  'changePlace.tooltip',
13428
13428
  'afterOpenPopup.tooltip',
13429
13429
  'hidePopup.tooltip',
13430
+ 'beforePopupClose.tooltip',
13430
13431
  'closeAllPopups.tooltip'
13431
13432
  ];
13432
13433
  let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__/* .UIElement */ .D {
@@ -13439,6 +13440,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13439
13440
  constructor(view) {
13440
13441
  super(view);
13441
13442
  this.__isOpened = false;
13443
+ this.__attachedContainers = new Set();
13442
13444
  this.__listenClose = false;
13443
13445
  this.__currentTarget = null;
13444
13446
  this.__delayShowTimeout = 0;
@@ -13457,7 +13459,16 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13457
13459
  __onAttach(container) {
13458
13460
  // TODO Move it inside __show method. Now it is here because testcase failed with capturing
13459
13461
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13460
- this.j.e.on(container, 'mouseenter.tooltip', this.__onMouseEnter, {
13462
+ this.__attachedContainers.add(container);
13463
+ this.__attachedContainers.add(this.j.container);
13464
+ this.j.e
13465
+ .on(container, 'mouseenter.tooltip', this.__onMouseEnter, {
13466
+ capture: true
13467
+ })
13468
+ .on(container, 'mouseleave.tooltip', this.__onMouseLeave, {
13469
+ capture: true
13470
+ })
13471
+ .on(this.j.container, 'mouseleave.tooltip', this.__onMouseLeave, {
13461
13472
  capture: true
13462
13473
  });
13463
13474
  }
@@ -13469,10 +13480,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13469
13480
  const view = this.j;
13470
13481
  view.e
13471
13482
  .on(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
13472
- .on(JODIT_EVENTS_ON_HIDE, this.__hide)
13473
- .on(view.container, 'mouseleave.tooltip', this.__onMouseLeave, {
13474
- capture: true
13475
- });
13483
+ .on(JODIT_EVENTS_ON_HIDE, this.__hide);
13476
13484
  }
13477
13485
  __removeListenersOnLeave() {
13478
13486
  if (!this.__listenClose) {
@@ -13482,8 +13490,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13482
13490
  const view = this.j;
13483
13491
  view.e
13484
13492
  .off(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
13485
- .off(JODIT_EVENTS_ON_HIDE, this.__hide)
13486
- .off(view.container, 'mouseleave.tooltip', this.__onMouseLeave);
13493
+ .off(JODIT_EVENTS_ON_HIDE, this.__hide);
13487
13494
  }
13488
13495
  __onMouseLeave(e) {
13489
13496
  if (this.__currentTarget === e.target) {
@@ -13560,7 +13567,11 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13560
13567
  this.__hideTimeout = this.async.setTimeout(this.__hide, this.j.defaultTimeout);
13561
13568
  }
13562
13569
  destruct() {
13563
- this.j.e.off(this.j.container, 'mouseenter.tooltip', this.__onMouseEnter);
13570
+ this.__attachedContainers.forEach(container => {
13571
+ this.j.e
13572
+ .off(container, 'mouseenter.tooltip', this.__onMouseEnter)
13573
+ .off(container, 'mouseleave.tooltip', this.__onMouseLeave);
13574
+ });
13564
13575
  this.__hide();
13565
13576
  super.destruct();
13566
13577
  }
@@ -15760,17 +15771,18 @@ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__/* .
15760
15771
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15761
15772
  /* harmony export */ T: function() { return /* binding */ ViewWithToolbar; }
15762
15773
  /* harmony export */ });
15763
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31635);
15774
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(31635);
15764
15775
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64567);
15765
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(26318);
15776
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(26318);
15766
15777
  /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
15767
15778
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55186);
15768
15779
  /* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32709);
15769
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
15780
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98253);
15770
15781
  /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58720);
15771
- /* harmony import */ var jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(39611);
15772
- /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77782);
15773
- /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8809);
15782
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53048);
15783
+ /* harmony import */ var jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39611);
15784
+ /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(77782);
15785
+ /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8809);
15774
15786
  /*!
15775
15787
  * Jodit Editor (https://xdsoft.net/jodit/)
15776
15788
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -15788,13 +15800,14 @@ class ProgressBar extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_1__/* .
15788
15800
 
15789
15801
 
15790
15802
 
15791
- class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/* .View */ .S {
15803
+
15804
+ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_6__/* .View */ .S {
15792
15805
  /**
15793
15806
  * Container for toolbar
15794
15807
  */
15795
15808
  get toolbarContainer() {
15796
15809
  if (!this.o.fullsize &&
15797
- ((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))) {
15810
+ ((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))) {
15798
15811
  return (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_4__/* .resolveElement */ .tI)(this.o.toolbar, this.o.shadowRoot || this.od);
15799
15812
  }
15800
15813
  this.o.toolbar &&
@@ -15866,7 +15879,7 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15866
15879
  beforeToolbarBuild(items) {
15867
15880
  if (Object.keys(this.groupToButtons).length) {
15868
15881
  return items.map(item => {
15869
- if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_8__/* .isButtonGroup */ .i)(item) &&
15882
+ if ((0,jodit_core_ui_helpers_buttons__WEBPACK_IMPORTED_MODULE_9__/* .isButtonGroup */ .i)(item) &&
15870
15883
  item.group &&
15871
15884
  this.groupToButtons[item.group]) {
15872
15885
  return {
@@ -15884,11 +15897,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15884
15897
  /** @override **/
15885
15898
  constructor(options, isJodit = false) {
15886
15899
  super(options, isJodit);
15887
- this.toolbar = (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_6__/* .makeCollection */ .$K)(this);
15900
+ this.toolbar = (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_7__/* .makeCollection */ .$K)(this);
15888
15901
  this.__defaultToolbarContainer = this.c.div('jodit-toolbar__box');
15889
15902
  this.registeredButtons = new Set();
15890
15903
  this.groupToButtons = {};
15891
15904
  this.isJodit = false;
15905
+ this.__tooltip = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_5__/* .UITooltip */ .SB(this);
15892
15906
  this.isJodit = isJodit;
15893
15907
  this.e.on('beforeToolbarBuild', this.beforeToolbarBuild);
15894
15908
  }
@@ -15898,17 +15912,18 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15898
15912
  }
15899
15913
  this.setStatus(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.beforeDestruct);
15900
15914
  this.e.off('beforeToolbarBuild', this.beforeToolbarBuild);
15915
+ this.__tooltip.destruct();
15901
15916
  this.toolbar.destruct();
15902
15917
  // @ts-ignore After destruct, we are not responsible for anything
15903
15918
  this.toolbar = undefined;
15904
15919
  super.destruct();
15905
15920
  }
15906
15921
  }
15907
- (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15922
+ (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__decorate */ .Cg)([
15908
15923
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':rebuildToolbar')
15909
15924
  ], ViewWithToolbar.prototype, "buildToolbar", null);
15910
- (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15911
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Ay
15925
+ (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__decorate */ .Cg)([
15926
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Ay
15912
15927
  ], ViewWithToolbar.prototype, "beforeToolbarBuild", null);
15913
15928
 
15914
15929
 
@@ -23600,7 +23615,6 @@ let ToolbarCollection = class ToolbarCollection extends jodit_core_ui__WEBPACK_I
23600
23615
  super(jodit);
23601
23616
  this.__listenEvents = 'updatePlugins updateToolbar changeStack mousedown mouseup keydown change afterInit readonly afterResize ' +
23602
23617
  'selectionchange changeSelection focus afterSetMode touchstart focus blur';
23603
- this.__tooltip = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__/* .UITooltip */ .SB(this.jodit);
23604
23618
  }
23605
23619
  __initEvents() {
23606
23620
  this.j.e
@@ -23627,12 +23641,9 @@ let ToolbarCollection = class ToolbarCollection extends jodit_core_ui__WEBPACK_I
23627
23641
  }
23628
23642
  /** @override **/
23629
23643
  destruct() {
23630
- var _a;
23631
23644
  if (this.isDestructed) {
23632
23645
  return;
23633
23646
  }
23634
- (_a = this.__tooltip) === null || _a === void 0 ? void 0 : _a.destruct();
23635
- this.__tooltip = null;
23636
23647
  this.j.e
23637
23648
  .off(this.__listenEvents, this.update)
23638
23649
  .off('afterSetMode focus', this.__immediateUpdate);
@@ -29617,9 +29628,11 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .fg.add('enter
29617
29628
  */
29618
29629
  function checkBR(fake, jodit, shiftKeyPressed) {
29619
29630
  const isMultiLineBlock = Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(fake, ['pre', 'blockquote'], jodit.editor));
29631
+ const isCell = !isMultiLineBlock && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(fake, ['td', 'th'], jodit.editor);
29620
29632
  const isBRMode = jodit.o.enter.toLowerCase() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.BR.toLowerCase();
29621
29633
  // if you use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
29622
29634
  if (isBRMode ||
29635
+ isCell ||
29623
29636
  (shiftKeyPressed && !isMultiLineBlock) ||
29624
29637
  (!shiftKeyPressed && isMultiLineBlock)) {
29625
29638
  // 2 BR before
@@ -33116,6 +33129,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('inden
33116
33129
 
33117
33130
 
33118
33131
 
33132
+ // import 'jodit/plugins/debug/debug';
33119
33133
 
33120
33134
 
33121
33135
 
@@ -33745,10 +33759,10 @@ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plug
33745
33759
  if (!this.j.o.toolbarInlineForSelection) {
33746
33760
  return;
33747
33761
  }
33748
- const type = 'selection', sel = this.j.s.sel, range = this.j.s.range;
33749
- if ((sel === null || sel === void 0 ? void 0 : sel.isCollapsed) ||
33750
- this.isSelectedTarget(range) ||
33751
- this.tableModule.getAllSelectedCells().length) {
33762
+ const type = 'selection';
33763
+ const sel = this.j.s.sel;
33764
+ const range = this.j.s.range;
33765
+ if ((sel === null || sel === void 0 ? void 0 : sel.isCollapsed) || this.isSelectedTarget(range)) {
33752
33766
  if (this.type === type && this.popup.isOpened) {
33753
33767
  this.hidePopup();
33754
33768
  }
@@ -33773,9 +33787,9 @@ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plug
33773
33787
  /**
33774
33788
  * Shortcut for Table module
33775
33789
  */
33776
- get tableModule() {
33777
- return this.j.getInstance('Table', this.j.o);
33778
- }
33790
+ // private get tableModule(): Table {
33791
+ // return this.j.getInstance<Table>('Table', this.j.o);
33792
+ // }
33779
33793
  /** @override **/
33780
33794
  beforeDestruct(jodit) {
33781
33795
  jodit.e