jodit 4.13.25 → 4.13.26
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 +7 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +36 -11
- package/es2015/jodit.min.js +4 -4
- 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 +4 -4
- package/es2018/jodit.min.js +4 -4
- 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 +4 -4
- package/es2021/jodit.js +36 -11
- package/es2021/jodit.min.js +4 -4
- 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 +4 -4
- package/es2021.en/jodit.js +36 -11
- package/es2021.en/jodit.min.js +25 -25
- 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 +36 -11
- 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/ui/popup/popup.js +13 -1
- package/esm/modules/toolbar/button/button.js +19 -11
- package/esm/modules/widget/color-picker/color-picker.js +8 -0
- package/package.json +1 -1
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.13.
|
|
6
|
+
export const APP_VERSION = "4.13.26";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -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, getFixedPositionOffset, isString, kebabCase, markOwner, position, ucfirst } from "../../helpers/index.js";
|
|
20
|
+
import { attr, css, getFixedPositionOffset, isFunction, 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";
|
|
@@ -250,6 +250,18 @@ export class Popup extends UIGroup {
|
|
|
250
250
|
this.j.e.fire(this, 'beforeClose');
|
|
251
251
|
this.j.e.fire('beforePopupClose', this);
|
|
252
252
|
this.__removeGlobalListeners();
|
|
253
|
+
// Blur a focused control (e.g. the color picker hex input) before
|
|
254
|
+
// the container goes away. Chrome fires `blur`/`change` for a
|
|
255
|
+
// removed focused element in the middle of `removeChild`, Firefox
|
|
256
|
+
// does not fire them at all. Blurring first makes both browsers
|
|
257
|
+
// run those handlers while the popup is still in the DOM. See #1458
|
|
258
|
+
const { activeElement } = this.od;
|
|
259
|
+
if (activeElement &&
|
|
260
|
+
activeElement !== this.container &&
|
|
261
|
+
Dom.isOrContains(this.container, activeElement) &&
|
|
262
|
+
isFunction(activeElement.blur)) {
|
|
263
|
+
activeElement.blur();
|
|
264
|
+
}
|
|
253
265
|
Dom.safeRemove(this.container);
|
|
254
266
|
return this;
|
|
255
267
|
}
|
|
@@ -381,17 +381,25 @@ let ToolbarButton = class ToolbarButton extends UIButton {
|
|
|
381
381
|
return this.openedPopup;
|
|
382
382
|
}
|
|
383
383
|
__closePopup() {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
384
|
+
const popup = this.openedPopup;
|
|
385
|
+
if (!popup) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
// Detach first: removing a popup that holds the focused element
|
|
389
|
+
// makes Chrome fire `blur`/`change` on it synchronously, and a
|
|
390
|
+
// handler there may call the popup's `close` callback again.
|
|
391
|
+
// A re-entrant call must be a no-op, otherwise it destructs the
|
|
392
|
+
// popup while the outer `removeChild` is still running and Chrome
|
|
393
|
+
// throws NotFoundError. See #1458
|
|
394
|
+
this.openedPopup = null;
|
|
395
|
+
this.j.e
|
|
396
|
+
.off(this.ow, 'mousedown touchstart', this.onOutsideClick)
|
|
397
|
+
.off('escape closeAllPopups', this.onOutsideClick);
|
|
398
|
+
this.state.activated = false;
|
|
399
|
+
popup.close();
|
|
400
|
+
popup.destruct();
|
|
401
|
+
if (this.trigger) {
|
|
402
|
+
attr(this.trigger, 'aria-expanded', false);
|
|
395
403
|
}
|
|
396
404
|
}
|
|
397
405
|
/**
|
|
@@ -51,8 +51,15 @@ export const ColorPickerWidget = (editor, callback, coldColor) => {
|
|
|
51
51
|
const { extra } = refs(form);
|
|
52
52
|
extra.appendChild(editor.c.fromHTML(`<div class="${cn}__hex"><input data-ref="hexInput" type="text" spellcheck="false" aria-label="HEX" placeholder="#FF0000" value="${valueHex || ''}"/></div>`));
|
|
53
53
|
const { hexInput } = refs(form);
|
|
54
|
+
// Enter applies the value and closes the popup; removing the focused
|
|
55
|
+
// input then makes Chrome fire `change` on it, which would apply the
|
|
56
|
+
// same color a second time and toggle it off again. See #1459
|
|
57
|
+
let appliedHexValue = null;
|
|
54
58
|
const applyHexInput = () => {
|
|
55
59
|
const raw = hexInput.value.trim();
|
|
60
|
+
if (raw === appliedHexValue) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
56
63
|
const isHex = /^#?[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(raw);
|
|
57
64
|
const isRgb = /^rgba?\([\d\s.,%]+\)$/i.test(raw);
|
|
58
65
|
if (!isHex && !isRgb) {
|
|
@@ -60,6 +67,7 @@ export const ColorPickerWidget = (editor, callback, coldColor) => {
|
|
|
60
67
|
}
|
|
61
68
|
const color = normalizeColor(isHex && !raw.startsWith('#') ? '#' + raw : raw);
|
|
62
69
|
if (color && isFunction(callback)) {
|
|
70
|
+
appliedHexValue = raw;
|
|
63
71
|
callback(color);
|
|
64
72
|
}
|
|
65
73
|
};
|