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/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.11.10
4
+ * Version: v4.11.13
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1764,7 +1764,7 @@ __webpack_require__.r(__webpack_exports__);
1764
1764
  * ```
1765
1765
  * @packageDocumentation
1766
1766
  * @module constants
1767
- */ const APP_VERSION = "4.11.10";
1767
+ */ const APP_VERSION = "4.11.13";
1768
1768
  // prettier-ignore
1769
1769
  const ES = "es2015";
1770
1770
  const IS_ES_MODERN = true;
@@ -4228,7 +4228,7 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
4228
4228
  }
4229
4229
  }
4230
4230
  function isDOMElement(subject) {
4231
- return (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__.isFunction)(subject.addEventListener);
4231
+ return subject && (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__.isFunction)(subject.addEventListener);
4232
4232
  }
4233
4233
 
4234
4234
 
@@ -13736,12 +13736,23 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_8__.UIEle
13736
13736
  }
13737
13737
  __show(getPoint, content) {
13738
13738
  this.setMod('visible', true);
13739
+ this.setMod('above', false);
13739
13740
  this.getElm('content').innerHTML = content;
13740
13741
  const point = getPoint();
13741
13742
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, {
13742
13743
  left: point.x,
13743
13744
  top: point.y
13744
13745
  });
13746
+ const tooltipPos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__.position)(this.container);
13747
+ const viewHeight = this.j.ow.innerHeight;
13748
+ // If tooltip overflows below viewport, show it above the target
13749
+ if (tooltipPos.top + tooltipPos.height > viewHeight) {
13750
+ const targetPos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__.position)(this.__currentTarget);
13751
+ this.setMod('above', true);
13752
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, {
13753
+ top: targetPos.top - tooltipPos.height
13754
+ });
13755
+ }
13745
13756
  }
13746
13757
  __hide() {
13747
13758
  this.j.async.clearTimeout(this.__delayShowTimeout);
@@ -29400,8 +29411,20 @@ const brBoxes = new Set([
29400
29411
  node = node.firstChild;
29401
29412
  }
29402
29413
  if (jodit.o.dtd.checkBlockNesting && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(node)) {
29403
- 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);
29404
- if (parent && !jodit.o.dtd.blockLimits[parent.tagName.toLowerCase()]) {
29414
+ var _ref;
29415
+ var _jodit_s_current;
29416
+ let parent = null;
29417
+ let 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;
29418
+ while(current && current !== jodit.editor){
29419
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(current)) {
29420
+ if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()]) {
29421
+ break;
29422
+ }
29423
+ parent = current;
29424
+ }
29425
+ current = current.parentElement;
29426
+ }
29427
+ if (parent) {
29405
29428
  jodit.s.setCursorAfter(parent);
29406
29429
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
29407
29430
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
@@ -30173,7 +30196,9 @@ function focus(editor) {
30173
30196
  editor.s.save(true);
30174
30197
  }
30175
30198
  }).on('focus', ()=>{
30176
- editor.s.restore();
30199
+ if (editor.isEditorMode()) {
30200
+ editor.s.restore();
30201
+ }
30177
30202
  });
30178
30203
  }
30179
30204
  const focus = ()=>{
@@ -30255,11 +30280,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.fontsize = {
30255
30280
  command: 'fontsize',
30256
30281
  data: {
30257
30282
  cssRule: 'font-size',
30258
- normalise: (v, editor)=>{
30259
- if (/pt$/i.test(v) && editor.o.defaultFontSizePoints === 'pt') {
30260
- return v.replace(/pt$/i, '');
30261
- }
30262
- return v;
30283
+ normalize: (v)=>{
30284
+ return v.toString().replace(/(px|pt)$/i, '');
30263
30285
  }
30264
30286
  },
30265
30287
  list: [
@@ -30301,6 +30323,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.fontsize = {
30301
30323
  const control = button.control;
30302
30324
  const cssKey = ((_control_data = control.data) === null || _control_data === void 0 ? void 0 : _control_data.cssRule) || 'font-size';
30303
30325
  const value = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(box, cssKey);
30326
+ if (cssKey === 'font-size') {
30327
+ const numValue = parseFloat(value.toString());
30328
+ if (editor.o.defaultFontSizePoints === 'pt') {
30329
+ return Math.round(numValue * 0.75).toString();
30330
+ }
30331
+ return Math.round(numValue).toString();
30332
+ }
30304
30333
  return value.toString();
30305
30334
  },
30306
30335
  isChildActive: (editor, button)=>{
@@ -34779,6 +34808,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
34779
34808
  processPastedLink: true,
34780
34809
  noFollowCheckbox: true,
34781
34810
  openInNewTabCheckbox: true,
34811
+ openInNewTabCheckboxDefaultChecked: false,
34782
34812
  modeClassName: 'input',
34783
34813
  selectMultipleClassName: true,
34784
34814
  preventReadOnlyNavigation: true,
@@ -34922,7 +34952,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
34922
34952
  }
34923
34953
  __generateForm(current, close) {
34924
34954
  const { jodit } = this;
34925
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
34955
+ const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
34926
34956
  const html = formTemplate(jodit);
34927
34957
  const form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(html) ? jodit.c.fromHTML(html, {
34928
34958
  target_checkbox_box: openInNewTabCheckbox,
@@ -34972,6 +35002,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
34972
35002
  insert.textContent = i18n('Update');
34973
35003
  } else {
34974
35004
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.hide(unlink);
35005
+ if (openInNewTabCheckbox && target_checkbox) {
35006
+ target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
35007
+ }
34975
35008
  }
34976
35009
  jodit.editor.normalize();
34977
35010
  const snapshot = jodit.history.snapshot.make();
@@ -37300,6 +37333,7 @@ class resizeHandler extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
37300
37333
  }
37301
37334
  if ((height !== 'auto' || width !== 'auto') && (allowResizeX || allowResizeY)) {
37302
37335
  editor.statusbar.setMod('resize-handle', true);
37336
+ editor.statusbar.show();
37303
37337
  editor.e.on('toggleFullSize.resizeHandler', ()=>{
37304
37338
  this.handle.style.display = editor.isFullSize ? 'none' : 'block';
37305
37339
  }).on(this.handle, 'mousedown touchstart', this.onHandleResizeStart).on(editor.ow, 'mouseup touchend', this.onHandleResizeEnd);
@@ -39799,7 +39833,7 @@ class TextAreaEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_I
39799
39833
  this.container.appendChild(this.instance);
39800
39834
  editor.e.on(this.instance, 'mousedown keydown touchstart input', editor.async.debounce(this.toWYSIWYG, editor.defaultTimeout)).on('setMinHeight.source', (minHeightD)=>{
39801
39835
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.css)(this.instance, 'minHeight', minHeightD);
39802
- }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus', (e)=>{
39836
+ }).on(this.instance, 'change keydown mousedown touchstart input', this.autosize).on('afterSetMode.source', this.autosize).on(this.instance, 'mousedown focus blur', (e)=>{
39803
39837
  editor.e.fire(e.type, e);
39804
39838
  });
39805
39839
  this.autosize();