jodit 4.12.6 → 4.12.8

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 (60) 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 +115 -33
  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 +6 -6
  18. package/es2021/jodit.js +114 -33
  19. package/es2021/jodit.min.js +6 -6
  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 +6 -6
  28. package/es2021.en/jodit.js +114 -33
  29. package/es2021.en/jodit.min.js +6 -6
  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 +114 -32
  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/size/get-fixed-position-offset.d.ts +21 -0
  52. package/esm/core/helpers/size/get-fixed-position-offset.js +46 -0
  53. package/esm/core/helpers/size/index.d.ts +1 -0
  54. package/esm/core/helpers/size/index.js +1 -0
  55. package/esm/core/ui/button/tooltip/tooltip.js +9 -3
  56. package/esm/core/ui/popup/popup.js +7 -3
  57. package/esm/modules/table/table.js +16 -2
  58. package/package.json +1 -1
  59. package/types/core/helpers/size/get-fixed-position-offset.d.ts +21 -0
  60. package/types/core/helpers/size/index.d.ts +1 -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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6
4
+ * Version: v4.12.8
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.12.6";
6
+ export const APP_VERSION = "4.12.8";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module helpers/size
8
+ */
9
+ import type { IPoint } from "../../../types/index";
10
+ /**
11
+ * Returns the viewport offset of the containing block of a `position: fixed`
12
+ * descendant of `elm`. A fixed element is normally positioned relative to the
13
+ * viewport, but an ancestor with `transform`, `filter`, `perspective`, etc.
14
+ * establishes a new containing block, shifting the fixed element by that
15
+ * ancestor's top-left corner. The returned offset should be subtracted from
16
+ * the desired viewport coordinates before applying them.
17
+ *
18
+ * Returns `{ x: 0, y: 0 }` when no such ancestor exists (the common case), so
19
+ * call sites keep their previous behaviour unchanged.
20
+ */
21
+ export declare function getFixedPositionOffset(elm: HTMLElement): IPoint;
@@ -0,0 +1,46 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * Whether the element establishes a containing block for its
8
+ * `position: fixed` descendants, so their coordinates become relative to it
9
+ * instead of the viewport.
10
+ */
11
+ function isContainingBlockForFixed(style) {
12
+ return ((style.transform !== '' && style.transform !== 'none') ||
13
+ (style.perspective !== '' && style.perspective !== 'none') ||
14
+ (style.filter !== '' && style.filter !== 'none') ||
15
+ style.willChange === 'transform' ||
16
+ style.willChange === 'perspective' ||
17
+ style.willChange === 'filter' ||
18
+ style.contain === 'paint' ||
19
+ style.contain === 'layout' ||
20
+ style.contain === 'strict' ||
21
+ style.contain === 'content');
22
+ }
23
+ /**
24
+ * Returns the viewport offset of the containing block of a `position: fixed`
25
+ * descendant of `elm`. A fixed element is normally positioned relative to the
26
+ * viewport, but an ancestor with `transform`, `filter`, `perspective`, etc.
27
+ * establishes a new containing block, shifting the fixed element by that
28
+ * ancestor's top-left corner. The returned offset should be subtracted from
29
+ * the desired viewport coordinates before applying them.
30
+ *
31
+ * Returns `{ x: 0, y: 0 }` when no such ancestor exists (the common case), so
32
+ * call sites keep their previous behaviour unchanged.
33
+ */
34
+ export function getFixedPositionOffset(elm) {
35
+ var _a;
36
+ const win = (_a = elm.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
37
+ let node = elm.parentElement;
38
+ while (win && node) {
39
+ if (isContainingBlockForFixed(win.getComputedStyle(node))) {
40
+ const rect = node.getBoundingClientRect();
41
+ return { x: rect.left, y: rect.top };
42
+ }
43
+ node = node.parentElement;
44
+ }
45
+ return { x: 0, y: 0 };
46
+ }
@@ -7,6 +7,7 @@
7
7
  * @module helpers/size
8
8
  */
9
9
  export * from "./get-content-width";
10
+ export * from "./get-fixed-position-offset";
10
11
  export * from "./get-scroll-parent";
11
12
  export * from "./inner-width";
12
13
  export * from "./object-size";
@@ -7,6 +7,7 @@
7
7
  * @module helpers/size
8
8
  */
9
9
  export * from "./get-content-width.js";
10
+ export * from "./get-fixed-position-offset.js";
10
11
  export * from "./get-scroll-parent.js";
11
12
  export * from "./inner-width.js";
12
13
  export * from "./object-size.js";
@@ -18,6 +18,7 @@ import { STATUSES } from "../../../component/index.js";
18
18
  import { autobind, component } from "../../../decorators/index.js";
19
19
  import { Dom } from "../../../dom/index.js";
20
20
  import { getContainer } from "../../../global.js";
21
+ import { getFixedPositionOffset } from "../../../helpers/size/get-fixed-position-offset.js";
21
22
  import { position } from "../../../helpers/size/position.js";
22
23
  import { attr, css } from "../../../helpers/utils/index.js";
23
24
  import { UIElement } from "../../element.js";
@@ -146,9 +147,14 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
146
147
  this.setMod('above', false);
147
148
  this.getElm('content').innerHTML = content;
148
149
  const point = getPoint();
150
+ // The tooltip is `position: fixed`. If it is rendered inside an ancestor
151
+ // with a `transform` (e.g. an editor placed in a modal/flyout), that
152
+ // ancestor becomes the containing block, so viewport coordinates must be
153
+ // shifted by its offset. Returns `{0, 0}` when there is no such ancestor.
154
+ const offset = getFixedPositionOffset(this.container);
149
155
  css(this.container, {
150
- left: point.x,
151
- top: point.y
156
+ left: point.x - offset.x,
157
+ top: point.y - offset.y
152
158
  });
153
159
  const tooltipPos = position(this.container);
154
160
  const viewHeight = this.j.ow.innerHeight;
@@ -157,7 +163,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
157
163
  const targetPos = position(this.__currentTarget);
158
164
  this.setMod('above', true);
159
165
  css(this.container, {
160
- top: targetPos.top - tooltipPos.height
166
+ top: targetPos.top - tooltipPos.height - offset.y
161
167
  });
162
168
  }
