jodit 4.12.38 → 4.12.39

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 (54) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +4 -4
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +3 -3
  5. package/es2015/jodit.js +19 -5
  6. package/es2015/jodit.min.js +3 -3
  7. package/es2015/plugins/debug/debug.css +1 -1
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.fat.min.js +3 -3
  14. package/es2018/jodit.min.js +3 -3
  15. package/es2018/plugins/debug/debug.min.js +1 -1
  16. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  17. package/es2021/jodit.css +1 -1
  18. package/es2021/jodit.fat.min.js +4 -4
  19. package/es2021/jodit.js +19 -5
  20. package/es2021/jodit.min.js +4 -4
  21. package/es2021/plugins/debug/debug.css +1 -1
  22. package/es2021/plugins/debug/debug.js +1 -1
  23. package/es2021/plugins/debug/debug.min.js +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  26. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  27. package/es2021.en/jodit.css +1 -1
  28. package/es2021.en/jodit.fat.min.js +4 -4
  29. package/es2021.en/jodit.js +19 -5
  30. package/es2021.en/jodit.min.js +4 -4
  31. package/es2021.en/plugins/debug/debug.css +1 -1
  32. package/es2021.en/plugins/debug/debug.js +1 -1
  33. package/es2021.en/plugins/debug/debug.min.js +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  37. package/es5/jodit.css +2 -2
  38. package/es5/jodit.fat.min.js +2 -2
  39. package/es5/jodit.js +19 -5
  40. package/es5/jodit.min.css +2 -2
  41. package/es5/jodit.min.js +2 -2
  42. package/es5/plugins/debug/debug.css +1 -1
  43. package/es5/plugins/debug/debug.js +1 -1
  44. package/es5/plugins/debug/debug.min.js +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  47. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  48. package/es5/polyfills.fat.min.js +1 -1
  49. package/es5/polyfills.js +1 -1
  50. package/es5/polyfills.min.js +1 -1
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/helpers/utils/scroll-into-view.js +6 -2
  53. package/esm/plugins/fullsize/fullsize.js +11 -1
  54. package/package.json +1 -1
package/es2021/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.12.38
4
+ * Version: v4.12.39
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1823,7 +1823,7 @@ __webpack_require__.r(__webpack_exports__);
1823
1823
  * ```
1824
1824
  * @packageDocumentation
1825
1825
  * @module constants
1826
- */ const APP_VERSION = "4.12.38";
1826
+ */ const APP_VERSION = "4.12.39";
1827
1827
  // prettier-ignore
1828
1828
  const ES = "es2021";
1829
1829
  const IS_ES_MODERN = true;
@@ -9054,8 +9054,12 @@ const map = {};
9054
9054
  return false;
9055
9055
  }
9056
9056
  }
9057
- // Check it's within the document viewport
9058
- return top <= (doc.documentElement && doc.documentElement.clientHeight || 0);
9057
+ // Check it's within the document viewport: the element must not be below
9058
+ // the viewport bottom, and (its bottom) must not be above the viewport top —
9059
+ // the latter guard was missing, so an element scrolled above the top was
9060
+ // wrongly reported as visible and never scrolled to. See #1279
9061
+ const clientHeight = doc.documentElement && doc.documentElement.clientHeight || 0;
9062
+ return top <= clientHeight && top + height >= 0;
9059
9063
  }
9060
9064
  /**
9061
9065
  * Scroll element into view if it is not in view
@@ -31393,7 +31397,7 @@ const fullsizeStack = new Set();
31393
31397
  editor.registerButton({
31394
31398
  name: 'fullsize'
31395
31399
  });
31396
- let isEnabled = false, oldHeight = 0, oldWidth = 0, wasToggled = false;
31400
+ let isEnabled = false, oldHeight = 0, oldWidth = 0, savedScrollLeft = 0, savedScrollTop = 0, wasToggled = false;
31397
31401
  const resize = ()=>{
31398
31402
  const { container, events } = editor;
31399
31403
  if (!events) {
@@ -31441,12 +31445,22 @@ const fullsizeStack = new Set();
31441
31445
  enable ? fullsizeStack.add(container) : fullsizeStack.delete(container);
31442
31446
  const shouldToggleGlobalFullsize = editor.o.globalFullSize && (fullsizeStack.size === 1 && enable || fullsizeStack.size === 0 && !enable);
31443
31447
  if (shouldToggleGlobalFullsize) {
31448
+ // Entering fullsize sets `position: fixed` on <html>, which
31449
+ // makes the browser reset the page scroll to the top. Remember
31450
+ // the scroll position so it can be restored on exit (#1255).
31451
+ if (enable) {
31452
+ savedScrollLeft = editor.ow.scrollX;
31453
+ savedScrollTop = editor.ow.scrollY;
31454
+ }
31444
31455
  let node = container.parentNode;
31445
31456
  while(node && node.nodeType !== Node.DOCUMENT_NODE && node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE){
31446
31457
  node.classList.toggle('jodit_fullsize-box_true', enable);
31447
31458
  node = node.parentNode;
31448
31459
  }
31449
31460
  resize();
31461
+ if (!enable) {
31462
+ editor.ow.scrollTo(savedScrollLeft, savedScrollTop);
31463
+ }
31450
31464
  }
31451
31465
  events.fire('afterResize');
31452
31466
  };