jodit 4.15.1 → 4.15.3

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 (56) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +38 -10
  5. package/es2015/jodit.min.js +5 -5
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +5 -5
  13. package/es2018/jodit.min.js +5 -5
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +5 -5
  18. package/es2021/jodit.js +37 -10
  19. package/es2021/jodit.min.js +5 -5
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +5 -5
  28. package/es2021.en/jodit.js +37 -10
  29. package/es2021.en/jodit.min.js +5 -5
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +37 -9
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/plugins/enter/enter.js +1 -1
  52. package/esm/plugins/enter/helpers/check-br.d.ts +2 -2
  53. package/esm/plugins/enter/helpers/check-br.js +9 -2
  54. package/esm/plugins/resizer/resizer.js +28 -3
  55. package/package.json +1 -1
  56. package/types/plugins/enter/helpers/check-br.d.ts +2 -2
@@ -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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
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.15.1
4
+ * Version: v4.15.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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.15.1";
6
+ export const APP_VERSION = "4.15.3";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -70,7 +70,7 @@ export class enter extends Plugin {
70
70
  const isLi = Dom.isLeaf(block);
71
71
  // if use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
72
72
  if ((!isLi || (event === null || event === void 0 ? void 0 : event.shiftKey)) &&
73
- checkBR(fake, jodit, event === null || event === void 0 ? void 0 : event.shiftKey)) {
73
+ checkBR(fake, jodit, event === null || event === void 0 ? void 0 : event.shiftKey, block)) {
74
74
  return false;
75
75
  }
76
76
  // wrap no wrapped element
@@ -6,9 +6,9 @@
6
6
  /**
7
7
  * @module plugins/enter
8
8
  */
9
- import type { IJodit } from "../../../types/index";
9
+ import type { IJodit, Nullable } from "../../../types/index";
10
10
  /**
11
11
  * Checks the possibility and necessity of inserting a BR instead of a block
12
12
  * @private
13
13
  */
14
- export declare function checkBR(fake: Text, jodit: IJodit, shiftKeyPressed?: boolean): boolean;
14
+ export declare function checkBR(fake: Text, jodit: IJodit, shiftKeyPressed?: boolean, block?: Nullable<HTMLElement>): boolean;
@@ -10,9 +10,16 @@ import { scrollIntoViewIfNeeded } from "../../../core/helpers/utils/scroll-into-
10
10
  * Checks the possibility and necessity of inserting a BR instead of a block
11
11
  * @private
12
12
  */
13
- export function checkBR(fake, jodit, shiftKeyPressed) {
13
+ export function checkBR(fake, jodit, shiftKeyPressed, block) {
14
14
  const isMultiLineBlock = Boolean(Dom.closest(fake, ['pre', 'blockquote'], jodit.editor));
15
- const isCell = !isMultiLineBlock && Dom.closest(fake, ['td', 'th'], jodit.editor);
15
+ // A cell itself can't be split into two cells, so bare cell content gets
16
+ // a BR. But when the cell already holds a real block (<p>, <h3>, ...) that
17
+ // block is split like anywhere else, otherwise every line of the cell
18
+ // stays inside one block and block styles apply to all of them at once.
19
+ const isCell = !isMultiLineBlock &&
20
+ (block
21
+ ? Dom.isCell(block)
22
+ : Boolean(Dom.closest(fake, ['td', 'th'], jodit.editor)));
16
23
  const isBRMode = jodit.o.enter.toLowerCase() === BR.toLowerCase();
17
24
  // if you use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
18
25
  if (isBRMode ||
@@ -23,6 +23,19 @@ import { cssInline } from "../../core/helpers/utils/css.js";
23
23
  import { Plugin } from "../../core/plugin/plugin.js";
24
24
  import "./config.js";
25
25
  const keyBInd = '__jodit-resizer_binded';
26
+ /**
27
+ * Reads a plain pixel value out of a `width`/`height` attribute.
28
+ * Relative values such as `100%` are ignored — they cannot be turned into a
29
+ * fixed pixel box for the wrapper.
30
+ */
31
+ function attrPixelSize(element, key) {
32
+ var _a;
33
+ const value = (_a = attr(element, key)) === null || _a === void 0 ? void 0 : _a.trim();
34
+ if (!value || !/^\d+(\.\d+)?(px)?$/i.test(value)) {
35
+ return 0;
36
+ }
37
+ return parseFloat(value);
38
+ }
26
39
  /**
27
40
  * The module creates a supporting frame for resizing of the elements img and table
28
41
  */
@@ -348,13 +361,25 @@ export class resizer extends Plugin {
348
361
  'data-jodit_iframe_wrapper': 1
349
362
  });
350
363
  attr(wrapper, 'style', attr(element, 'style'));
364
+ // Inside a hidden container (`display:none` on any ancestor)
365
+ // offsetWidth/offsetHeight are 0. Writing that into the wrapper
366
+ // collapsed it to 0x0, the following content painted over the
367
+ // iframe, and nothing corrected it once the container was shown.
368
+ // Fall back to the iframe's own size attributes and, when there
369
+ // is nothing measurable at all, let the wrapper size itself.
370
+ const width = element.offsetWidth || attrPixelSize(element, 'width');
371
+ const height = element.offsetHeight || attrPixelSize(element, 'height');
351
372
  css(wrapper, {
352
373
  display: cssInline(element, 'display') === 'inline-block'
353
374
  ? 'inline-block'
354
- : 'block',
355
- width: element.offsetWidth,
356
- height: element.offsetHeight
375
+ : 'block'
357
376
  });
377
+ if (width) {
378
+ css(wrapper, 'width', width);
379
+ }
380
+ if (height) {
381
+ css(wrapper, 'height', height);
382
+ }
358
383
  if (element.parentNode) {
359
384
  Dom.before(element, wrapper);
360
385
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.15.1",
3
+ "version": "4.15.3",
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",
@@ -6,9 +6,9 @@
6
6
  /**
7
7
  * @module plugins/enter
8
8
  */
9
- import type { IJodit } from "../../../types/index";
9
+ import type { IJodit, Nullable } from "../../../types/index";
10
10
  /**
11
11
  * Checks the possibility and necessity of inserting a BR instead of a block
12
12
  * @private
13
13
  */
14
- export declare function checkBR(fake: Text, jodit: IJodit, shiftKeyPressed?: boolean): boolean;
14
+ export declare function checkBR(fake: Text, jodit: IJodit, shiftKeyPressed?: boolean, block?: Nullable<HTMLElement>): boolean;