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
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
package/esm/config.d.ts CHANGED
@@ -1493,6 +1493,7 @@ interface Config {
1493
1493
  }
1494
1494
  interface Config {
1495
1495
  table: {
1496
+ splitBlockOnInsertTable: boolean;
1496
1497
  selectionCellStyle: string;
1497
1498
  useExtraClassesOptions: boolean;
1498
1499
  };
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.6.14";
6
+ export const APP_VERSION = "4.6.16";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -457,12 +457,23 @@ export class Selection {
457
457
  this.j.e.fire('beforeInsertNode', node);
458
458
  if (sel && sel.rangeCount) {
459
459
  const range = sel.getRangeAt(0);
460
+ const { firstChild } = node;
460
461
  if (Dom.isOrContains(this.area, range.commonAncestorContainer)) {
461
462
  Dom.safeInsertNode(range, node);
462
463
  }
463
464
  else {
464
465
  this.area.appendChild(node);
465
466
  }
467
+ [
468
+ () => firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling,
469
+ () => firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling,
470
+ () => { var _a; return (_a = firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling) === null || _a === void 0 ? void 0 : _a.lastChild; }
471
+ ].forEach(getChildNode => {
472
+ const childNode = getChildNode();
473
+ if (childNode && Dom.isEmptyTextNode(childNode)) {
474
+ Dom.safeRemove(childNode);
475
+ }
476
+ });
466
477
  }
467
478
  else {
468
479
  this.area.appendChild(node);
@@ -6,6 +6,7 @@
6
6
  declare module 'jodit/config' {
7
7
  interface Config {
8
8
  table: {
9
+ splitBlockOnInsertTable: boolean;
9
10
  selectionCellStyle: string;
10
11
  useExtraClassesOptions: boolean;
11
12
  };
@@ -10,6 +10,7 @@ import { Icon } from "../../core/ui/icon.js";
10
10
  import { Config } from "../../config.js";
11
11
  import tableIcon from "./table.svg.js";
12
12
  Config.prototype.table = {
13
+ splitBlockOnInsertTable: true,
13
14
  selectionCellStyle: 'border: 1px double #1e88e5 !important;',
14
15
  useExtraClassesOptions: false
15
16
  };
@@ -130,8 +131,19 @@ Config.prototype.controls.table = {
130
131
  else {
131
132
  if (block) {
132
133
  const fake = crt.text('\n');
133
- Dom.after(block, fake);
134
- Dom.after(fake, table);
134
+ if (!editor.o.table.splitBlockOnInsertTable) {
135
+ Dom.after(block, fake);
136
+ Dom.after(fake, table);
137
+ }
138
+ else {
139
+ const range = editor.s.range;
140
+ range.collapse(false);
141
+ range.insertNode(fake);
142
+ range.collapse(false);
143
+ editor.s.selectRange(range);
144
+ const firstPart = editor.s.splitSelection(block, fake);
145
+ Dom.after(firstPart, table);
146
+ }
135
147
  }
136
148
  else {
137
149
  editor.s.insertNode(table, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.6.14",
3
+ "version": "4.6.16",
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",
package/types/config.d.ts CHANGED
@@ -1493,6 +1493,7 @@ interface Config {
1493
1493
  }
1494
1494
  interface Config {
1495
1495
  table: {
1496
+ splitBlockOnInsertTable: boolean;
1496
1497
  selectionCellStyle: string;
1497
1498
  useExtraClassesOptions: boolean;
1498
1499
  };
@@ -6,6 +6,7 @@
6
6
  declare module 'jodit/config' {
7
7
  interface Config {
8
8
  table: {
9
+ splitBlockOnInsertTable: boolean;
9
10
  selectionCellStyle: string;
10
11
  useExtraClassesOptions: boolean;
11
12
  };