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
@@ -0,0 +1,53 @@
1
+ /*!
2
+ * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
+ * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
+ * Version: v4.2.40
5
+ * Url: https://xdsoft.net/jodit/
6
+ * License(s): MIT
7
+ */
8
+
9
+ .jodit-debug {
10
+ background: #f6f6f6;
11
+ position: relative;
12
+ padding: 0;
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: stretch;
16
+ }
17
+ .jodit-debug > * {
18
+ padding: var(--jd-padding-default);
19
+ }
20
+ .jodit-debug__tree {
21
+ width: 40%;
22
+ }
23
+ .jodit-debug__tree .jodit-debug__tree-elm-name {
24
+ color: #052e88;
25
+ }
26
+ .jodit-debug__tree .jodit-debug__tree-element_selected {
27
+ background: #1e7e34;
28
+ color: #fff;
29
+ }
30
+ .jodit-debug__tree .jodit-debug__tree-cursor {
31
+ background: #dc3232;
32
+ color: #fff;
33
+ }
34
+ .jodit-debug__events {
35
+ width: 40%;
36
+ max-height: 500px;
37
+ overflow: auto;
38
+ background: #1e7e34;
39
+ color: #fff;
40
+ }
41
+ .jodit-debug__events span {
42
+ color: #cacaca;
43
+ font-size: 0.8em;
44
+ }
45
+ .jodit-debug__events .jodit-debug__events-clear {
46
+ position: absolute;
47
+ top: 0;
48
+ right: 0;
49
+ padding: 5px;
50
+ cursor: pointer;
51
+ color: red;
52
+ }
53
+
@@ -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
  */
@@ -44,49 +44,186 @@ __webpack_require__.r(__webpack_exports__);
44
44
 
45
45
 
46
46
 
