jodit 4.16.0 → 4.16.1
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 +11 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +31 -11
- package/es2015/jodit.min.css +1 -1
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +4 -4
- package/es2018/jodit.min.css +1 -1
- 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 +11 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +4 -4
- package/es2021/jodit.js +31 -11
- package/es2021/jodit.min.css +1 -1
- 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 +11 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +4 -4
- package/es2021.en/jodit.js +31 -11
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +4 -4
- 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 +15 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +34 -11
- package/es5/jodit.min.css +3 -3
- 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/plugins/iframe/config.js +4 -0
- package/esm/plugins/image-processor/image-processor.d.ts +5 -0
- package/esm/plugins/image-processor/image-processor.js +29 -2
- package/esm/plugins/source/source.js +3 -7
- package/package.json +1 -1
- package/types/plugins/image-processor/image-processor.d.ts +5 -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.16.
|
|
6
|
+
export const APP_VERSION = "4.16.1";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -69,6 +69,10 @@ Config.prototype.iframeStyle =
|
|
|
69
69
|
'display: block;' +
|
|
70
70
|
'background: rgba(0, 0, 0, 0);' +
|
|
71
71
|
'} ' +
|
|
72
|
+
'.jodit-wysiwyg_image-selected::selection,' +
|
|
73
|
+
'.jodit-wysiwyg_image-selected *:not(img)::selection{' +
|
|
74
|
+
'background:transparent' +
|
|
75
|
+
'}' +
|
|
72
76
|
'.jodit_disabled{' +
|
|
73
77
|
'user-select: none;' +
|
|
74
78
|
'-o-user-select: none;' +
|
|
@@ -23,6 +23,11 @@ export declare class imageProcessor extends Plugin {
|
|
|
23
23
|
protected onBeforeSetElementValue(data: {
|
|
24
24
|
value: string;
|
|
25
25
|
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
28
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
29
|
+
*/
|
|
30
|
+
private onSelectionChange;
|
|
26
31
|
protected afterChange(data: {
|
|
27
32
|
value: string;
|
|
28
33
|
}): Promise<void>;
|
|
@@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
16
|
import { INVISIBLE_SPACE_REG_EXP, SOURCE_CONSUMER } from "../../core/constants.js";
|
|
17
|
-
import { cached, debounce, watch } from "../../core/decorators/index.js";
|
|
17
|
+
import { autobind, cached, debounce, watch } from "../../core/decorators/index.js";
|
|
18
18
|
import { Dom } from "../../core/dom/dom.js";
|
|
19
19
|
import { pluginSystem } from "../../core/global.js";
|
|
20
20
|
import { $$, dataBind } from "../../core/helpers/index.js";
|
|
@@ -23,12 +23,17 @@ import { dataURItoBlob } from "../../modules/uploader/helpers/data-uri-to-blob.j
|
|
|
23
23
|
import "./config.js";
|
|
24
24
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
25
25
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
26
|
+
const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
26
27
|
/**
|
|
27
28
|
* Change editor's size after load all images
|
|
28
29
|
*/
|
|
29
30
|
export class imageProcessor extends Plugin {
|
|
30
|
-
afterInit(jodit) {
|
|
31
|
+
afterInit(jodit) {
|
|
32
|
+
jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
33
|
+
}
|
|
31
34
|
beforeDestruct(jodit) {
|
|
35
|
+
jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
36
|
+
jodit.editor.classList.remove(IMAGE_SELECTED);
|
|
32
37
|
const buffer = cached(jodit, 'buffer');
|
|
33
38
|
const list = buffer === null || buffer === void 0 ? void 0 : buffer.get(JODIT_IMAGE_BLOB_ID);
|
|
34
39
|
if (buffer && list) {
|
|
@@ -59,6 +64,14 @@ export class imageProcessor extends Plugin {
|
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
69
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
70
|
+
*/
|
|
71
|
+
onSelectionChange() {
|
|
72
|
+
const { jodit } = this;
|
|
73
|
+
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
74
|
+
}
|
|
62
75
|
async afterChange(data) {
|
|
63
76
|
const { jodit: editor } = this;
|
|
64
77
|
if (!editor.editor) {
|
|
@@ -91,10 +104,24 @@ __decorate([
|
|
|
91
104
|
__decorate([
|
|
92
105
|
watch(':beforeSetElementValue')
|
|
93
106
|
], imageProcessor.prototype, "onBeforeSetElementValue", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
autobind
|
|
109
|
+
], imageProcessor.prototype, "onSelectionChange", null);
|
|
94
110
|
__decorate([
|
|
95
111
|
watch([':change', ':afterInit', ':changePlace']),
|
|
96
112
|
debounce()
|
|
97
113
|
], imageProcessor.prototype, "afterChange", null);
|
|
114
|
+
function isImageSelected(jodit) {
|
|
115
|
+
const { sel } = jodit.s;
|
|
116
|
+
if (!sel || !sel.rangeCount) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
120
|
+
return (startContainer === endContainer &&
|
|
121
|
+
endOffset === startOffset + 1 &&
|
|
122
|
+
Dom.isTag(startContainer.childNodes[startOffset], 'img') &&
|
|
123
|
+
Dom.isOrContains(jodit.editor, startContainer));
|
|
124
|
+
}
|
|
98
125
|
/**
|
|
99
126
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
100
127
|
* Selecting the image replaces the caret, and with the text still after a
|
|
@@ -271,13 +271,9 @@ export class source extends Plugin {
|
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
loading = true;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
if (addEventListener()) {
|
|
278
|
-
this.syncValueFromWYSIWYG(true);
|
|
279
|
-
}
|
|
280
|
-
}, () => null);
|
|
274
|
+
// It formats the source view from the next time it opens:
|
|
275
|
+
// filling it again now would replace what was typed there
|
|
276
|
+
loadNext(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, () => null);
|
|
281
277
|
};
|
|
282
278
|
editor.e.on('afterSetMode.source', loadBeautify);
|
|
283
279
|
loadBeautify();
|
package/package.json
CHANGED
|
@@ -23,6 +23,11 @@ export declare class imageProcessor extends Plugin {
|
|
|
23
23
|
protected onBeforeSetElementValue(data: {
|
|
24
24
|
value: string;
|
|
25
25
|
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
28
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
29
|
+
*/
|
|
30
|
+
private onSelectionChange;
|
|
26
31
|
protected afterChange(data: {
|
|
27
32
|
value: string;
|
|
28
33
|
}): Promise<void>;
|