jodit 4.11.10 → 4.11.13

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 (73) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es2015/jodit.css +4 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +7 -7
  5. package/es2015/jodit.js +47 -13
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +7 -7
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +7 -7
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +7 -7
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +4 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +7 -7
  23. package/es2021/jodit.js +45 -13
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +7 -7
  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 +4 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +8 -8
  35. package/es2021.en/jodit.js +45 -13
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +7 -7
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +7 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +47 -13
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/config.d.ts +4 -0
  60. package/esm/core/constants.js +1 -1
  61. package/esm/core/event-emitter/event-emitter.js +1 -1
  62. package/esm/core/ui/button/tooltip/tooltip.js +11 -0
  63. package/esm/plugins/dtd/before-insert/check-block-nesting.js +13 -2
  64. package/esm/plugins/focus/focus.js +3 -1
  65. package/esm/plugins/font/config.js +9 -5
  66. package/esm/plugins/link/config.d.ts +4 -0
  67. package/esm/plugins/link/config.js +1 -0
  68. package/esm/plugins/link/link.js +4 -1
  69. package/esm/plugins/resize-handler/resize-handler.js +1 -0
  70. package/esm/plugins/source/editor/engines/area.js +1 -1
  71. package/package.json +1 -1
  72. package/types/config.d.ts +4 -0
  73. package/types/plugins/link/config.d.ts +4 -0
