jodit 4.6.14 → 4.6.16

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 (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +27 -4
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +27 -4
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.css +1 -1
  17. package/es2018/plugins/debug/debug.js +1 -1
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  22. package/es2021/jodit.css +1 -1
  23. package/es2021/jodit.fat.min.js +2 -2
  24. package/es2021/jodit.js +27 -4
  25. package/es2021/jodit.min.js +2 -2
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +1 -1
  33. package/es2021.en/jodit.fat.min.js +2 -2
  34. package/es2021.en/jodit.js +27 -4
  35. package/es2021.en/jodit.min.js +2 -2
  36. package/es2021.en/plugins/debug/debug.css +1 -1
  37. package/es2021.en/plugins/debug/debug.js +1 -1
  38. package/es2021.en/plugins/debug/debug.min.js +1 -1
  39. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  40. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  42. package/es5/415.fat.min.js +1 -1
  43. package/es5/415.min.js +1 -1
  44. package/es5/5.fat.min.js +1 -1
  45. package/es5/5.min.js +1 -1
  46. package/es5/jodit.css +2 -2
  47. package/es5/jodit.fat.min.js +2 -2
  48. package/es5/jodit.js +31 -4
  49. package/es5/jodit.min.css +2 -2
  50. package/es5/jodit.min.js +2 -2
  51. package/es5/plugins/debug/debug.css +1 -1
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/config.d.ts +1 -0
  58. package/esm/core/constants.js +1 -1
  59. package/esm/core/selection/selection.js +11 -0
  60. package/esm/plugins/table/config.d.ts +1 -0
  61. package/esm/plugins/table/config.js +14 -2
  62. package/package.json +1 -1
  63. package/types/config.d.ts +1 -0
  64. package/types/plugins/table/config.d.ts +1 -0
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.6.14
4
+ * Version: v4.6.16
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -8379,7 +8379,7 @@ __webpack_require__.r(__webpack_exports__);
8379
8379
  * Released under MIT see LICENSE.txt in the project root for license information.
8380
8380
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
8381
8381
  */
8382
- const APP_VERSION = "4.6.14";
8382
+ const APP_VERSION = "4.6.16";
8383
8383
  // prettier-ignore
8384
8384
  const ES = "es2015";
8385
8385
  const IS_ES_MODERN = true;
@@ -37740,12 +37740,23 @@ class Selection {
37740
37740
  this.j.e.fire('beforeInsertNode', node);
37741
37741
  if (sel && sel.rangeCount) {
37742
37742
  const range = sel.getRangeAt(0);
37743
+ const { firstChild } = node;
37743
37744
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.isOrContains(this.area, range.commonAncestorContainer)) {
37744
37745
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.safeInsertNode(range, node);
37745
37746
  }
37746
37747
  else {
37747
37748
  this.area.appendChild(node);
37748
37749
  }
37750
+ [
37751
+ () => firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling,
37752
+ () => firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling,
37753
+ () => { var _a; return (_a = firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling) === null || _a === void 0 ? void 0 : _a.lastChild; }
37754
+ ].forEach(getChildNode => {
37755
+ const childNode = getChildNode();
37756
+ if (childNode && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.isEmptyTextNode(childNode)) {
37757
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.safeRemove(childNode);
37758
+ }
37759
+ });
37749
37760
  }
37750
37761
  else {
37751
37762
  this.area.appendChild(node);
@@ -42981,6 +42992,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 312 312\
42981
42992
 
42982
42993
 
42983
42994
  jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.table = {
42995
+ splitBlockOnInsertTable: true,
42984
42996
  selectionCellStyle: 'border: 1px double #1e88e5 !important;',
42985
42997
  useExtraClassesOptions: false
42986
42998
  };
@@ -43101,8 +43113,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.tab
43101
43113
  else {
43102
43114
  if (block) {
43103
43115
  const fake = crt.text('\n');
43104
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(block, fake);
43105
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(fake, table);
43116
+ if (!editor.o.table.splitBlockOnInsertTable) {
43117
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(block, fake);
43118
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(fake, table);
43119
+ }
43120
+ else {
43121
+ const range = editor.s.range;
43122
+ range.collapse(false);
43123
+ range.insertNode(fake);
43124
+ range.collapse(false);
43125
+ editor.s.selectRange(range);
43126
+ const firstPart = editor.s.splitSelection(block, fake);
43127
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(firstPart, table);
43128
+ }
43106
43129
  }
43107
43130
  else {
43108
43131
  editor.s.insertNode(table, false);