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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
package/es5/polyfills.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
  */
@@ -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
  */
package/esm/config.d.ts CHANGED
@@ -1323,6 +1323,10 @@ interface Config {
1323
1323
  * Show `Open in new tab` checkbox in link dialog.
1324
1324
  */
1325
1325
  openInNewTabCheckbox: boolean;
1326
+ /**
1327
+ * Default value for the `Open in new tab` checkbox when inserting a new link.
1328
+ */
1329
+ openInNewTabCheckboxDefaultChecked: boolean;
1326
1330
  /**
1327
1331
  * Use an input text to ask the classname or a select or not ask
1328
1332
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.11.10";
6
+ export const APP_VERSION = "4.11.13";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -477,5 +477,5 @@ export class EventEmitter {
477
477
  }
478
478
  }
479
479
  function isDOMElement(subject) {
480
- return isFunction(subject.addEventListener);
480
+ return subject && isFunction(subject.addEventListener);
481
481
  }
@@ -143,12 +143,23 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
143
143
  }
144
144
  __show(getPoint, content) {
145
145
  this.setMod('visible', true);
146
+ this.setMod('above', false);
146
147
  this.getElm('content').innerHTML = content;
147
148
  const point = getPoint();
148
149
  css(this.container, {
149
150
  left: point.x,
150
151
  top: point.y
151
152
  });
153
+ const tooltipPos = position(this.container);
154
+ const viewHeight = this.j.ow.innerHeight;
155
+ // If tooltip overflows below viewport, show it above the target
156
+ if (tooltipPos.top + tooltipPos.height > viewHeight) {
157
+ const targetPos = position(this.__currentTarget);
158
+ this.setMod('above', true);
159
+ css(this.container, {
160
+ top: targetPos.top - tooltipPos.height
161
+ });
162
+ }
152
163
  }
153
164
  __hide() {
154
165
  this.j.async.clearTimeout(this.__delayShowTimeout);
@@ -10,12 +10,23 @@ import { Dom } from "../../../core/dom/dom.js";
10
10
  * @internal
11
11
  */
12
12
  export function checkBlockNesting(jodit, node) {
13
+ var _a, _b;
13
14
  if (Dom.isFragment(node)) {
14
15
  node = node.firstChild;
15
16
  }
16
17
  if (jodit.o.dtd.checkBlockNesting && Dom.isBlock(node)) {
17
- const parent = Dom.furthest(jodit.s.current(), Dom.isBlock, jodit.editor);
18
- if (parent && !jodit.o.dtd.blockLimits[parent.tagName.toLowerCase()]) {
18
+ let parent = null;
19
+ let current = (_b = (_a = jodit.s.current()) === null || _a === void 0 ? void 0 : _a.parentElement) !== null && _b !== void 0 ? _b : null;
20
+ while (current && current !== jodit.editor) {
21
+ if (Dom.isBlock(current)) {
22
+ if (jodit.o.dtd.blockLimits[current.nodeName.toLowerCase()]) {
23
+ break;
24
+ }
25
+ parent = current;
26
+ }
27
+ current = current.parentElement;
28
+ }
29
+ if (parent) {
19
30
  jodit.s.setCursorAfter(parent);
20
31
  if (Dom.isEmpty(parent)) {
21
32
  Dom.safeRemove(parent);
@@ -27,7 +27,9 @@ export function focus(editor) {
27
27
  }
28
28
  })
29
29
  .on('focus', () => {
30
- editor.s.restore();
30
+ if (editor.isEditorMode()) {
31
+ editor.s.restore();
32
+ }
31
33
  });
32
34
  }
33
35
  const focus = () => {
@@ -19,11 +19,8 @@ Config.prototype.controls.fontsize = {
19
19
  command: 'fontsize',
20
20
  data: {
21
21
  cssRule: 'font-size',
22
- normalise: (v, editor) => {
23
- if (/pt$/i.test(v) && editor.o.defaultFontSizePoints === 'pt') {
24
- return v.replace(/pt$/i, '');
25
- }
26
- return v;
22
+ normalize: (v) => {
23
+ return v.toString().replace(/(px|pt)$/i, '');
27
24
  }
28
25
  },
29
26
  list: [8, 9, 10, 11, 12, 14, 16, 18, 24, 30, 32, 34, 36, 48, 60, 72, 96],
@@ -47,6 +44,13 @@ Config.prototype.controls.fontsize = {
47
44
  const control = button.control;
48
45
  const cssKey = ((_a = control.data) === null || _a === void 0 ? void 0 : _a.cssRule) || 'font-size';
49
46
  const value = css(box, cssKey);
47
+ if (cssKey === 'font-size') {
48
+ const numValue = parseFloat(value.toString());
49
+ if (editor.o.defaultFontSizePoints === 'pt') {
50
+ return Math.round(numValue * 0.75).toString();
51
+ }
52
+ return Math.round(numValue).toString();
53
+ }
50
54
  return value.toString();
51
55
  },
52
56
  isChildActive: (editor, button) => {
@@ -35,6 +35,10 @@ declare module 'jodit/config' {
35
35
  * Show `Open in new tab` checkbox in link dialog.
36
36
  */
37
37
  openInNewTabCheckbox: boolean;
38
+ /**
39
+ * Default value for the `Open in new tab` checkbox when inserting a new link.
40
+ */
41
+ openInNewTabCheckboxDefaultChecked: boolean;
38
42
  /**
39
43
  * Use an input text to ask the classname or a select or not ask
40
44
  */
@@ -16,6 +16,7 @@ Config.prototype.link = {
16
16
  processPastedLink: true,
17
17
  noFollowCheckbox: true,
18
18
  openInNewTabCheckbox: true,
19
+ openInNewTabCheckboxDefaultChecked: false,
19
20
  modeClassName: 'input',
20
21
  selectMultipleClassName: true,
21
22
  preventReadOnlyNavigation: true,
@@ -105,7 +105,7 @@ export class link extends Plugin {
105
105
  }
106
106
  __generateForm(current, close) {
107
107
  const { jodit } = this;
108
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
108
+ const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
109
109
  const html = formTemplate(jodit);
110
110
  const form = isString(html)
111
111
  ? jodit.c.fromHTML(html, {
@@ -163,6 +163,9 @@ export class link extends Plugin {
163
163
  }
164
164
  else {
165
165
  Dom.hide(unlink);
166
+ if (openInNewTabCheckbox && target_checkbox) {
167
+ target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
168
+ }
166
169
  }
167
170
  jodit.editor.normalize();
168
171
  const snapshot = jodit.history.snapshot.make();
@@ -50,6 +50,7 @@ export class resizeHandler extends Plugin {
50
50
  if ((height !== 'auto' || width !== 'auto') &&
51
51
  (allowResizeX || allowResizeY)) {
52
52
  editor.statusbar.setMod('resize-handle', true);
53
+ editor.statusbar.show();
53
54
  editor.e
54
55
  .on('toggleFullSize.resizeHandler', () => {
55
56
  this.handle.style.display = editor.isFullSize
@@ -28,7 +28,7 @@ export class TextAreaEditor extends SourceEditor {
28
28
  })
29
29
  .on(this.instance, 'change keydown mousedown touchstart input', this.autosize)
30
30
  .on('afterSetMode.source', this.autosize)
31
- .on(this.instance, 'mousedown focus', (e) => {
31
+ .on(this.instance, 'mousedown focus blur', (e) => {
32
32
  editor.e.fire(e.type, e);
33
33
  });
34
34
  this.autosize();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.11.10",
3
+ "version": "4.11.13",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
package/types/config.d.ts CHANGED
@@ -1323,6 +1323,10 @@ interface Config {
1323
1323
  * Show `Open in new tab` checkbox in link dialog.
1324
1324
  */
1325
1325
  openInNewTabCheckbox: boolean;
1326
+ /**
1327
+ * Default value for the `Open in new tab` checkbox when inserting a new link.
1328
+ */
1329
+ openInNewTabCheckboxDefaultChecked: boolean;
1326
1330
  /**
1327
1331
  * Use an input text to ask the classname or a select or not ask
1328
1332
  */
@@ -35,6 +35,10 @@ declare module 'jodit/config' {
35
35
  * Show `Open in new tab` checkbox in link dialog.
36
36
  */
37
37
  openInNewTabCheckbox: boolean;
38
+ /**
39
+ * Default value for the `Open in new tab` checkbox when inserting a new link.
40
+ */
41
+ openInNewTabCheckboxDefaultChecked: boolean;
38
42
  /**
39
43
  * Use an input text to ask the classname or a select or not ask
40
44
  */