47
+
47
48
  var Debug = /** @class */ (function (_super) {
48
49
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__extends */ .C6)(Debug, _super);
49
50
  function Debug() {
50
51
  return _super !== null && _super.apply(this, arguments) || this;
51
52
  }
52
53
  Debug.prototype.afterInit = function (jodit) {
53
- var mirror = jodit.create.div();
54
- var tree = jodit.create.div();
55
- var sel = jodit.create.div();
54
+ var mirror = jodit.create.div('jodit-debug');
55
+ var tree = jodit.create.div('jodit-debug__tree');
56
+ var events = jodit.create.div('jodit-debug__events');
57
+ var clear = jodit.create.div('jodit-debug__events-clear', ['x']);
58
+ var sel = jodit.create.div('jodit-debug__sel');
56
59
  mirror.appendChild(tree);
60
+ mirror.appendChild(events);
61
+ events.appendChild(clear);
57
62
  mirror.appendChild(sel);
58
- jodit.workplace.appendChild(mirror);
59
- Object.assign(mirror.style, {
60
- padding: '16px',
61
- backgroundColor: '#fcfcfc'
62
- });
63
- Object.assign(sel.style, {
64
- paddingTop: '16px'
63
+ clear.addEventListener('click', function () {
64
+ events.innerHTML = '';
65
+ events.appendChild(clear);
65
66
  });
66
- jodit.e
67
- .on('keydown keyup keypress change afterInit updateDebug', function () {
68
- tree.innerHTML = render(jodit.editor);
69
- })
70
- .on(jodit.od, 'selectionchange', function () {
67
+ jodit.workplace.appendChild(mirror);
68
+ var allEvents = [
69
+ 'activate',
70
+ 'afterInit',
71
+ 'beforeactivate',
72
+ 'beforeblur',
73
+ 'beforedeactivate',
74
+ 'beforefocus',
75
+ 'beforeinput',
76
+ 'blur',
77
+ 'change',
78
+ 'click',
79
+ 'compositionend',
80
+ 'compositionstart',
81
+ 'compositionupdate',
82
+ 'contextmenu',
83
+ 'copy',
84
+ 'cut',
85
+ 'dblclick',
86
+ 'deactivate',
87
+ 'focus',
88
+ 'focusin',
89
+ 'focusout',
90
+ 'focusout',
91
+ 'input',
92
+ 'keydown',
93
+ 'keypress',
94
+ 'keyup',
95
+ 'mousedown',
96
+ 'mouseup',
97
+ 'paste',
98
+ 'selectionchange',
99
+ 'selectionstart',
100
+ 'dragstart',
101
+ 'drop',
102
+ 'dragover',
103
+ 'resize touchstart touchend',
104
+ 'updateDebug',
105
+ 'beforeCommand',
106
+ 'afterCommand',
107
+ 'wheel'
108
+ ];
109
+ function updateTree() {
71
110
  var range = jodit.selection.range;
72
- tree.innerHTML = render(jodit.editor);
111
+ tree.innerHTML = render(jodit.editor, 0, range);
73
112
  sel.innerHTML = "start ".concat(range.startContainer.nodeName, " ").concat(range.startOffset, "<br>end ").concat(range.endContainer.nodeName, " ").concat(range.endOffset);
74
- });
113
+ }
114
+ function onSomeEvent(e) {
115
+ var event = jodit.e.current;
116
+ var div = jodit.create.div();
117
+ div.innerHTML = "<span>".concat(new Date().toLocaleTimeString(), "</span> ").concat(renderEvent(event, e));
118
+ events.appendChild(div);
119
+ events.scrollTop = events.scrollHeight;
120
+ jodit.async.setTimeout(function () {
121
+ events.children.length > 100 &&
122
+ events.removeChild(events.children[0]);
123
+ }, 100);
124
+ }
125
+ function renderEvent(event, e) {
126
+ var result = [event !== null && event !== void 0 ? event : e.type];
127
+ switch (event) {
128
+ case 'beforeCommand':
129
+ case 'afterCommand':
130
+ result.push("<span>".concat(e.toString(), "</span>"));
131
+ break;
132
+ case 'keydown':
133
+ case 'keyup':
134
+ case 'keypress':
135
+ if (e.shiftKey &&
136
+ e.key !== 'Shift') {
137
+ result.push('Shift+');
138
+ }
139
+ if (e.ctrlKey &&
140
+ e.key !== 'Control') {
141
+ result.push('Ctrl+');
142
+ }
143
+ if (e.altKey &&
144
+ e.key !== 'Alt') {
145
+ result.push('Alt');
146
+ }
147
+ result.push("".concat(e.key));
148
+ break;
149
+ }
150
+ if (e && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isNode(e.target)) {
151
+ result.push("<span>".concat(e.target.nodeName, "</span>"));
152
+ }
153
+ return result.join(' ');
154
+ }
155
+ jodit.e
156
+ .on('keydown keyup keypress change afterInit updateDebug', updateTree)
157
+ .on(allEvents, onSomeEvent)
158
+ .on(jodit.od, 'selectionchange', onSomeEvent)
159
+ .on(jodit.od, 'selectionchange', updateTree);
75
160
  };
76
161
  Debug.prototype.beforeDestruct = function (jodit) { };
77
162
  return Debug;
78
163
  }(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k));
79
164
 
80
- function renderText(elm) {
165
+ function renderText(elm, range) {
81
166
  if (!elm.nodeValue) {
82
167
  return "<span style='color:red'>empty</span>";
83
168
  }
84
- return (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_3__/* .stripTags */ .K)(elm.nodeValue.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP)(), 'INV'));
169
+ var value = elm.nodeValue;
170
+ if (range.collapsed) {
171
+ if (elm === range.startContainer) {
172
+ value =
173
+ value.slice(0, range.startOffset) +
174
+ '%CURSOR%' +
175
+ value.slice(range.startOffset);
176
+ }
177
+ }
178
+ else {
179
+ if (elm === range.startContainer && elm === range.endContainer) {
180
+ value =
181
+ value.slice(0, range.startOffset) +
182
+ '%START-CURSOR%' +
183
+ value.slice(range.startOffset, range.endOffset) +
184
+ '%END-CURSOR%' +
185
+ value.slice(range.endOffset);
186
+ }
187
+ else if (elm === range.startContainer) {
188
+ value =
189
+ value.slice(0, range.startOffset) +
190
+ '%CURSOR%' +
191
+ value.slice(range.startOffset);
192
+ }
193
+ else if (elm === range.endContainer) {
194
+ value =
195
+ value.slice(0, range.endOffset) +
196
+ '%CURSOR%' +
197
+ value.slice(range.endOffset);
198
+ }
199
+ }
200
+ return (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_3__/* .stripTags */ .K)(value.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP)(), 'INV'))
201
+ .replace(/%CURSOR%/, '<span class="jodit-debug__tree-cursor">|</span>')
202
+ .replace(/%START-CURSOR%/, '<span class="jodit-debug__tree-cursor">|')
203
+ .replace(/%END-CURSOR%/, '|</span>');
85
204
  }
