jodit-pro-react 5.6.17 → 5.6.18
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.
|
@@ -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.15.
|
|
196
|
+
APP_VERSION = "4.15.10";
|
|
197
197
|
ES = "es2020";
|
|
198
198
|
IS_ES_MODERN = true;
|
|
199
199
|
IS_ES_NEXT = true;
|
|
@@ -20392,10 +20392,32 @@ var Selection = class {
|
|
|
20392
20392
|
if (!Dom.up(node, (elm) => elm === this.area || elm && elm.parentNode === this.area, this.area)) {
|
|
20393
20393
|
throw error("Node element must be in editor");
|
|
20394
20394
|
}
|
|
20395
|
+
const target = !inward && this.__closestNotEditable(node) || node;
|
|
20395
20396
|
const range = this.createRange();
|
|
20396
|
-
range[inward ||
|
|
20397
|
+
range[inward || target === this.area ? "selectNodeContents" : "selectNode"](target);
|
|
20397
20398
|
return this.selectRange(range);
|
|
20398
20399
|
}
|
|
20400
|
+
/**
|
|
20401
|
+
* The outermost `contenteditable="false"` ancestor of the node inside the
|
|
20402
|
+
* editable area, if there is one.
|
|
20403
|
+
*
|
|
20404
|
+
* A range can be put inside such an island (e.g. on an `<img>` wrapped in a
|
|
20405
|
+
* `<picture contenteditable="false">`), but the browser cannot place a caret
|
|
20406
|
+
* there: the arrow keys then have nothing to move from and the selection
|
|
20407
|
+
* cannot be escaped. Selecting the island itself keeps the range in editable
|
|
20408
|
+
* content, so the caret can step over it. See #1184
|
|
20409
|
+
*/
|
|
20410
|
+
__closestNotEditable(node) {
|
|
20411
|
+
const { area } = this;
|
|
20412
|
+
let result = null, elm = node.parentNode;
|
|
20413
|
+
while (elm && elm !== area && area.contains(elm)) {
|
|
20414
|
+
if (Dom.isElement(elm) && elm.getAttribute("contenteditable") === "false") {
|
|
20415
|
+
result = elm;
|
|
20416
|
+
}
|
|
20417
|
+
elm = elm.parentNode;
|
|
20418
|
+
}
|
|
20419
|
+
return result;
|
|
20420
|
+
}
|
|
20399
20421
|
/**
|
|
20400
20422
|
* Return current selected HTML
|
|
20401
20423
|
* @example
|
|
@@ -34258,13 +34280,20 @@ var Jodit2 = Jodit_1 = class Jodit3 extends ViewWithToolbar {
|
|
|
34258
34280
|
* Return source element value
|
|
34259
34281
|
*/
|
|
34260
34282
|
getElementValue() {
|
|
34283
|
+
if (this.element === this.container && this.__inlineElementValue !== void 0) {
|
|
34284
|
+
return this.__inlineElementValue;
|
|
34285
|
+
}
|
|
34261
34286
|
return this.element.value !== void 0 ? this.element.value : this.element.innerHTML;
|
|
34262
34287
|
}
|
|
34263
34288
|
__setElementValue(value) {
|
|
34264
34289
|
if (!isString(value)) {
|
|
34265
34290
|
throw error("value must be string");
|
|
34266
34291
|
}
|
|
34267
|
-
if (this.element
|
|
34292
|
+
if (this.element === this.container) {
|
|
34293
|
+
this.__inlineElementValue = value;
|
|
34294
|
+
return;
|
|
34295
|
+
}
|
|
34296
|
+
if (value !== this.getElementValue()) {
|
|
34268
34297
|
const data = { value };
|
|
34269
34298
|
const res = this.e.fire("beforeSetElementValue", data);
|
|
34270
34299
|
callPromise(res, () => {
|