jodit 4.6.15 → 4.6.18

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 (60) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +25 -5
  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 +25 -5
  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 +25 -5
  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 +25 -5
  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 +29 -5
  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/core/constants.js +1 -1
  58. package/esm/core/selection/selection.js +11 -0
  59. package/esm/plugins/link/link.js +12 -3
  60. package/package.json +1 -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.6.15
4
+ * Version: v4.6.18
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.15";
8382
+ const APP_VERSION = "4.6.18";
8383
8383
  // prettier-ignore
8384
8384
  const ES = "es2015";
8385
8385
  const IS_ES_MODERN = true;
@@ -21757,7 +21757,12 @@ function writeClasses(modeClassName, className_input, className_select, a) {
21757
21757
  for (let i = 0; i < className_select.selectedOptions.length; i++) {
21758
21758
  const className = (_a = className_select.selectedOptions.item(i)) === null || _a === void 0 ? void 0 : _a.value;
21759
21759
  if (className) {
21760
- a.classList.add(className);
21760
+ className
21761
+ .split(/\s+/)
21762
+ .filter(cn => cn.trim().length > 0)
21763
+ .forEach(cn => {
21764
+ a.classList.add(cn);
21765
+ });
21761
21766
  }
21762
21767
  }
21763
21768
  }
@@ -21779,11 +21784,15 @@ function readClassnames(modeClassName, className_input, link, className_select)
21779
21784
  }
21780
21785
  }
21781
21786
  const classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'class') || '';
21782
- classNames.split(' ').forEach(className => {
21787
+ classNames
21788
+ .split(/\s+/)
21789
+ .filter(cn => cn.trim().length > 0)
21790
+ .forEach(className => {
21783
21791
  if (className) {
21784
21792
  for (let i = 0; i < className_select.options.length; i++) {
21785
21793
  const option = className_select.options.item(i);
21786
- if ((option === null || option === void 0 ? void 0 : option.value) && option.value === className) {
21794
+ if ((option === null || option === void 0 ? void 0 : option.value) &&
21795
+ option.value === className) {
21787
21796
  option.selected = true;
21788
21797
  }
21789
21798
  }
@@ -37740,12 +37749,23 @@ class Selection {
37740
37749
  this.j.e.fire('beforeInsertNode', node);
37741
37750
  if (sel && sel.rangeCount) {
37742
37751
  const range = sel.getRangeAt(0);
37752
+ const { firstChild } = node;
37743
37753
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.isOrContains(this.area, range.commonAncestorContainer)) {
37744
37754
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.safeInsertNode(range, node);
37745
37755
  }
37746
37756
  else {
37747
37757
  this.area.appendChild(node);
37748
37758
  }
37759
+ [
37760
+ () => firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling,
37761
+ () => firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling,
37762
+ () => { var _a; return (_a = firstChild === null || firstChild === void 0 ? void 0 : firstChild.previousSibling) === null || _a === void 0 ? void 0 : _a.lastChild; }
37763
+ ].forEach(getChildNode => {
37764
+ const childNode = getChildNode();
37765
+ if (childNode && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.isEmptyTextNode(childNode)) {
37766
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.safeRemove(childNode);
37767
+ }
37768
+ });
37749
37769
  }
37750
37770
  else {
37751
37771
  this.area.appendChild(node);