jodit 4.12.7 → 4.12.9
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.
- package/CHANGELOG.md +12 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +5 -5
- package/es2015/jodit.js +110 -32
- package/es2015/jodit.min.js +5 -5
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +5 -5
- package/es2018/jodit.min.js +5 -5
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +6 -6
- package/es2021/jodit.js +108 -32
- package/es2021/jodit.min.js +6 -6
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +6 -6
- package/es2021.en/jodit.js +108 -32
- package/es2021.en/jodit.min.js +6 -6
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +109 -31
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/size/get-fixed-position-offset.d.ts +21 -0
- package/esm/core/helpers/size/get-fixed-position-offset.js +46 -0
- package/esm/core/helpers/size/index.d.ts +1 -0
- package/esm/core/helpers/size/index.js +1 -0
- package/esm/core/ui/button/tooltip/tooltip.js +9 -3
- package/esm/core/ui/popup/popup.js +7 -3
- package/esm/plugins/select-cells/select-cells.js +11 -1
- package/package.json +1 -1
- package/types/core/helpers/size/get-fixed-position-offset.d.ts +21 -0
- package/types/core/helpers/size/index.d.ts +1 -0
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/core/constants.js
CHANGED
|
@@ -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
|
+
export const APP_VERSION = "4.12.9";
|
|
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
|
+
}
|
|
@@ -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;
|
|
@@ -184,6 +184,7 @@ export class selectCells extends Plugin {
|
|
|
184
184
|
* Stop a selection process
|
|
185
185
|
*/
|
|
186
186
|
__onStopSelection(table, e) {
|
|
187
|
+
var _a, _b;
|
|
187
188
|
if (!this.__selectedCell) {
|
|
188
189
|
return;
|
|
189
190
|
}
|
|
@@ -205,7 +206,16 @@ export class selectCells extends Plugin {
|
|
|
205
206
|
cell,
|
|
206
207
|
this.__selectedCell
|
|
207
208
|
]), box = this.__tableModule.formalMatrix(table);
|
|
208
|
-
const max = box[bound[1][0]][bound[1][1]], min = box[bound[0][0]][bound[0][1]];
|
|
209
|
+
const max = (_a = box[bound[1][0]]) === null || _a === void 0 ? void 0 : _a[bound[1][1]], min = (_b = box[bound[0][0]]) === null || _b === void 0 ? void 0 : _b[bound[0][1]];
|
|
210
|
+
// `getSelectedBound` keeps its `Infinity` sentinel when none of the
|
|
211
|
+
// selected cells belong to this table's matrix — e.g. after a
|
|
212
|
+
// drag-and-drop that moved/removed the cells, leaving a stale anchor and
|
|
213
|
+
// a drop target outside the table. Bail out instead of dereferencing an
|
|
214
|
+
// out-of-range matrix slot (which threw `Cannot read properties of
|
|
215
|
+
// undefined`).
|
|
216
|
+
if (!min || !max) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
209
219
|
this.j.e.fire('showPopup', table, () => {
|
|
210
220
|
const minOffset = position(min, this.j), maxOffset = position(max, this.j);
|
|
211
221
|
return {
|
package/package.json
CHANGED
|
@@ -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;
|