jodit 4.15.8 → 4.15.10
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 +3 -3
- package/es2015/jodit.js +39 -12
- 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 +3 -3
- 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 +39 -12
- package/es2021/jodit.min.js +5 -5
- 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 +39 -12
- package/es2021.en/jodit.min.js +5 -5
- 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 +42 -12
- 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/selection/selection.d.ts +11 -0
- package/esm/core/selection/selection.js +24 -1
- package/esm/jodit.d.ts +6 -0
- package/esm/jodit.js +9 -2
- package/package.json +1 -1
- package/types/core/selection/selection.d.ts +11 -0
- package/types/jodit.d.ts +6 -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.15.
|
|
6
|
+
export const APP_VERSION = "4.15.10";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -216,6 +216,17 @@ export declare class Selection implements ISelect {
|
|
|
216
216
|
* @param inward - select all inside
|
|
217
217
|
*/
|
|
218
218
|
select(node: Node | HTMLElement | HTMLTableElement | HTMLTableCellElement, inward?: boolean): this;
|
|
219
|
+
/**
|
|
220
|
+
* The outermost `contenteditable="false"` ancestor of the node inside the
|
|
221
|
+
* editable area, if there is one.
|
|
222
|
+
*
|
|
223
|
+
* A range can be put inside such an island (e.g. on an `<img>` wrapped in a
|
|
224
|
+
* `<picture contenteditable="false">`), but the browser cannot place a caret
|
|
225
|
+
* there: the arrow keys then have nothing to move from and the selection
|
|
226
|
+
* cannot be escaped. Selecting the island itself keeps the range in editable
|
|
227
|
+
* content, so the caret can step over it. See #1184
|
|
228
|
+
*/
|
|
229
|
+
private __closestNotEditable;
|
|
219
230
|
/**
|
|
220
231
|
* Return current selected HTML
|
|
221
232
|
* @example
|
|
@@ -971,10 +971,33 @@ export class Selection {
|
|
|
971
971
|
if (!Dom.up(node, (elm) => elm === this.area || (elm && elm.parentNode === this.area), this.area)) {
|
|
972
972
|
throw error('Node element must be in editor');
|
|
973
973
|
}
|
|
974
|
+
const target = (!inward && this.__closestNotEditable(node)) || node;
|
|
974
975
|
const range = this.createRange();
|
|
975
|
-
range[inward ||
|
|
976
|
+
range[inward || target === this.area ? 'selectNodeContents' : 'selectNode'](target);
|
|
976
977
|
return this.selectRange(range);
|
|
977
978
|
}
|
|
979
|
+
/**
|
|
980
|
+
* The outermost `contenteditable="false"` ancestor of the node inside the
|
|
981
|
+
* editable area, if there is one.
|
|
982
|
+
*
|
|
983
|
+
* A range can be put inside such an island (e.g. on an `<img>` wrapped in a
|
|
984
|
+
* `<picture contenteditable="false">`), but the browser cannot place a caret
|
|
985
|
+
* there: the arrow keys then have nothing to move from and the selection
|
|
986
|
+
* cannot be escaped. Selecting the island itself keeps the range in editable
|
|
987
|
+
* content, so the caret can step over it. See #1184
|
|
988
|
+
*/
|
|
989
|
+
__closestNotEditable(node) {
|
|
990
|
+
const { area } = this;
|
|
991
|
+
let result = null, elm = node.parentNode;
|
|
992
|
+
while (elm && elm !== area && area.contains(elm)) {
|
|
993
|
+
if (Dom.isElement(elm) &&
|
|
994
|
+
elm.getAttribute('contenteditable') === 'false') {
|
|
995
|
+
result = elm;
|
|
996
|
+
}
|
|
997
|
+
elm = elm.parentNode;
|
|
998
|
+
}
|
|
999
|
+
return result;
|
|
1000
|
+
}
|
|
978
1001
|
/**
|
|
979
1002
|
* Return current selected HTML
|
|
980
1003
|
* @example
|
package/esm/jodit.d.ts
CHANGED
|
@@ -242,6 +242,12 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
242
242
|
* If some plugin changes the DOM directly, then you need to update the content of the original element
|
|
243
243
|
*/
|
|
244
244
|
protected updateElementValue(): void;
|
|
245
|
+
/**
|
|
246
|
+
* In inline mode the source element is the editor container, so its
|
|
247
|
+
* `innerHTML` is the editor's own markup rather than the value. Keep the
|
|
248
|
+
* value last synchronised to it here instead.
|
|
249
|
+
*/
|
|
250
|
+
private __inlineElementValue;
|
|
245
251
|
/**
|
|
246
252
|
* Return source element value
|
|
247
253
|
*/
|
package/esm/jodit.js
CHANGED
|
@@ -468,6 +468,10 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
468
468
|
* Return source element value
|
|
469
469
|
*/
|
|
470
470
|
getElementValue() {
|
|
471
|
+
if (this.element === this.container &&
|
|
472
|
+
this.__inlineElementValue !== undefined) {
|
|
473
|
+
return this.__inlineElementValue;
|
|
474
|
+
}
|
|
471
475
|
return this.element.value !== undefined
|
|
472
476
|
? this.element.value
|
|
473
477
|
: this.element.innerHTML;
|
|
@@ -476,8 +480,11 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
|
|
|
476
480
|
if (!isString(value)) {
|
|
477
481
|
throw error('value must be string');
|
|
478
482
|
}
|
|
479
|
-
if (this.element
|
|
480
|
-
|
|
483
|
+
if (this.element === this.container) {
|
|
484
|
+
this.__inlineElementValue = value;
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
if (value !== this.getElementValue()) {
|
|
481
488
|
const data = { value };
|
|
482
489
|
const res = this.e.fire('beforeSetElementValue', data);
|
|
483
490
|
callPromise(res, () => {
|
package/package.json
CHANGED
|
@@ -216,6 +216,17 @@ export declare class Selection implements ISelect {
|
|
|
216
216
|
* @param inward - select all inside
|
|
217
217
|
*/
|
|
218
218
|
select(node: Node | HTMLElement | HTMLTableElement | HTMLTableCellElement, inward?: boolean): this;
|
|
219
|
+
/**
|
|
220
|
+
* The outermost `contenteditable="false"` ancestor of the node inside the
|
|
221
|
+
* editable area, if there is one.
|
|
222
|
+
*
|
|
223
|
+
* A range can be put inside such an island (e.g. on an `<img>` wrapped in a
|
|
224
|
+
* `<picture contenteditable="false">`), but the browser cannot place a caret
|
|
225
|
+
* there: the arrow keys then have nothing to move from and the selection
|
|
226
|
+
* cannot be escaped. Selecting the island itself keeps the range in editable
|
|
227
|
+
* content, so the caret can step over it. See #1184
|
|
228
|
+
*/
|
|
229
|
+
private __closestNotEditable;
|
|
219
230
|
/**
|
|
220
231
|
* Return current selected HTML
|
|
221
232
|
* @example
|
package/types/jodit.d.ts
CHANGED
|
@@ -242,6 +242,12 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
|
|
|
242
242
|
* If some plugin changes the DOM directly, then you need to update the content of the original element
|
|
243
243
|
*/
|
|
244
244
|
protected updateElementValue(): void;
|
|
245
|
+
/**
|
|
246
|
+
* In inline mode the source element is the editor container, so its
|
|
247
|
+
* `innerHTML` is the editor's own markup rather than the value. Keep the
|
|
248
|
+
* value last synchronised to it here instead.
|
|
249
|
+
*/
|
|
250
|
+
private __inlineElementValue;
|
|
245
251
|
/**
|
|
246
252
|
* Return source element value
|
|
247
253
|
*/
|