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/es5/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
  */
@@ -2022,7 +2022,7 @@ __webpack_require__.r(__webpack_exports__);
2022
2022
  * @packageDocumentation
2023
2023
  * @module constants
2024
2024
  */
2025
- var APP_VERSION = "4.11.10";
2025
+ var APP_VERSION = "4.11.13";
2026
2026
  // prettier-ignore
2027
2027
  var ES = "es5";
2028
2028
  var IS_ES_MODERN = false;
@@ -5042,7 +5042,7 @@ var LazyWalker = /*#__PURE__*/ function(Eventify) {
5042
5042
  return EventEmitter;
5043
5043
  }();
5044
5044
  function isDOMElement(subject) {
5045
- return (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__.isFunction)(subject.addEventListener);
5045
+ return subject && (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__.isFunction)(subject.addEventListener);
5046
5046
  }
5047
5047
 
5048
5048
 
@@ -16247,12 +16247,23 @@ var UITooltip = /*#__PURE__*/ function(UIElement) {
16247
16247
  key: "__show",
16248
16248
  value: function __show(getPoint, content) {
16249
16249
  this.setMod('visible', true);
16250
+ this.setMod('above', false);
16250
16251
  this.getElm('content').innerHTML = content;
16251
16252
  var point = getPoint();
16252
16253
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_13__.css)(this.container, {
16253
16254
  left: point.x,
16254
16255
  top: point.y
16255
16256
  });
16257
+ var tooltipPos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_12__.position)(this.container);
16258
+ var viewHeight = this.j.ow.innerHeight;
16259
+ // If tooltip overflows below viewport, show it above the target
16260
+ if (tooltipPos.top + tooltipPos.height > viewHeight) {
16261
+ var targetPos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_12__.position)(this.__currentTarget);
16262
+ this.setMod('above', true);
16263
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_13__.css)(this.container, {
16264
+ top: targetPos.top - tooltipPos.height
16265
+ });
16266
+ }
16256
16267
  }
16257
16268
  },
16258
16269
  {
@@ -34909,8 +34920,20 @@ var brBoxes = new Set([
34909
34920
  node = node.firstChild;
34910
34921
  }
34911
34922
  if (jodit.o.dtd.checkBlockNesting && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(node)) {
34912
- var 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);
34913
- if (parent && !jodit.o.dtd.blockLimits[parent.tagName.toLowerCase()]) {
34923
+ var _ref;
34924
+ var _jodit_s_current;
34925
+ var parent = null;
34926
+ var current = (_ref = (_jodit_s_current = jodit.s.current()) === null || _jodit_s_current === void 0 ? void 0 : _jodit_s_current.parentElement) !== null && _ref !== void 0 ? _ref : null;
34927
+ while(current && current !== jodit.editor){
34928
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
34929
+ if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()]) {
34930
+ break;
34931
+ }
34932
+ parent = current;
34933
+ }
34934
+ current = current.parentElement;
34935
+ }
34936
+ if (parent) {
34914
34937
  jodit.s.setCursorAfter(parent);
34915
34938
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
34916
34939
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
@@ -35759,7 +35782,9 @@ function focus(editor) {
35759
35782
  editor.s.save(true);
35760
35783
  }
35761
35784
  }).on('focus', function() {
35762
- editor.s.restore();
35785
+ if (editor.isEditorMode()) {
35786
+ editor.s.restore();
35787
+ }
35763
35788
  });
35764
35789
  }
