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
@@ -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);
@@ -28807,8 +28818,18 @@ const brBoxes = new Set([
28807
28818
  node = node.firstChild;
28808
28819
  }
28809
28820
  if (jodit.o.dtd.checkBlockNesting && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(node)) {
28810
- 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);
28811
- if (parent && !jodit.o.dtd.blockLimits[parent.tagName.toLowerCase()]) {
28821
+ let parent = null;
28822
+ let current = jodit.s.current()?.parentElement ?? null;
28823
+ while(current && current !== jodit.editor){
28824
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
28825
+ if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()]) {
28826
+ break;
28827
+ }
28828
+ parent = current;
28829
+ }
28830
+ current = current.parentElement;
28831
+ }
28832
+ if (parent) {
28812
28833
  jodit.s.setCursorAfter(parent);
28813
28834
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
28814
28835
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
@@ -29580,7 +29601,9 @@ function focus(editor) {
29580
29601
  editor.s.save(true);
29581
29602
  }
29582
29603
  }).on('focus', ()=>{
29583
- editor.s.restore();
29604
+ if (editor.isEditorMode()) {
29605
+ editor.s.restore();
29606
+ }
29584
29607
  });
29585
29608
  }
29586
29609
  const focus = ()=>{
@@ -29658,11 +29681,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
29658
29681
  command: 'fontsize',
29659
29682
  data: {
29660
29683
  cssRule: 'font-size',
29661
- normalise: (v, editor)=>{
29662
- if (/pt$/i.test(v) && editor.o.defaultFontSizePoints === 'pt') {
29663
- return v.replace(/pt$/i, '');
29664
- }
29665
- return v;
29684
+ normalize: (v)=>{
29685
+ return v.toString().replace(/(px|pt)$/i, '');
29666
29686
  }
29667
29687
  },
29668
29688
  list: [
@@ -29703,6 +29723,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.fontsize = {
29703
29723
  const control = button.control;
29704
29724
  const cssKey = control.data?.cssRule || 'font-size';
29705
29725
  const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(box, cssKey);
29726
+ if (cssKey === 'font-size') {
29727
+ const numValue = parseFloat(value.toString());
29728
+ if (editor.o.defaultFontSizePoints === 'pt') {
29729
+ return Math.round(numValue * 0.75).toString();
29730
+ }
29731
+ return Math.round(numValue).toString();
29732
+ }
29706
29733
  return value.toString();
29707
29734
  },
29708
29735
  isChildActive: (editor, button)=>{
@@ -33794,6 +33821,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
33794
33821
  processPastedLink: true,
33795
33822
  noFollowCheckbox: true,
33796
33823
  openInNewTabCheckbox: true,
33824
+ openInNewTabCheckboxDefaultChecked: false,
33797
33825
  modeClassName: 'input',
33798
33826
  selectMultipleClassName: true,
33799
33827
  preventReadOnlyNavigation: true,
@@ -33935,7 +33963,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
33935
33963
  }
33936
33964
  __generateForm(current, close) {
33937
33965
  const { jodit } = this;
33938
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
33966
+ const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
33939
33967
  const html = formTemplate(jodit);
33940
33968
  const form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(html) ? jodit.c.fromHTML(html, {
33941
33969
  target_checkbox_box: openInNewTabCheckbox,
@@ -33985,6 +34013,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
33985
34013
  insert.textContent = i18n('Update');
33986
34014
  } else {
33987
34015
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.hide(unlink);
34016
+ if (openInNewTabCheckbox && target_checkbox) {
34017
+ target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
34018
+ }
33988
34019
  }
33989
34020
  jodit.editor.normalize();
33990
34021
  const snapshot = jodit.history.snapshot.make();
@@ -36302,6 +36333,7 @@ class resizeHandler extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
36302
36333
  }
36303
36334
  if ((height !== 'auto' || width !== 'auto') && (allowResizeX || allowResizeY)) {
36304
36335
  editor.statusbar.setMod('resize-handle', true);
36336
+ editor.statusbar.show();
36305
36337
  editor.e.on('toggleFullSize.resizeHandler', ()=>{
36306
36338
  this.handle.style.display = editor.isFullSize ? 'none' : 'block';
36307
36339
  }).on(this.handle, 'mousedown touchstart', this.onHandleResizeStart).on(editor.ow, 'mouseup touchend', this.onHandleResizeEnd);
@@ -38768,7 +38800,7 @@ class TextAreaEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_I
38768
38800
  this.container.appendChild(this.instance);
38769
38801
  editor.e.on(this.instance, 'mousedown keydown touchstart input', editor.async.debounce(this.toWYSIWYG, editor.defaultTimeout)).on('setMinHeight.source', (minHeightD)=>{
38770
38802
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(this.instance, 'minHeight', minHeightD);
38771
- }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus', (e)=>{
38803
+ }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus blur', (e)=>{
38772
38804
  editor.e.fire(e.type, e);
38773
38805
  });
38774
38806
  this.autosize();