package/es2021/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.11.10
4
+ * Version: v4.11.13
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1758,7 +1758,7 @@ __webpack_require__.r(__webpack_exports__);
1758
1758
  * ```
1759
1759
  * @packageDocumentation
1760
1760
  * @module constants
1761
- */ const APP_VERSION = "4.11.10";
1761
+ */ const APP_VERSION = "4.11.13";
1762
1762
  // prettier-ignore
1763
1763
  const ES = "es2021";
1764
1764
  const IS_ES_MODERN = true;
@@ -4210,7 +4210,7 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
4210
4210
  }
4211
4211
  }
4212
4212
  function isDOMElement(subject) {
4213
- return (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__.isFunction)(subject.addEventListener);
4213
+ return subject && (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__.isFunction)(subject.addEventListener);
4214
4214
  }
4215
4215
 
4216
4216
 
@@ -13646,12 +13646,23 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_8__.UIEle
13646
13646
  }
13647
13647
  __show(getPoint, content) {
13648
13648
  this.setMod('visible', true);
13649
+ this.setMod('above', false);
13649
13650
  this.getElm('content').innerHTML = content;
13650
13651
  const point = getPoint();
13651
13652
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, {
13652
13653
  left: point.x,
13653
13654
  top: point.y
13654
13655
  });
13656
+ const tooltipPos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__.position)(this.container);
13657
+ const viewHeight = this.j.ow.innerHeight;
13658
+ // If tooltip overflows below viewport, show it above the target
13659
+ if (tooltipPos.top + tooltipPos.height > viewHeight) {
13660
+ const targetPos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__.position)(this.__currentTarget);
13661
+ this.setMod('above', true);
13662
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, {
13663
+ top: targetPos.top - tooltipPos.height
13664
+ });
13665
+ }
13655
13666
  }
13656
13667
  __hide() {
13657
13668
  this.j.async.clearTimeout(this.__delayShowTimeout);
@@ -29211,8 +29222,18 @@ const brBoxes = new Set([
29211
29222
  node = node.firstChild;
29212
29223
  }
29213
29224
  if (jodit.o.dtd.checkBlockNesting && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(node)) {
29214
- const parent = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.furthest(jodit.s.current(), jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, jodit.editor);
29215
- if (parent && !jodit.o.dtd.blockLimits[parent.tagName.toLowerCase()]) {
29225
+ let parent = null;
29226
+ let current = jodit.s.current()?.parentElement ?? null;
29227
+ while(current && current !== jodit.editor){
29228
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
29229
+ if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()]) {
29230
+ break;
29231
+ }
29232
+ parent = current;
29233
+ }
29234
+ current = current.parentElement;
29235
+ }
29236
+ if (parent) {
29216
29237
  jodit.s.setCursorAfter(parent);
29217
29238
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
29218
29239
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
@@ -29984,7 +30005,9 @@ function focus(editor) {
29984
30005
  editor.s.save(true);
29985
30006
  }
29986
30007
  }).on('focus', ()=>{
29987
- editor.s.restore();
30008
+ if (editor.isEditorMode()) {
30009
+ editor.s.restore();
30010
+ }
29988
30011
  });
29989
30012
  }
29990
30013
  const focus = ()=>{
@@ -30062,11 +30085,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
30062
30085
  command: 'fontsize',
30063
30086
  data: {
30064
30087
  cssRule: 'font-size',
30065
- normalise: (v, editor)=>{
30066
- if (/pt$/i.test(v) && editor.o.defaultFontSizePoints === 'pt') {
30067
- return v.replace(/pt$/i, '');
30068
- }
30069
- return v;
30088
+ normalize: (v)=>{
30089
+ return v.toString().replace(/(px|pt)$/i, '');
30070
30090
  }
30071
30091
  },
30072
30092
  list: [
@@ -30107,6 +30127,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
30107
30127
  const control = button.control;
30108
30128
  const cssKey = control.data?.cssRule || 'font-size';
30109
30129
  const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(box, cssKey);
30130
+ if (cssKey === 'font-size') {
30131
+ const numValue = parseFloat(value.toString());
30132
+ if (editor.o.defaultFontSizePoints === 'pt') {
30133
+ return Math.round(numValue * 0.75).toString();
30134
+ }
30135
+ return Math.round(numValue).toString();
30136
+ }
30110
30137
  return value.toString();
30111
30138
  },
30112
30139
  isChildActive: (editor, button)=>{
@@ -34548,6 +34575,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
34548
34575
  processPastedLink: true,
34549
34576
  noFollowCheckbox: true,
34550
34577
  openInNewTabCheckbox: true,
34578
+ openInNewTabCheckboxDefaultChecked: false,
34551
34579
  modeClassName: 'input',
34552
34580
  selectMultipleClassName: true,
34553
34581
  preventReadOnlyNavigation: true,
@@ -34689,7 +34717,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
34689
34717
  }
34690
34718
  __generateForm(current, close) {
34691
34719
  const { jodit } = this;
34692
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
34720
+ const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
34693
34721
  const html = formTemplate(jodit);
34694
34722
  const form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(html) ? jodit.c.fromHTML(html, {
34695
34723
  target_checkbox_box: openInNewTabCheckbox,
@@ -34739,6 +34767,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
34739
34767
  insert.textContent = i18n('Update');
34740
34768
  } else {
34741
34769
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.hide(unlink);
34770
+ if (openInNewTabCheckbox && target_checkbox) {
34771
+ target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
34772
+ }
34742
34773
  }
34743
34774
  jodit.editor.normalize();
34744
34775
  const snapshot = jodit.history.snapshot.make();
@@ -37056,6 +37087,7 @@ class resizeHandler extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
37056
37087
  }
37057
37088
  if ((height !== 'auto' || width !== 'auto') && (allowResizeX || allowResizeY)) {
37058
37089
  editor.statusbar.setMod('resize-handle', true);
37090
+ editor.statusbar.show();
37059
37091
  editor.e.on('toggleFullSize.resizeHandler', ()=>{
37060
37092
  this.handle.style.display = editor.isFullSize ? 'none' : 'block';
37061
37093
  }).on(this.handle, 'mousedown touchstart', this.onHandleResizeStart).on(editor.ow, 'mouseup touchend', this.onHandleResizeEnd);
@@ -39522,7 +39554,7 @@ class TextAreaEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_I
39522
39554
  this.container.appendChild(this.instance);
39523
39555
  editor.e.on(this.instance, 'mousedown keydown touchstart input', editor.async.debounce(this.toWYSIWYG, editor.defaultTimeout)).on('setMinHeight.source', (minHeightD)=>{
39524
39556
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(this.instance, 'minHeight', minHeightD);
39525
- }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus', (e)=>{
39557
+ }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus blur', (e)=>{
39526
39558
  editor.e.fire(e.type, e);
39527
39559
  });
39528
39560
  this.autosize();