86
- function render(elm, level) {
87
- if (level === void 0) { level = 0; }
88
- return "<div style='padding-left: ".concat(level * 5, "px'>\n\t\t").concat(elm.nodeName, " ").concat(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(elm) ? "- ".concat(renderText(elm)) : '', "\n\t").concat(Array.from(elm.childNodes)
89
- .map(function (ch) { return render(ch, level + 1); })
205
+ function render(elm, level, range) {
206
+ var _a;
207
+ var isSelected = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.containsNode(elm);
208
+ var content = [
209
+ "<span class=\"jodit-debug__tree-elm-name\">".concat(elm.nodeName, "</span>"),
210
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(elm) ? "- ".concat(renderText(elm, range)) : ''
211
+ ]
212
+ .map(function (i) { return i.trim(); })
213
+ .filter(Boolean);
214
+ return "<div class=\"".concat(isSelected ? 'jodit-debug__tree-element_selected' : '', "\" style='padding-left: ").concat(level * 5, "px'>\n\t\t").concat(content.join('&nbsp;'), "\n\t").concat(Array.from(elm.childNodes)
215
+ .map(function (ch, index) {
216
+ var result = [];
217
+ if (range.startContainer === elm && index === range.startOffset) {
218
+ result.push('<span class="jodit-debug__tree-cursor">|</span>');
219
+ }
220
+ result.push(render(ch, level + 1, range));
221
+ if (range.endContainer === elm && index === range.endOffset) {
222
+ result.push('<span class="jodit-debug__tree-cursor">|</span>');
223
+ }
224
+ return result;
225
+ })
226
+ .flat()
90
227
  .join(''), "\n</div>");
91
228
  }
92
229
  // pluginSystem.add('debug', Debug);
@@ -0,0 +1 @@
1
+ .jodit-debug{align-items:stretch;background:#f6f6f6;display:flex;justify-content:space-between;padding:0;position:relative}.jodit-debug>*{padding:var(--jd-padding-default)}.jodit-debug__tree{width:40%}.jodit-debug__tree .jodit-debug__tree-elm-name{color:#052e88}.jodit-debug__tree .jodit-debug__tree-element_selected{background:#1e7e34;color:#fff}.jodit-debug__tree .jodit-debug__tree-cursor{background:#dc3232;color:#fff}.jodit-debug__events{background:#1e7e34;color:#fff;max-height:500px;overflow:auto;width:40%}.jodit-debug__events span{color:#cacaca;font-size:.8em}.jodit-debug__events .jodit-debug__events-clear{color:red;cursor:pointer;padding:5px;position:absolute;right:0;top:0}
@@ -1,10 +1,10 @@
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
  */
8
8
 
9
9
 
10
- "use strict";!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[486],{40773:function(e,n,t){t.r(n),t.d(n,{Debug:function(){return a}});var o=t(31635),r=t(17352),c=t(55186),i=(t(56298),t(61793)),a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return(0,o.C6)(n,e),n.prototype.afterInit=function(e){var n=e.create.div(),t=e.create.div(),o=e.create.div();n.appendChild(t),n.appendChild(o),e.workplace.appendChild(n),Object.assign(n.style,{padding:"16px",backgroundColor:"#fcfcfc"}),Object.assign(o.style,{paddingTop:"16px"}),e.e.on("keydown keyup keypress change afterInit updateDebug",(function(){t.innerHTML=d(e.editor)})).on(e.od,"selectionchange",(function(){var n=e.selection.range;t.innerHTML=d(e.editor),o.innerHTML="start ".concat(n.startContainer.nodeName," ").concat(n.startOffset,"<br>end ").concat(n.endContainer.nodeName," ").concat(n.endOffset)}))},n.prototype.beforeDestruct=function(e){},n}(t(29866).k);function d(e,n){return void 0===n&&(n=0),"<div style='padding-left: ".concat(5*n,"px'>\n\t\t").concat(e.nodeName," ").concat(c.J.isText(e)?"- ".concat(function(e){return e.nodeValue?(0,i.K)(e.nodeValue.replace((0,r.INVISIBLE_SPACE_REG_EXP)(),"INV")):"<span style='color:red'>empty</span>"}(e)):"","\n\t").concat(Array.from(e.childNodes).map((function(e){return d(e,n+1)})).join(""),"\n</div>")}}},function(e){return e(e.s=40773)}])}));
10
+ "use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[486],{40773:function(e,t,n){n.r(t),n.d(t,{Debug:function(){return c}});var o=n(31635),a=n(17352),r=n(55186),s=(n(56298),n(61793)),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,o.C6)(t,e),t.prototype.afterInit=function(e){var t=e.create.div("jodit-debug"),n=e.create.div("jodit-debug__tree"),o=e.create.div("jodit-debug__events"),a=e.create.div("jodit-debug__events-clear",["x"]),s=e.create.div("jodit-debug__sel");function c(){var t=e.selection.range;n.innerHTML=d(e.editor,0,t),s.innerHTML="start ".concat(t.startContainer.nodeName," ").concat(t.startOffset,"<br>end ").concat(t.endContainer.nodeName," ").concat(t.endOffset)}function i(t){var n=e.e.current,a=e.create.div();a.innerHTML="<span>".concat((new Date).toLocaleTimeString(),"</span> ").concat(function(e,t){var n=[null!=e?e:t.type];switch(e){case"beforeCommand":case"afterCommand":n.push("<span>".concat(t.toString(),"</span>"));break;case"keydown":case"keyup":case"keypress":t.shiftKey&&"Shift"!==t.key&&n.push("Shift+"),t.ctrlKey&&"Control"!==t.key&&n.push("Ctrl+"),t.altKey&&"Alt"!==t.key&&n.push("Alt"),n.push("".concat(t.key))}return t&&r.J.isNode(t.target)&&n.push("<span>".concat(t.target.nodeName,"</span>")),n.join(" ")}(n,t)),o.appendChild(a),o.scrollTop=o.scrollHeight,e.async.setTimeout((function(){o.children.length>100&&o.removeChild(o.children[0])}),100)}t.appendChild(n),t.appendChild(o),o.appendChild(a),t.appendChild(s),a.addEventListener("click",(function(){o.innerHTML="",o.appendChild(a)})),e.workplace.appendChild(t),e.e.on("keydown keyup keypress change afterInit updateDebug",c).on(["activate","afterInit","beforeactivate","beforeblur","beforedeactivate","beforefocus","beforeinput","blur","change","click","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","deactivate","focus","focusin","focusout","focusout","input","keydown","keypress","keyup","mousedown","mouseup","paste","selectionchange","selectionstart","dragstart","drop","dragover","resize touchstart touchend","updateDebug","beforeCommand","afterCommand","wheel"],i).on(e.od,"selectionchange",i).on(e.od,"selectionchange",c)},t.prototype.beforeDestruct=function(e){},t}(n(29866).k);function i(e,t){if(!e.nodeValue)return"<span style='color:red'>empty</span>";var n=e.nodeValue;return t.collapsed?e===t.startContainer&&(n=n.slice(0,t.startOffset)+"%CURSOR%"+n.slice(t.startOffset)):e===t.startContainer&&e===t.endContainer?n=n.slice(0,t.startOffset)+"%START-CURSOR%"+n.slice(t.startOffset,t.endOffset)+"%END-CURSOR%"+n.slice(t.endOffset):e===t.startContainer?n=n.slice(0,t.startOffset)+"%CURSOR%"+n.slice(t.startOffset):e===t.endContainer&&(n=n.slice(0,t.endOffset)+"%CURSOR%"+n.slice(t.endOffset)),(0,s.K)(n.replace((0,a.INVISIBLE_SPACE_REG_EXP)(),"INV")).replace(/%CURSOR%/,'<span class="jodit-debug__tree-cursor">|</span>').replace(/%START-CURSOR%/,'<span class="jodit-debug__tree-cursor">|').replace(/%END-CURSOR%/,"|</span>")}function d(e,t,n){var o,a=null===(o=window.getSelection())||void 0===o?void 0:o.containsNode(e),s=['<span class="jodit-debug__tree-elm-name">'.concat(e.nodeName,"</span>"),r.J.isText(e)?"- ".concat(i(e,n)):""].map((function(e){return e.trim()})).filter(Boolean);return'<div class="'.concat(a?"jodit-debug__tree-element_selected":"","\" style='padding-left: ").concat(5*t,"px'>\n\t\t").concat(s.join("&nbsp;"),"\n\t").concat(Array.from(e.childNodes).map((function(o,a){var r=[];return n.startContainer===e&&a===n.startOffset&&r.push('<span class="jodit-debug__tree-cursor">|</span>'),r.push(d(o,t+1,n)),n.endContainer===e&&a===n.endOffset&&r.push('<span class="jodit-debug__tree-cursor">|</span>'),r})).flat().join(""),"\n</div>")}}},function(e){return e(e.s=40773)}])}));
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.2.39";
6
+ export const APP_VERSION = "4.2.40";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -16,6 +16,7 @@ export declare class UITooltip extends UIElement {
16
16
  className(): string;
17
17
  protected render(): string;
18
18
  constructor(view: IViewBased);
19
+ private __attachedContainers;
19
20
  private __onAttach;
20
21
  private __listenClose;
21
22
  private __addListenersOnEnter;
@@ -32,6 +32,7 @@ const JODIT_EVENTS_ON_HIDE = [
32
32
  'changePlace.tooltip',
33
33
  'afterOpenPopup.tooltip',
34
34
  'hidePopup.tooltip',
35
+ 'beforePopupClose.tooltip',
35
36
  'closeAllPopups.tooltip'
36
37
  ];
37
38
  let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
@@ -44,6 +45,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
44
45
  constructor(view) {
45
46
  super(view);
46
47
  this.__isOpened = false;
48
+ this.__attachedContainers = new Set();
47
49
  this.__listenClose = false;
48
50
  this.__currentTarget = null;
49
51
  this.__delayShowTimeout = 0;
@@ -62,7 +64,16 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
62
64
  __onAttach(container) {
63
65
  // TODO Move it inside __show method. Now it is here because testcase failed with capturing
64
66
  getContainer(this.j, UITooltip_1).appendChild(this.container);
65
- this.j.e.on(container, 'mouseenter.tooltip', this.__onMouseEnter, {
67
+ this.__attachedContainers.add(container);
68
+ this.__attachedContainers.add(this.j.container);
69
+ this.j.e
70
+ .on(container, 'mouseenter.tooltip', this.__onMouseEnter, {
71
+ capture: true
72
+ })
73
+ .on(container, 'mouseleave.tooltip', this.__onMouseLeave, {
74
+ capture: true
75
+ })
76
+ .on(this.j.container, 'mouseleave.tooltip', this.__onMouseLeave, {
66
77
  capture: true
67
78
  });
68
79
  }
@@ -74,10 +85,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
74
85
  const view = this.j;
75
86
  view.e
76
87
  .on(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
77
- .on(JODIT_EVENTS_ON_HIDE, this.__hide)
78
- .on(view.container, 'mouseleave.tooltip', this.__onMouseLeave, {
79
- capture: true
80
- });
88
+ .on(JODIT_EVENTS_ON_HIDE, this.__hide);
81
89
  }
82
90
  __removeListenersOnLeave() {
83
91
  if (!this.__listenClose) {
@@ -87,8 +95,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
87
95
  const view = this.j;
88
96
  view.e
89
97
  .off(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
90
- .off(JODIT_EVENTS_ON_HIDE, this.__hide)
91
- .off(view.container, 'mouseleave.tooltip', this.__onMouseLeave);
98
+ .off(JODIT_EVENTS_ON_HIDE, this.__hide);
92
99
  }
93
100
  __onMouseLeave(e) {
94
101
  if (this.__currentTarget === e.target) {
@@ -165,7 +172,11 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
165
172
  this.__hideTimeout = this.async.setTimeout(this.__hide, this.j.defaultTimeout);
166
173
  }
167
174
  destruct() {
168
- this.j.e.off(this.j.container, 'mouseenter.tooltip', this.__onMouseEnter);
175
+ this.__attachedContainers.forEach(container => {
176
+ this.j.e
177
+ .off(container, 'mouseenter.tooltip', this.__onMouseEnter)
178
+ .off(container, 'mouseleave.tooltip', this.__onMouseLeave);
179
+ });
169
180
  this.__hide();
170
181
  super.destruct();
171
182
  }
@@ -41,6 +41,7 @@ export declare abstract class ViewWithToolbar extends View implements IViewWithT
41
41
  */
42
42
  private beforeToolbarBuild;
43
43
  readonly isJodit: boolean;
44
+ private __tooltip;
44
45
  /** @override **/
45
46
  protected constructor(options?: Partial<IViewOptions>, isJodit?: boolean);
46
47
  destruct(): void;
@@ -20,6 +20,7 @@ import { Dom } from "../dom/dom.js";
20
20
  import { splitArray } from "../helpers/array/index.js";
21
21
  import { isString } from "../helpers/checker/is-string.js";
22
22
  import { resolveElement } from "../helpers/utils/selector.js";
23
+ import { UITooltip } from "../ui/index.js";
23
24
  import { isButtonGroup } from "../ui/helpers/buttons.js";
24
25
  import { View } from "./view.js";
25
26
  import { makeCollection } from "../../modules/toolbar/factory.js";
@@ -124,6 +125,7 @@ export class ViewWithToolbar extends View {
124
125
  this.registeredButtons = new Set();
125
126
  this.groupToButtons = {};
126
127
  this.isJodit = false;
128
+ this.__tooltip = new UITooltip(this);
127
129
  this.isJodit = isJodit;
128
130
  this.e.on('beforeToolbarBuild', this.beforeToolbarBuild);
129
131
  }
@@ -133,6 +135,7 @@ export class ViewWithToolbar extends View {
133
135
  }
134
136
  this.setStatus(STATUSES.beforeDestruct);
135
137
  this.e.off('beforeToolbarBuild', this.beforeToolbarBuild);
138
+ this.__tooltip.destruct();
136
139
  this.toolbar.destruct();
137
140
  // @ts-ignore After destruct, we are not responsible for anything
138
141
  this.toolbar = undefined;
@@ -39,7 +39,6 @@ export declare class ToolbarCollection<T extends IViewWithToolbar = IViewWithToo
39
39
  * Set direction
40
40
  */
41
41
  setDirection(direction: 'rtl' | 'ltr'): void;
42
- private __tooltip;
43
42
  constructor(jodit: IViewBased);
44
43
  protected __initEvents(): void;
45
44
  hide(): void;
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  import { autobind, component, debounce, hook } from "../../../core/decorators/index.js";
17
17
  import { error } from "../../../core/helpers/utils/error/error.js";
18
- import { UIList, UITooltip } from "../../../core/ui/index.js";
18
+ import { UIList } from "../../../core/ui/index.js";
19
19
  import { makeButton, makeSelect } from "../factory.js";
20
20
  let ToolbarCollection = class ToolbarCollection extends UIList {
21
21
  /** @override */
@@ -74,7 +74,6 @@ let ToolbarCollection = class ToolbarCollection extends UIList {
74
74
  super(jodit);
75
75
  this.__listenEvents = 'updatePlugins updateToolbar changeStack mousedown mouseup keydown change afterInit readonly afterResize ' +
76
76
  'selectionchange changeSelection focus afterSetMode touchstart focus blur';
77
- this.__tooltip = new UITooltip(this.jodit);
78
77
  }
79
78
  __initEvents() {
80
79
  this.j.e
@@ -104,8 +103,6 @@ let ToolbarCollection = class ToolbarCollection extends UIList {
104
103
  if (this.isDestructed) {
105
104
  return;
106
105
  }
107
- this.__tooltip?.destruct();
108
- this.__tooltip = null;
109
106
  this.j.e
110
107
  .off(this.__listenEvents, this.update)
111
108
  .off('afterSetMode focus', this.__immediateUpdate);
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import type { IJodit } from "../../types";
12
12
  import { Plugin } from "../../core/plugin/plugin";
13
+
13
14
  export declare class Debug extends Plugin {
14
15
  protected afterInit(jodit: IJodit): void;
15
16
  protected beforeDestruct(jodit: IJodit): void;
@@ -12,9 +12,11 @@ import { scrollIntoViewIfNeeded } from "../../../core/helpers/utils/scroll-into-
12
12
  */
13
13
  export function checkBR(fake, jodit, shiftKeyPressed) {
14
14
  const isMultiLineBlock = Boolean(Dom.closest(fake, ['pre', 'blockquote'], jodit.editor));
15
+ const isCell = !isMultiLineBlock && Dom.closest(fake, ['td', 'th'], jodit.editor);
15
16
  const isBRMode = jodit.o.enter.toLowerCase() === BR.toLowerCase();
16
17
  // if you use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
17
18
  if (isBRMode ||
19
+ isCell ||
18
20
  (shiftKeyPressed && !isMultiLineBlock) ||
19
21
  (!shiftKeyPressed && isMultiLineBlock)) {
20
22
  // 2 BR before
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import "./about/about.js";
12
12
  import "./backspace/backspace.js";
13
+ // import 'jodit/plugins/debug/debug';
13
14
  import "./delete/delete.js";
14
15
  import "./bold/bold.js";
15
16
  import "./color/color.js";
@@ -57,7 +57,6 @@ export declare class inlinePopup extends Plugin {
57
57
  /**
58
58
  * Shortcut for Table module
59
59
  */
60
- private get tableModule();
61
60
  /** @override **/
62
61
  protected beforeDestruct(jodit: IJodit): void;
63
62
  private elmsList;
@@ -167,10 +167,10 @@ export class inlinePopup extends Plugin {
167
167
  if (!this.j.o.toolbarInlineForSelection) {
168
168
  return;
169
169
  }
170
- const type = 'selection', sel = this.j.s.sel, range = this.j.s.range;
171
- if (sel?.isCollapsed ||
172
- this.isSelectedTarget(range) ||
173
- this.tableModule.getAllSelectedCells().length) {
170
+ const type = 'selection';
171
+ const sel = this.j.s.sel;
172
+ const range = this.j.s.range;
173
+ if (sel?.isCollapsed || this.isSelectedTarget(range)) {
174
174
  if (this.type === type && this.popup.isOpened) {
175
175
  this.hidePopup();
176
176
  }
@@ -195,9 +195,9 @@ export class inlinePopup extends Plugin {
195
195
  /**
196
196
  * Shortcut for Table module
197
197
  */
198
- get tableModule() {
199
- return this.j.getInstance('Table', this.j.o);
200
- }
198
+ // private get tableModule(): Table {
199
+ // return this.j.getInstance<Table>('Table', this.j.o);
200
+ // }
201
201
  /** @override **/
202
202
  beforeDestruct(jodit) {
203
203
  jodit.e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.2.39",
3
+ "version": "4.2.40",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -16,6 +16,7 @@ export declare class UITooltip extends UIElement {
16
16
  className(): string;
17
17
  protected render(): string;
18
18
  constructor(view: IViewBased);
19
+ private __attachedContainers;
19
20
  private __onAttach;
20
21
  private __listenClose;
21
22
  private __addListenersOnEnter;
@@ -41,6 +41,7 @@ export declare abstract class ViewWithToolbar extends View implements IViewWithT
41
41
  */
42
42
  private beforeToolbarBuild;
43
43
  readonly isJodit: boolean;
44
+ private __tooltip;
44
45
  /** @override **/
45
46
  protected constructor(options?: Partial<IViewOptions>, isJodit?: boolean);
46
47
  destruct(): void;
@@ -39,7 +39,6 @@ export declare class ToolbarCollection<T extends IViewWithToolbar = IViewWithToo
39
39
  * Set direction
40
40
  */
41
41
  setDirection(direction: 'rtl' | 'ltr'): void;
42
- private __tooltip;
43
42
  constructor(jodit: IViewBased);
44
43
  protected __initEvents(): void;
45
44
  hide(): void;
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import type { IJodit } from "../../types";
12
12
  import { Plugin } from "../../core/plugin/plugin";
13
+
13
14
  export declare class Debug extends Plugin {
14
15
  protected afterInit(jodit: IJodit): void;
15
16
  protected beforeDestruct(jodit: IJodit): void;
@@ -57,7 +57,6 @@ export declare class inlinePopup extends Plugin {
57
57
  /**
58
58
  * Shortcut for Table module
59
59
  */
60
- private get tableModule();
61
60
  /** @override **/
62
61
  protected beforeDestruct(jodit: IJodit): void;
63
62
  private elmsList;