jodit-pro-react 5.5.76 → 5.5.77

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JoditEditor_default
3
- } from "./chunk-ZCRVIN23.mjs";
3
+ } from "./chunk-66ZF3QZL.mjs";
4
4
  export {
5
5
  JoditEditor_default as default
6
6
  };
@@ -193,7 +193,7 @@ var APP_VERSION, ES, IS_ES_MODERN, IS_ES_NEXT, IS_PROD, IS_TEST, FAT_MODE, HOMEP
193
193
  var init_constants = __esm({
194
194
  "node_modules/jodit/esm/core/constants.js"() {
195
195
  "use strict";
196
- APP_VERSION = "4.13.15";
196
+ APP_VERSION = "4.13.16";
197
197
  ES = "es2020";
198
198
  IS_ES_MODERN = true;
199
199
  IS_ES_NEXT = true;
@@ -4303,7 +4303,7 @@ function inView(elm, root, doc) {
4303
4303
  while (el && el !== root && el.parentNode) {
4304
4304
  el = el.parentNode;
4305
4305
  rect = el.getBoundingClientRect();
4306
- if (!(top <= rect.bottom)) {
4306
+ if (top + height > rect.bottom && top > rect.top) {
4307
4307
  return false;
4308
4308
  }
4309
4309
  if (top + height <= rect.top) {
@@ -4311,12 +4311,13 @@ function inView(elm, root, doc) {
4311
4311
  }
4312
4312
  }
4313
4313
  const clientHeight = doc.documentElement && doc.documentElement.clientHeight || 0;
4314
- return top <= clientHeight && top + height >= 0;
4314
+ return (top + height <= clientHeight || top <= 0) && top + height >= 0;
4315
4315
  }
4316
4316
  function scrollIntoViewIfNeeded(elm, root, doc) {
4317
4317
  if (Dom.isHTMLElement(elm) && !inView(elm, root, doc)) {
4318
4318
  if (root.clientHeight !== root.scrollHeight) {
4319
- root.scrollTop = elm.offsetTop;
4319
+ const alignBottom = elm.offsetTop + elm.offsetHeight - root.clientHeight;
4320
+ root.scrollTop = root.scrollTop < alignBottom ? alignBottom : elm.offsetTop;
4320
4321
  }
4321
4322
  if (!inView(elm, root, doc)) {
4322
4323
  elm.scrollIntoView();
@@ -22167,8 +22168,12 @@ function splitFragment(fake, jodit, block) {
22167
22168
  }
22168
22169
  return;
22169
22170
  }
22170
- const newP = sel.splitSelection(block, fake);
22171
- scrollIntoViewIfNeeded(newP, jodit.editor, jodit.ed);
22171
+ const { scrollTop } = jodit.editor;
22172
+ sel.splitSelection(block, fake);
22173
+ if (jodit.editor.scrollTop !== scrollTop) {
22174
+ jodit.editor.scrollTop = scrollTop;
22175
+ }
22176
+ scrollIntoViewIfNeeded(block, jodit.editor, jodit.ed);
22172
22177
  }
22173
22178
 
22174
22179
  // node_modules/jodit/esm/plugins/enter/helpers/wrap-text.js
@@ -2,7 +2,7 @@ import {
2
2
  Config,
3
3
  JoditEditor_default,
4
4
  n
5
- } from "./chunk-ZCRVIN23.mjs";
5
+ } from "./chunk-66ZF3QZL.mjs";
6
6
 
7
7
  // src/index.ts
8
8
  var index_default = JoditEditor_default;