163
169
  }
@@ -17,7 +17,7 @@ import { Component } from "../../component/component.js";
17
17
  import { autobind, throttle } from "../../decorators/index.js";
18
18
  import { Dom } from "../../dom/dom.js";
19
19
  import { eventEmitter, getContainer } from "../../global.js";
20
- import { attr, css, isString, kebabCase, markOwner, position, ucfirst } from "../../helpers/index.js";
20
+ import { attr, css, getFixedPositionOffset, isString, kebabCase, markOwner, position, ucfirst } from "../../helpers/index.js";
21
21
  import { assert } from "../../helpers/utils/assert.js";
22
22
  import { UIElement } from "../element.js";
23
23
  import { UIGroup } from "../group/group.js";
@@ -165,9 +165,13 @@ export class Popup extends UIGroup {
165
165
  }
166
166
  const [pos, strategy] = this.__calculatePosition(this.__targetBound(), this.viewBound(), position(this.container, this.j));
167
167
  this.setMod('strategy', strategy);
168
+ // The popup is `position: fixed`; shift by the containing-block offset
169
+ // when it is rendered inside a transformed ancestor (e.g. a modal),
170
+ // otherwise `{0, 0}` keeps the viewport coordinates unchanged.
171
+ const offset = getFixedPositionOffset(this.container);
168
172
  css(this.container, {
169
- left: pos.left,
170
- top: pos.top
173
+ left: pos.left - offset.x,
174
+ top: pos.top - offset.y
171
175
  });
172
176
  this.__childrenPopups.forEach(popup => popup.updatePosition());
173
177
  return this;
@@ -228,8 +228,22 @@ export class Table extends ViewComponent {
228
228
  }
229
229
  const nextRow = Dom.next(cell.parentNode, elm => Dom.isTag(elm, 'tr'), table);
230
230
  if (nextRow) {
231
- if (box[rowIndex + 1][nextCell]) {
232
- nextRow.insertBefore(cell, box[rowIndex + 1][nextCell]);
231
+ // `box[rowIndex + 1][nextCell]` is the cell that
232
+ // logically follows the moved cell in the next row, but
233
+ // it may physically belong to an earlier `<tr>` (when it
234
+ // spans down from a row above). Inserting before such a
235
+ // cell throws `NotFoundError`, so look for the first
236
+ // following cell that is actually a child of `nextRow`.
237
+ let referenceCell = null;
238
+ for (let nextColumn = nextCell; nextColumn < box[rowIndex + 1].length; nextColumn += 1) {
239
+ const candidate = box[rowIndex + 1][nextColumn];
240
+ if (candidate && candidate.parentNode === nextRow) {
241
+ referenceCell = candidate;
242
+ break;
243
+ }
244
+ }
245
+ if (referenceCell) {
246
+ nextRow.insertBefore(cell, referenceCell);
233
247
  }
234
248
  else {
235
249
  nextRow.appendChild(cell);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.12.6",
3
+ "version": "4.12.8",
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",
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module helpers/size
8
+ */
9
+ import type { IPoint } from "../../../types/index";
10
+ /**
11
+ * Returns the viewport offset of the containing block of a `position: fixed`
12
+ * descendant of `elm`. A fixed element is normally positioned relative to the
13
+ * viewport, but an ancestor with `transform`, `filter`, `perspective`, etc.
14
+ * establishes a new containing block, shifting the fixed element by that
15
+ * ancestor's top-left corner. The returned offset should be subtracted from
16
+ * the desired viewport coordinates before applying them.
17
+ *
18
+ * Returns `{ x: 0, y: 0 }` when no such ancestor exists (the common case), so
19
+ * call sites keep their previous behaviour unchanged.
20
+ */
21
+ export declare function getFixedPositionOffset(elm: HTMLElement): IPoint;
@@ -7,6 +7,7 @@
7
7
  * @module helpers/size
8
8
  */
9
9
  export * from "./get-content-width";
10
+ export * from "./get-fixed-position-offset";
10
11
  export * from "./get-scroll-parent";
11
12
  export * from "./inner-width";
12
13
  export * from "./object-size";