35765
35790
  var _$focus = function focus() {
@@ -35847,11 +35872,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.fontsize = {
35847
35872
  command: 'fontsize',
35848
35873
  data: {
35849
35874
  cssRule: 'font-size',
35850
- normalise: function normalise(v, editor) {
35851
- if (/pt$/i.test(v) && editor.o.defaultFontSizePoints === 'pt') {
35852
- return v.replace(/pt$/i, '');
35853
- }
35854
- return v;
35875
+ normalize: function normalize(v) {
35876
+ return v.toString().replace(/(px|pt)$/i, '');
35855
35877
  }
35856
35878
  },
35857
35879
  list: [
@@ -35893,6 +35915,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.fontsize = {
35893
35915
  var control = button.control;
35894
35916
  var cssKey = ((_control_data = control.data) === null || _control_data === void 0 ? void 0 : _control_data.cssRule) || 'font-size';
35895
35917
  var value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(box, cssKey);
35918
+ if (cssKey === 'font-size') {
35919
+ var numValue = parseFloat(value.toString());
35920
+ if (editor.o.defaultFontSizePoints === 'pt') {
35921
+ return Math.round(numValue * 0.75).toString();
35922
+ }
35923
+ return Math.round(numValue).toString();
35924
+ }
35896
35925
  return value.toString();
35897
35926
  },
35898
35927
  isChildActive: function isChildActive(editor, button) {
@@ -41041,6 +41070,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
41041
41070
  processPastedLink: true,
41042
41071
  noFollowCheckbox: true,
41043
41072
  openInNewTabCheckbox: true,
41073
+ openInNewTabCheckboxDefaultChecked: false,
41044
41074
  modeClassName: 'input',
41045
41075
  selectMultipleClassName: true,
41046
41076
  preventReadOnlyNavigation: true,
@@ -41220,7 +41250,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
41220
41250
  key: "__generateForm",
41221
41251
  value: function __generateForm(current, close) {
41222
41252
  var jodit = this.jodit;
41223
- var i18n = jodit.i18n.bind(jodit), _jodit_o_link = jodit.o.link, openInNewTabCheckbox = _jodit_o_link.openInNewTabCheckbox, noFollowCheckbox = _jodit_o_link.noFollowCheckbox, formTemplate = _jodit_o_link.formTemplate, formClassName = _jodit_o_link.formClassName, modeClassName = _jodit_o_link.modeClassName;
41253
+ var i18n = jodit.i18n.bind(jodit), _jodit_o_link = jodit.o.link, openInNewTabCheckbox = _jodit_o_link.openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked = _jodit_o_link.openInNewTabCheckboxDefaultChecked, noFollowCheckbox = _jodit_o_link.noFollowCheckbox, formTemplate = _jodit_o_link.formTemplate, formClassName = _jodit_o_link.formClassName, modeClassName = _jodit_o_link.modeClassName;
41224
41254
  var html = formTemplate(jodit);
41225
41255
  var form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isString)(html) ? jodit.c.fromHTML(html, {
41226
41256
  target_checkbox_box: openInNewTabCheckbox,
@@ -41272,6 +41302,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
41272
41302
  insert.textContent = i18n('Update');
41273
41303
  } else {
41274
41304
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.hide(unlink);
41305
+ if (openInNewTabCheckbox && target_checkbox) {
41306
+ target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
41307
+ }
41275
41308
  }
41276
41309
  jodit.editor.normalize();
41277
41310
  var snapshot = jodit.history.snapshot.make();
@@ -44030,6 +44063,7 @@ var resizeHandler = /*#__PURE__*/ function(Plugin) {
44030
44063
  }
44031
44064
  if ((height !== 'auto' || width !== 'auto') && (allowResizeX || allowResizeY)) {
44032
44065
  editor.statusbar.setMod('resize-handle', true);
44066
+ editor.statusbar.show();
44033
44067
  editor.e.on('toggleFullSize.resizeHandler', function() {
44034
44068
  _this.handle.style.display = editor.isFullSize ? 'none' : 'block';
44035
44069
  }).on(this.handle, 'mousedown touchstart', this.onHandleResizeStart).on(editor.ow, 'mouseup touchend', this.onHandleResizeEnd);
@@ -47205,7 +47239,7 @@ var TextAreaEditor = /*#__PURE__*/ function(SourceEditor) {
47205
47239
  this.container.appendChild(this.instance);
47206
47240
  editor.e.on(this.instance, 'mousedown keydown touchstart input', editor.async.debounce(this.toWYSIWYG, editor.defaultTimeout)).on('setMinHeight.source', function(minHeightD) {
47207
47241
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(_this.instance, 'minHeight', minHeightD);
47208
- }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus', function(e) {
47242
+ }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus blur', function(e) {
47209
47243
  editor.e.fire(e.type, e);
47210
47244
  });
47211
47245
  this.autosize();