jodit-pro-react 5.5.36 → 5.5.38
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.12.
|
|
196
|
+
APP_VERSION = "4.12.21";
|
|
197
197
|
ES = "es2020";
|
|
198
198
|
IS_ES_MODERN = true;
|
|
199
199
|
IS_ES_NEXT = true;
|
|
@@ -3326,6 +3326,11 @@ function applyStyles(html) {
|
|
|
3326
3326
|
iframeDoc.open();
|
|
3327
3327
|
iframeDoc.write(html);
|
|
3328
3328
|
iframeDoc.close();
|
|
3329
|
+
Dom.each(iframeDoc.body, (node) => {
|
|
3330
|
+
if (Dom.isElement(node) && /mso-list:\s*ignore/i.test(node.getAttribute("style") || "")) {
|
|
3331
|
+
Dom.safeRemove(node);
|
|
3332
|
+
}
|
|
3333
|
+
});
|
|
3329
3334
|
try {
|
|
3330
3335
|
for (let i53 = 0; i53 < iframeDoc.styleSheets.length; i53 += 1) {
|
|
3331
3336
|
const rules = iframeDoc.styleSheets[i53].cssRules;
|
|
@@ -3407,6 +3412,10 @@ function cleanFromWord(html) {
|
|
|
3407
3412
|
Dom.unwrap(node);
|
|
3408
3413
|
break;
|
|
3409
3414
|
default:
|
|
3415
|
+
if (/mso-list:\s*ignore/i.test(node.getAttribute("style") || "")) {
|
|
3416
|
+
marks.push(node);
|
|
3417
|
+
break;
|
|
3418
|
+
}
|
|
3410
3419
|
toArray(node.attributes).forEach((attr2) => {
|
|
3411
3420
|
if ([
|
|
3412
3421
|
"src",
|
|
@@ -3868,6 +3877,9 @@ var init_extend = __esm({
|
|
|
3868
3877
|
});
|
|
3869
3878
|
|
|
3870
3879
|
// node_modules/jodit/esm/core/helpers/utils/config-proto.js
|
|
3880
|
+
function isUnsafeProtoKey(key3) {
|
|
3881
|
+
return UNSAFE_PROTO_KEYS.indexOf(key3) !== -1;
|
|
3882
|
+
}
|
|
3871
3883
|
function ConfigProto(options2, proto, deep = 0) {
|
|
3872
3884
|
if (Object.getPrototypeOf(options2) !== Object.prototype) {
|
|
3873
3885
|
return options2;
|
|
@@ -3886,6 +3898,9 @@ function ConfigProto(options2, proto, deep = 0) {
|
|
|
3886
3898
|
}
|
|
3887
3899
|
const newOpt = {};
|
|
3888
3900
|
Object.keys(options2).forEach((key3) => {
|
|
3901
|
+
if (isUnsafeProtoKey(key3)) {
|
|
3902
|
+
return;
|
|
3903
|
+
}
|
|
3889
3904
|
const opt = options2[key3], protoKey = proto ? proto[key3] : null;
|
|
3890
3905
|
if (isPlainObject(opt) && isPlainObject(protoKey) && !isAtom(opt)) {
|
|
3891
3906
|
newOpt[key3] = ConfigProto(opt, protoKey, deep + 1);
|
|
@@ -3908,6 +3923,9 @@ function ConfigFlatten(obj) {
|
|
|
3908
3923
|
}
|
|
3909
3924
|
function ConfigMerge(target, source2) {
|
|
3910
3925
|
Object.keys(source2).forEach((key3) => {
|
|
3926
|
+
if (isUnsafeProtoKey(key3)) {
|
|
3927
|
+
return;
|
|
3928
|
+
}
|
|
3911
3929
|
const srcVal = source2[key3];
|
|
3912
3930
|
const tgtVal = target[key3];
|
|
3913
3931
|
if (isPlainObject(srcVal) && isPlainObject(tgtVal) && !isAtom(srcVal)) {
|
|
@@ -3923,6 +3941,7 @@ function ConfigDeepFlatten(obj) {
|
|
|
3923
3941
|
return app;
|
|
3924
3942
|
}, {});
|
|
3925
3943
|
}
|
|
3944
|
+
var UNSAFE_PROTO_KEYS;
|
|
3926
3945
|
var init_config_proto = __esm({
|
|
3927
3946
|
"node_modules/jodit/esm/core/helpers/utils/config-proto.js"() {
|
|
3928
3947
|
"use strict";
|
|
@@ -3933,6 +3952,7 @@ var init_config_proto = __esm({
|
|
|
3933
3952
|
init_config();
|
|
3934
3953
|
init_extend();
|
|
3935
3954
|
init_utils();
|
|
3955
|
+
UNSAFE_PROTO_KEYS = ["__proto__", "constructor", "prototype"];
|
|
3936
3956
|
}
|
|
3937
3957
|
});
|
|
3938
3958
|
|
|
@@ -3965,7 +3985,6 @@ var init_convert_media_url_to_video_embed = __esm({
|
|
|
3965
3985
|
return url2;
|
|
3966
3986
|
}
|
|
3967
3987
|
const parser = globalDocument.createElement("a");
|
|
3968
|
-
const pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
|
|
3969
3988
|
parser.href = url2;
|
|
3970
3989
|
if (!width) {
|
|
3971
3990
|
width = 400;
|
|
@@ -3976,17 +3995,29 @@ var init_convert_media_url_to_video_embed = __esm({
|
|
|
3976
3995
|
const protocol = parser.protocol || "";
|
|
3977
3996
|
switch (parser.hostname) {
|
|
3978
3997
|
case "www.vimeo.com":
|
|
3979
|
-
case "vimeo.com":
|
|
3980
|
-
|
|
3998
|
+
case "vimeo.com": {
|
|
3999
|
+
const segments = parser.pathname.split("/").filter(Boolean);
|
|
4000
|
+
const idIndex = segments.findIndex((s48) => /^\d+$/.test(s48));
|
|
4001
|
+
if (idIndex === -1) {
|
|
4002
|
+
return url2;
|
|
4003
|
+
}
|
|
4004
|
+
let path = segments[idIndex];
|
|
4005
|
+
const hash = segments[idIndex + 1];
|
|
4006
|
+
if (hash && idIndex === 0) {
|
|
4007
|
+
path += "/" + hash;
|
|
4008
|
+
}
|
|
4009
|
+
return '<iframe width="' + width + '" height="' + height + '" src="' + protocol + "//player.vimeo.com/video/" + path + '" frameborder="0" allowfullscreen></iframe>';
|
|
4010
|
+
}
|
|
3981
4011
|
case "youtube.com":
|
|
3982
4012
|
case "www.youtube.com":
|
|
4013
|
+
case "m.youtube.com":
|
|
4014
|
+
case "music.youtube.com":
|
|
3983
4015
|
case "youtu.be":
|
|
3984
4016
|
case "www.youtu.be": {
|
|
3985
|
-
const query = parser.search ? parseQuery(parser.search) : {
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
return query.v ? '<iframe width="' + width + '" height="' + height + '" src="' + protocol + "//www.youtube.com/embed/" + query.v + '" frameborder="0" allowfullscreen></iframe>' : url2;
|
|
4017
|
+
const query = parser.search ? parseQuery(parser.search) : {};
|
|
4018
|
+
let v18 = query.v || parser.pathname.substring(1);
|
|
4019
|
+
v18 = v18.replace(/^(watch|embed|shorts|live|v)\//, "").replace(/\/$/, "");
|
|
4020
|
+
return v18 ? '<iframe width="' + width + '" height="' + height + '" src="' + protocol + "//www.youtube.com/embed/" + v18 + '" frameborder="0" allowfullscreen></iframe>' : url2;
|
|
3990
4021
|
}
|
|
3991
4022
|
}
|
|
3992
4023
|
return url2;
|
|
@@ -4347,20 +4378,16 @@ function safeHTML(box, options2) {
|
|
|
4347
4378
|
return;
|
|
4348
4379
|
}
|
|
4349
4380
|
const removeEvents = (_a2 = options2.removeEventAttributes) !== null && _a2 !== void 0 ? _a2 : options2.removeOnError;
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
}
|
|
4361
|
-
if (options2.safeLinksTarget) {
|
|
4362
|
-
$$('a[target="_blank"]', box).forEach((elm) => {
|
|
4363
|
-
const rel = elm.getAttribute("rel") || "";
|
|
4381
|
+
const process2 = (node) => {
|
|
4382
|
+
if (!Dom.isElement(node)) {
|
|
4383
|
+
return;
|
|
4384
|
+
}
|
|
4385
|
+
if (removeEvents) {
|
|
4386
|
+
removeAllEventAttributes(node);
|
|
4387
|
+
}
|
|
4388
|
+
sanitizeHTMLElement(node, options2);
|
|
4389
|
+
if (options2.safeLinksTarget && node.nodeName === "A" && node.getAttribute("target") === "_blank") {
|
|
4390
|
+
const rel = node.getAttribute("rel") || "";
|
|
4364
4391
|
const parts = rel.split(/\s+/).filter(Boolean);
|
|
4365
4392
|
if (!parts.includes("noopener")) {
|
|
4366
4393
|
parts.push("noopener");
|
|
@@ -4368,9 +4395,11 @@ function safeHTML(box, options2) {
|
|
|
4368
4395
|
if (!parts.includes("noreferrer")) {
|
|
4369
4396
|
parts.push("noreferrer");
|
|
4370
4397
|
}
|
|
4371
|
-
attr(
|
|
4372
|
-
}
|
|
4373
|
-
}
|
|
4398
|
+
attr(node, "rel", parts.join(" "));
|
|
4399
|
+
}
|
|
4400
|
+
};
|
|
4401
|
+
process2(box);
|
|
4402
|
+
Dom.each(box, process2);
|
|
4374
4403
|
}
|
|
4375
4404
|
function removeAllEventAttributes(elm) {
|
|
4376
4405
|
if (!Dom.isElement(elm)) {
|
|
@@ -4389,6 +4418,16 @@ function removeAllEventAttributes(elm) {
|
|
|
4389
4418
|
}
|
|
4390
4419
|
return effected;
|
|
4391
4420
|
}
|
|
4421
|
+
function isDangerousUrl(value, tagName) {
|
|
4422
|
+
const normalized = value.replace(/[\u0000-\u0020]+/g, "").toLowerCase();
|
|
4423
|
+
if (/^(?:javascript|vbscript|livescript|mocha):/.test(normalized)) {
|
|
4424
|
+
return true;
|
|
4425
|
+
}
|
|
4426
|
+
if (/^data:(?:text\/html|application\/xhtml)/.test(normalized)) {
|
|
4427
|
+
return true;
|
|
4428
|
+
}
|
|
4429
|
+
return /^data:image\/svg/.test(normalized) && DOCUMENT_EMBED_TAGS.has(tagName);
|
|
4430
|
+
}
|
|
4392
4431
|
function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError } = {
|
|
4393
4432
|
safeJavaScriptLink: true,
|
|
4394
4433
|
removeOnError: true
|
|
@@ -4406,18 +4445,43 @@ function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError } = {
|
|
|
4406
4445
|
attr(elm, "href", location.protocol + "//" + href);
|
|
4407
4446
|
effected = true;
|
|
4408
4447
|
}
|
|
4448
|
+
if (safeJavaScriptLink) {
|
|
4449
|
+
if (elm.hasAttribute("srcdoc")) {
|
|
4450
|
+
attr(elm, "srcdoc", null);
|
|
4451
|
+
effected = true;
|
|
4452
|
+
}
|
|
4453
|
+
const tagName = elm.nodeName.toLowerCase();
|
|
4454
|
+
for (const name of URL_ATTRIBUTES) {
|
|
4455
|
+
const value = elm.getAttribute(name);
|
|
4456
|
+
if (value && isDangerousUrl(value, tagName)) {
|
|
4457
|
+
attr(elm, name, null);
|
|
4458
|
+
effected = true;
|
|
4459
|
+
}
|
|
4460
|
+
}
|
|
4461
|
+
}
|
|
4409
4462
|
return effected;
|
|
4410
4463
|
}
|
|
4464
|
+
var URL_ATTRIBUTES, DOCUMENT_EMBED_TAGS;
|
|
4411
4465
|
var init_safe_html = __esm({
|
|
4412
4466
|
"node_modules/jodit/esm/core/helpers/html/safe-html.js"() {
|
|
4413
4467
|
"use strict";
|
|
4414
4468
|
init_dom();
|
|
4415
4469
|
init_utils3();
|
|
4470
|
+
URL_ATTRIBUTES = [
|
|
4471
|
+
"src",
|
|
4472
|
+
"data",
|
|
4473
|
+
"action",
|
|
4474
|
+
"formaction",
|
|
4475
|
+
"poster",
|
|
4476
|
+
"background",
|
|
4477
|
+
"xlink:href"
|
|
4478
|
+
];
|
|
4479
|
+
DOCUMENT_EMBED_TAGS = /* @__PURE__ */ new Set(["iframe", "frame", "object", "embed"]);
|
|
4416
4480
|
}
|
|
4417
4481
|
});
|
|
4418
4482
|
|
|
4419
4483
|
// node_modules/jodit/esm/core/helpers/html/strip-tags.js
|
|
4420
|
-
function stripTags(html, doc = document, exclude = null) {
|
|
4484
|
+
function stripTags(html, doc = document, exclude = null, blockBr = false) {
|
|
4421
4485
|
const tmp = doc.createElement("div");
|
|
4422
4486
|
if (isString(html)) {
|
|
4423
4487
|
tmp.innerHTML = html;
|
|
@@ -4431,7 +4495,7 @@ function stripTags(html, doc = document, exclude = null) {
|
|
|
4431
4495
|
}
|
|
4432
4496
|
if (exclude && Dom.isTag(p62, exclude)) {
|
|
4433
4497
|
const tag = p62.nodeName.toLowerCase();
|
|
4434
|
-
const text = !Dom.isTag(p62, ALONE_TAGS) ? `%%%jodit-${tag}%%%${stripTags(p62.innerHTML, doc, exclude)}%%%/jodit-${tag}%%%` : `%%%jodit-single-${tag}%%%`;
|
|
4498
|
+
const text = !Dom.isTag(p62, ALONE_TAGS) ? `%%%jodit-${tag}%%%${stripTags(p62.innerHTML, doc, exclude, blockBr)}%%%/jodit-${tag}%%%` : `%%%jodit-single-${tag}%%%`;
|
|
4435
4499
|
Dom.before(p62, doc.createTextNode(text));
|
|
4436
4500
|
Dom.safeRemove(p62);
|
|
4437
4501
|
return;
|
|
@@ -4448,7 +4512,7 @@ function stripTags(html, doc = document, exclude = null) {
|
|
|
4448
4512
|
return;
|
|
4449
4513
|
}
|
|
4450
4514
|
if (nx) {
|
|
4451
|
-
pr.insertBefore(doc.createTextNode(" "), nx);
|
|
4515
|
+
pr.insertBefore(doc.createTextNode(blockBr ? "%%%jodit-single-br%%%" : " "), nx);
|
|
4452
4516
|
}
|
|
4453
4517
|
});
|
|
4454
4518
|
return restoreTags(trim(tmp.innerText));
|
|
@@ -16622,7 +16686,17 @@ Config.prototype.enableDragAndDropFileToEditor = true;
|
|
|
16622
16686
|
Config.prototype.uploader = {
|
|
16623
16687
|
url: "",
|
|
16624
16688
|
insertImageAsBase64URI: false,
|
|
16625
|
-
imagesExtensions: [
|
|
16689
|
+
imagesExtensions: [
|
|
16690
|
+
"jpg",
|
|
16691
|
+
"jpeg",
|
|
16692
|
+
"png",
|
|
16693
|
+
"gif",
|
|
16694
|
+
"webp",
|
|
16695
|
+
"bmp",
|
|
16696
|
+
"svg",
|
|
16697
|
+
"tiff",
|
|
16698
|
+
"avif"
|
|
16699
|
+
],
|
|
16626
16700
|
headers: null,
|
|
16627
16701
|
data: null,
|
|
16628
16702
|
filesVariableName(i53) {
|
|
@@ -20259,7 +20333,8 @@ function isRemovableNode(jodit, node, current, allow, deny) {
|
|
|
20259
20333
|
if (!jodit.o.cleanHTML.removeEmptyElements) {
|
|
20260
20334
|
return false;
|
|
20261
20335
|
}
|
|
20262
|
-
|
|
20336
|
+
const liveCaret = jodit.s.isCollapsed() ? jodit.s.range.startContainer : null;
|
|
20337
|
+
return Dom.isElement(node) && node.nodeName.match(IS_INLINE) != null && !Dom.isTemporary(node) && trimInv(node.innerHTML).length === 0 && (current == null || !Dom.isOrContains(node, current)) && (liveCaret == null || !Dom.isOrContains(node, liveCaret));
|
|
20263
20338
|
}
|
|
20264
20339
|
|
|
20265
20340
|
// node_modules/jodit/esm/plugins/clean-html/helpers/visitor/visit-node-walker.js
|
|
@@ -20780,8 +20855,9 @@ Config.prototype.controls.brush = {
|
|
|
20780
20855
|
const update = (key3, value) => {
|
|
20781
20856
|
if (value && value !== css(editor.editor, key3).toString()) {
|
|
20782
20857
|
button.state.icon.fill = value;
|
|
20783
|
-
return;
|
|
20858
|
+
return true;
|
|
20784
20859
|
}
|
|
20860
|
+
return false;
|
|
20785
20861
|
};
|
|
20786
20862
|
if (color2) {
|
|
20787
20863
|
const mode = dataBind(button, "color");
|
|
@@ -20791,8 +20867,11 @@ Config.prototype.controls.brush = {
|
|
|
20791
20867
|
const current = editor.s.current();
|
|
20792
20868
|
if (current && !button.state.disabled) {
|
|
20793
20869
|
const currentBpx = Dom.closest(current, Dom.isElement, editor.editor) || editor.editor;
|
|
20794
|
-
update("color", css(currentBpx, "color").toString());
|
|
20795
|
-
update("background-color", css(currentBpx, "background-color").toString());
|
|
20870
|
+
const hasColor = update("color", css(currentBpx, "color").toString());
|
|
20871
|
+
const hasBackground = update("background-color", css(currentBpx, "background-color").toString());
|
|
20872
|
+
if (hasColor || hasBackground) {
|
|
20873
|
+
return;
|
|
20874
|
+
}
|
|
20796
20875
|
}
|
|
20797
20876
|
button.state.icon.fill = "";
|
|
20798
20877
|
button.state.activated = false;
|
|
@@ -21342,11 +21421,32 @@ var dragAndDropElement = class _dragAndDropElement extends Plugin {
|
|
|
21342
21421
|
/** @override */
|
|
21343
21422
|
afterInit() {
|
|
21344
21423
|
this.dragList = this.j.o.draggableTags ? splitArray(this.j.o.draggableTags).filter(Boolean).map((item) => item.toLowerCase()) : [];
|
|
21424
|
+
this.j.e.on("startDragElement", this.onStartDragElement);
|
|
21345
21425
|
if (!this.dragList.length) {
|
|
21346
21426
|
return;
|
|
21347
21427
|
}
|
|
21348
21428
|
this.j.e.on("mousedown dragstart", this.onDragStart);
|
|
21349
21429
|
}
|
|
21430
|
+
/**
|
|
21431
|
+
* Start dragging a specific element programmatically.
|
|
21432
|
+
*
|
|
21433
|
+
* Allows a separate UI element (for example a drag handle/anchor shown next
|
|
21434
|
+
* to a block) to initiate the drag without the user pressing directly on the
|
|
21435
|
+
* draggable element itself.
|
|
21436
|
+
*
|
|
21437
|
+
* @example
|
|
21438
|
+
* ```js
|
|
21439
|
+
* handle.addEventListener('mousedown', e => {
|
|
21440
|
+
* editor.e.fire('startDragElement', preBlock, e);
|
|
21441
|
+
* });
|
|
21442
|
+
* ```
|
|
21443
|
+
*/
|
|
21444
|
+
onStartDragElement(element, event) {
|
|
21445
|
+
if (this.isInDestruct || this.state > DragState.IDLE || !element) {
|
|
21446
|
+
return;
|
|
21447
|
+
}
|
|
21448
|
+
this.startDragging(element, event);
|
|
21449
|
+
}
|
|
21350
21450
|
/**
|
|
21351
21451
|
* Drag start handler
|
|
21352
21452
|
*/
|
|
@@ -21369,11 +21469,19 @@ var dragAndDropElement = class _dragAndDropElement extends Plugin {
|
|
|
21369
21469
|
if (Dom.isTag(lastTarget.parentElement, "a") && lastTarget.parentElement.firstChild === lastTarget && lastTarget.parentElement.lastChild === lastTarget) {
|
|
21370
21470
|
lastTarget = lastTarget.parentElement;
|
|
21371
21471
|
}
|
|
21472
|
+
this.startDragging(lastTarget, event);
|
|
21473
|
+
}
|
|
21474
|
+
/**
|
|
21475
|
+
* Prepare the ghost element and switch to the waiting state.
|
|
21476
|
+
* Shared by the native mousedown handler and the programmatic
|
|
21477
|
+
* `startDragElement` event handler.
|
|
21478
|
+
*/
|
|
21479
|
+
startDragging(target, event) {
|
|
21372
21480
|
this.startX = event.clientX;
|
|
21373
21481
|
this.startY = event.clientY;
|
|
21374
21482
|
this.isCopyMode = ctrlKey(event);
|
|
21375
|
-
this.draggable =
|
|
21376
|
-
dataBind(this.draggable, "target",
|
|
21483
|
+
this.draggable = target.cloneNode(true);
|
|
21484
|
+
dataBind(this.draggable, "target", target);
|
|
21377
21485
|
this.state = DragState.WAIT_DRAGGING;
|
|
21378
21486
|
this.addDragListeners();
|
|
21379
21487
|
}
|
|
@@ -21446,6 +21554,11 @@ var dragAndDropElement = class _dragAndDropElement extends Plugin {
|
|
|
21446
21554
|
}
|
|
21447
21555
|
const { parentElement } = fragment;
|
|
21448
21556
|
this.j.s.insertNode(fragment, true, false);
|
|
21557
|
+
[fragment.previousSibling, fragment.nextSibling].forEach((node) => {
|
|
21558
|
+
if (Dom.isEmptyTextNode(node)) {
|
|
21559
|
+
Dom.safeRemove(node);
|
|
21560
|
+
}
|
|
21561
|
+
});
|
|
21449
21562
|
if (parentElement && Dom.isEmpty(parentElement) && !Dom.isCell(parentElement)) {
|
|
21450
21563
|
Dom.safeRemove(parentElement);
|
|
21451
21564
|
}
|
|
@@ -21469,10 +21582,13 @@ var dragAndDropElement = class _dragAndDropElement extends Plugin {
|
|
|
21469
21582
|
/** @override */
|
|
21470
21583
|
beforeDestruct() {
|
|
21471
21584
|
this.onDragEnd();
|
|
21472
|
-
this.j.e.off("mousedown dragstart", this.onDragStart);
|
|
21585
|
+
this.j.e.off("mousedown dragstart", this.onDragStart).off("startDragElement", this.onStartDragElement);
|
|
21473
21586
|
this.removeDragListeners();
|
|
21474
21587
|
}
|
|
21475
21588
|
};
|
|
21589
|
+
__decorate41([
|
|
21590
|
+
autobind
|
|
21591
|
+
], dragAndDropElement.prototype, "onStartDragElement", null);
|
|
21476
21592
|
__decorate41([
|
|
21477
21593
|
autobind
|
|
21478
21594
|
], dragAndDropElement.prototype, "onDragStart", null);
|
|
@@ -21710,12 +21826,14 @@ var enter = class extends Plugin {
|
|
|
21710
21826
|
if (beforeEnter !== void 0) {
|
|
21711
21827
|
return beforeEnter;
|
|
21712
21828
|
}
|
|
21713
|
-
|
|
21714
|
-
editor.
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21829
|
+
editor.history.snapshot.transaction(() => {
|
|
21830
|
+
if (!editor.s.isCollapsed()) {
|
|
21831
|
+
editor.execCommand("Delete");
|
|
21832
|
+
}
|
|
21833
|
+
editor.s.focus();
|
|
21834
|
+
this.onEnter(event);
|
|
21835
|
+
editor.e.fire("afterEnter", event);
|
|
21836
|
+
});
|
|
21719
21837
|
editor.synchronizeValues();
|
|
21720
21838
|
return false;
|
|
21721
21839
|
}
|
|
@@ -22208,7 +22326,7 @@ init_config();
|
|
|
22208
22326
|
Config.prototype.commandToHotkeys = {
|
|
22209
22327
|
removeFormat: ["ctrl+shift+m", "cmd+shift+m"],
|
|
22210
22328
|
insertOrderedList: ["ctrl+shift+7", "cmd+shift+7"],
|
|
22211
|
-
insertUnorderedList: ["ctrl+shift+8, cmd+shift+8"],
|
|
22329
|
+
insertUnorderedList: ["ctrl+shift+8", "cmd+shift+8"],
|
|
22212
22330
|
selectall: ["ctrl+a", "cmd+a"]
|
|
22213
22331
|
};
|
|
22214
22332
|
|
|
@@ -23838,14 +23956,25 @@ Config.prototype.controls.indent = {
|
|
|
23838
23956
|
};
|
|
23839
23957
|
Config.prototype.controls.outdent = {
|
|
23840
23958
|
isDisabled: (editor) => {
|
|
23959
|
+
var _a2;
|
|
23841
23960
|
const current = editor.s.current();
|
|
23842
|
-
if (current) {
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
|
|
23846
|
-
|
|
23961
|
+
if (!current) {
|
|
23962
|
+
return true;
|
|
23963
|
+
}
|
|
23964
|
+
if ((_a2 = editor.o.tab) === null || _a2 === void 0 ? void 0 : _a2.tabInsideLiInsertNewList) {
|
|
23965
|
+
const li = Dom.closest(current, "li", editor.editor);
|
|
23966
|
+
if (li) {
|
|
23967
|
+
const list = Dom.closest(li, ["ul", "ol"], editor.editor);
|
|
23968
|
+
if (list && Dom.closest(list, "li", editor.editor)) {
|
|
23969
|
+
return false;
|
|
23970
|
+
}
|
|
23847
23971
|
}
|
|
23848
23972
|
}
|
|
23973
|
+
const currentBox = Dom.closest(current, Dom.isBlock, editor.editor);
|
|
23974
|
+
if (currentBox) {
|
|
23975
|
+
const arrow = getKey(editor.o.direction, currentBox);
|
|
23976
|
+
return !currentBox.style[arrow] || parseInt(currentBox.style[arrow], 10) <= 0;
|
|
23977
|
+
}
|
|
23849
23978
|
return true;
|
|
23850
23979
|
},
|
|
23851
23980
|
tooltip: "Decrease Indent"
|
|
@@ -26096,10 +26225,13 @@ var paste = class extends Plugin {
|
|
|
26096
26225
|
html = cleanFromWord(html);
|
|
26097
26226
|
break;
|
|
26098
26227
|
case INSERT_ONLY_TEXT:
|
|
26099
|
-
html = stripTags(html, this.j.ed, new Set(this.j.o.pasteExcludeStripTags));
|
|
26228
|
+
html = stripTags(html, this.j.ed, new Set(this.j.o.pasteExcludeStripTags), this.j.o.nl2brInPlainText);
|
|
26100
26229
|
break;
|
|
26101
26230
|
case INSERT_AS_TEXT:
|
|
26102
26231
|
html = htmlspecialchars(html);
|
|
26232
|
+
if (this.j.o.nl2brInPlainText) {
|
|
26233
|
+
html = nl2br(html);
|
|
26234
|
+
}
|
|
26103
26235
|
break;
|
|
26104
26236
|
default: {
|
|
26105
26237
|
const newHTML = this.j.e.fire("onCustomPasteHTMLOption", action, html, e42);
|
|
@@ -26199,7 +26331,7 @@ var pasteFromWord = class extends Plugin {
|
|
|
26199
26331
|
break;
|
|
26200
26332
|
}
|
|
26201
26333
|
case INSERT_ONLY_TEXT: {
|
|
26202
|
-
html = stripTags(cleanFromWord(html));
|
|
26334
|
+
html = stripTags(cleanFromWord(html), this.j.ed, new Set(this.j.o.pasteExcludeStripTags), this.j.o.nl2brInPlainText);
|
|
26203
26335
|
break;
|
|
26204
26336
|
}
|
|
26205
26337
|
}
|
|
@@ -28299,6 +28431,7 @@ __decorate61([
|
|
|
28299
28431
|
pluginSystem.add("search", search);
|
|
28300
28432
|
|
|
28301
28433
|
// node_modules/jodit/esm/plugins/select/select.js
|
|
28434
|
+
init_constants();
|
|
28302
28435
|
init_decorators();
|
|
28303
28436
|
init_dom();
|
|
28304
28437
|
init_global2();
|
|
@@ -28407,6 +28540,34 @@ var select = class extends Plugin {
|
|
|
28407
28540
|
s48.setCursorAfter(text);
|
|
28408
28541
|
}
|
|
28409
28542
|
}
|
|
28543
|
+
/**
|
|
28544
|
+
* Keep pending inline formatting after a click. Toggling Bold/Italic/etc. on
|
|
28545
|
+
* a collapsed cursor leaves empty marker elements with the caret inside; a
|
|
28546
|
+
* click puts the caret right before them (outside), so they get cleaned up
|
|
28547
|
+
* and the formatting is lost. Move the caret back into the innermost marker
|
|
28548
|
+
* so the next typed character keeps every pending format (#1291).
|
|
28549
|
+
*/
|
|
28550
|
+
onClickKeepPendingFormat() {
|
|
28551
|
+
var _a2, _b;
|
|
28552
|
+
const { s: s48 } = this.j;
|
|
28553
|
+
const range = s48.range;
|
|
28554
|
+
if (!range.collapsed || !Dom.isText(range.startContainer)) {
|
|
28555
|
+
return;
|
|
28556
|
+
}
|
|
28557
|
+
const text = range.startContainer;
|
|
28558
|
+
if (range.startOffset !== ((_b = (_a2 = text.nodeValue) === null || _a2 === void 0 ? void 0 : _a2.length) !== null && _b !== void 0 ? _b : 0)) {
|
|
28559
|
+
return;
|
|
28560
|
+
}
|
|
28561
|
+
const marker = text.nextSibling;
|
|
28562
|
+
if (!Dom.isElement(marker) || !marker.nodeName.match(IS_INLINE) || !Dom.isEmpty(marker)) {
|
|
28563
|
+
return;
|
|
28564
|
+
}
|
|
28565
|
+
let inner = marker;
|
|
28566
|
+
while (Dom.isElement(inner.firstElementChild) && inner.firstElementChild.nodeName.match(IS_INLINE)) {
|
|
28567
|
+
inner = inner.firstElementChild;
|
|
28568
|
+
}
|
|
28569
|
+
s48.setCursorIn(inner);
|
|
28570
|
+
}
|
|
28410
28571
|
/**
|
|
28411
28572
|
* Normalize selection after triple click
|
|
28412
28573
|
*/
|
|
@@ -28446,6 +28607,9 @@ __decorate62([
|
|
|
28446
28607
|
__decorate62([
|
|
28447
28608
|
watch([":click"])
|
|
28448
28609
|
], select.prototype, "onClickRightOfNestedListItem", null);
|
|
28610
|
+
__decorate62([
|
|
28611
|
+
watch([":click"])
|
|
28612
|
+
], select.prototype, "onClickKeepPendingFormat", null);
|
|
28449
28613
|
__decorate62([
|
|
28450
28614
|
watch([":click"])
|
|
28451
28615
|
], select.prototype, "onTripleClickNormalizeSelection", null);
|
|
@@ -33005,6 +33169,17 @@ var Jodit2 = Jodit_1 = class Jodit3 extends ViewWithToolbar {
|
|
|
33005
33169
|
}
|
|
33006
33170
|
this.synchronizeValues();
|
|
33007
33171
|
}
|
|
33172
|
+
}).on(this.ow, "mouseup", (event) => {
|
|
33173
|
+
if (this.o.readonly || this.__isSilentChange) {
|
|
33174
|
+
return;
|
|
33175
|
+
}
|
|
33176
|
+
const target = event.target;
|
|
33177
|
+
const insideEditor = Boolean(target && isNumber(target.nodeType) && editor.contains(target));
|
|
33178
|
+
if (insideEditor || !this.s.isInsideArea) {
|
|
33179
|
+
return;
|
|
33180
|
+
}
|
|
33181
|
+
this.e.fire("changeSelection");
|
|
33182
|
+
this.synchronizeValues();
|
|
33008
33183
|
});
|
|
33009
33184
|
}
|
|
33010
33185
|
fetch(url2, options2) {
|