jodit 4.13.16 → 4.13.18

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 (55) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +26 -6
  5. package/es2015/jodit.min.js +3 -3
  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 +3 -3
  13. package/es2018/jodit.min.js +3 -3
  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 +4 -4
  18. package/es2021/jodit.js +26 -6
  19. package/es2021/jodit.min.js +4 -4
  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 +4 -4
  28. package/es2021.en/jodit.js +26 -6
  29. package/es2021.en/jodit.min.js +4 -4
  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 +26 -6
  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/core/helpers/utils/scroll-into-view.d.ts +0 -3
  52. package/esm/core/helpers/utils/scroll-into-view.js +12 -2
  53. package/esm/modules/uploader/helpers/send-files.js +16 -2
  54. package/package.json +1 -1
  55. package/types/core/helpers/utils/scroll-into-view.d.ts +0 -3
@@ -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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16
4
+ * Version: v4.13.18
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.13.16";
6
+ export const APP_VERSION = "4.13.18";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -7,9 +7,6 @@
7
7
  * @module helpers/utils
8
8
  */
9
9
  import type { Nullable } from "../../../types/index";
10
- /**
11
- * @module helpers/utils
12
- */
13
10
  /**
14
11
  * Check if element is in view
15
12
  */
@@ -7,6 +7,15 @@ import { Dom } from "../../dom/dom.js";
7
7
  /**
8
8
  * @module helpers/utils
9
9
  */
10
+ /**
11
+ * `getBoundingClientRect` returns fractional values while `scrollTop`,
12
+ * `offsetTop` and `clientHeight` are rounded to integers, so a container
13
+ * scrolled right up to its limit can still appear to clip the element by a
14
+ * fraction of a pixel. Treat anything clipped by less than a pixel as
15
+ * visible — otherwise `scrollIntoViewIfNeeded` falls through to
16
+ * `elm.scrollIntoView()` and needlessly scrolls the whole page.
17
+ */
18
+ const SUBPIXEL_TOLERANCE = 1;
10
19
  /**
11
20
  * Check if element is in view
12
21
  */
@@ -21,7 +30,7 @@ export function inView(elm, root, doc) {
21
30
  // view even though its top still fits. The `top > rect.top` guard keeps
22
31
  // elements taller than the container (which can never fully fit) from
23
32
  // being treated as always out of view. See #1300
24
- if (top + height > rect.bottom && top > rect.top) {
33
+ if (top + height > rect.bottom + SUBPIXEL_TOLERANCE && top > rect.top) {
25
34
  return false;
26
35
  }
27
36
  // Check if the element is out of view due to a container scrolling
@@ -35,7 +44,8 @@ export function inView(elm, root, doc) {
35
44
  // element scrolled above the top was wrongly reported as visible and never
36
45
  // scrolled to. See #1279
37
46
  const clientHeight = (doc.documentElement && doc.documentElement.clientHeight) || 0;
38
- return (top + height <= clientHeight || top <= 0) && top + height >= 0;
47
+ return ((top + height <= clientHeight + SUBPIXEL_TOLERANCE || top <= 0) &&
48
+ top + height >= 0);
39
49
  }
40
50
  /**
41
51
  * Scroll element into view if it is not in view
@@ -89,6 +89,7 @@ export function sendFiles(uploader, files, handlerSuccess, handlerError, process
89
89
  return Promise.all(promises);
90
90
  }
91
91
  function readImagesWithReader(fileList, imagesExtensions, promises, uploader, handlerSuccess, defaultHandlerSuccess) {
92
+ const readerPromises = [];
92
93
  let file, i;
93
94
  for (i = 0; i < fileList.length; i += 1) {
94
95
  file = fileList[i];
@@ -99,7 +100,7 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
99
100
  continue;
100
101
  }
101
102
  const reader = new FileReader();
102
- promises.push(uploader.j.async.promise((resolve, reject) => {
103
+ const readerPromise = uploader.j.async.promise((resolve, reject) => {
103
104
  reader.onerror = reject;
104
105
  reader.onloadend = () => {
105
106
  const resp = {
@@ -114,8 +115,21 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
114
115
  resolve(resp);
115
116
  };
116
117
  reader.readAsDataURL(file);
117
- }));
118
+ });
119
+ readerPromises.push(readerPromise);
120
+ promises.push(readerPromise);
118
121
  fileList[i] = null;
119
122
  }
120
123
  }
124
+ // Images inserted as base64 never reach the server branch in `sendFiles`,
125
+ // which is the only other place that fires `filesWereUploaded`
126
+ if (readerPromises.length) {
127
+ Promise.all(readerPromises)
128
+ .then(() => {
129
+ uploader.j.events && uploader.j.e.fire('filesWereUploaded');
130
+ })
131
+ .catch(() => {
132
+ // Read errors are propagated to the caller via `promises`
133
+ });
134
+ }
121
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.13.16",
3
+ "version": "4.13.18",
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",
@@ -7,9 +7,6 @@
7
7
  * @module helpers/utils
8
8
  */
9
9
  import type { Nullable } from "../../../types/index";
10
- /**
11
- * @module helpers/utils
12
- */
13
10
  /**
14
11
  * Check if element is in view
15
12
  */