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/es2021/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.16.
|
|
4
|
+
* Version: v4.16.1
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1799,7 +1799,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1799
1799
|
* ```
|
|
1800
1800
|
* @packageDocumentation
|
|
1801
1801
|
* @module constants
|
|
1802
|
-
*/ const APP_VERSION = "4.16.
|
|
1802
|
+
*/ const APP_VERSION = "4.16.1";
|
|
1803
1803
|
// prettier-ignore
|
|
1804
1804
|
const ES = "es2021";
|
|
1805
1805
|
const IS_ES_MODERN = true;
|
|
@@ -32901,7 +32901,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
|
|
|
32901
32901
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
|
|
32902
32902
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
|
|
32903
32903
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
|
|
32904
|
-
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
|
|
32904
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit-wysiwyg_image-selected::selection,' + '.jodit-wysiwyg_image-selected *:not(img)::selection{' + 'background:transparent' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
|
|
32905
32905
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
|
|
32906
32906
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
32907
32907
|
|
|
@@ -33143,13 +33143,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
33143
33143
|
|
|
33144
33144
|
|
|
33145
33145
|
|
|
33146
|
+
|
|
33146
33147
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
33147
33148
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
33149
|
+
const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
33148
33150
|
/**
|
|
33149
33151
|
* Change editor's size after load all images
|
|
33150
33152
|
*/ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
33151
|
-
afterInit(jodit) {
|
|
33153
|
+
afterInit(jodit) {
|
|
33154
|
+
jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
33155
|
+
}
|
|
33152
33156
|
beforeDestruct(jodit) {
|
|
33157
|
+
jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
33158
|
+
jodit.editor.classList.remove(IMAGE_SELECTED);
|
|
33153
33159
|
const buffer = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(jodit, 'buffer');
|
|
33154
33160
|
const list = buffer?.get(JODIT_IMAGE_BLOB_ID);
|
|
33155
33161
|
if (buffer && list) {
|
|
@@ -33180,6 +33186,13 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
33180
33186
|
}
|
|
33181
33187
|
}
|
|
33182
33188
|
}
|
|
33189
|
+
/**
|
|
33190
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
33191
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
33192
|
+
*/ onSelectionChange() {
|
|
33193
|
+
const { jodit } = this;
|
|
33194
|
+
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
33195
|
+
}
|
|
33183
33196
|
async afterChange(data) {
|
|
33184
33197
|
const { jodit: editor } = this;
|
|
33185
33198
|
if (!editor.editor) {
|
|
@@ -33211,6 +33224,9 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
33211
33224
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
33212
33225
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeSetElementValue')
|
|
33213
33226
|
], imageProcessor.prototype, "onBeforeSetElementValue", null);
|
|
33227
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
33228
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
|
|
33229
|
+
], imageProcessor.prototype, "onSelectionChange", null);
|
|
33214
33230
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
33215
33231
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
|
|
33216
33232
|
':change',
|
|
@@ -33219,6 +33235,14 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
33219
33235
|
]),
|
|
33220
33236
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.debounce)()
|
|
33221
33237
|
], imageProcessor.prototype, "afterChange", null);
|
|
33238
|
+
function isImageSelected(jodit) {
|
|
33239
|
+
const { sel } = jodit.s;
|
|
33240
|
+
if (!sel || !sel.rangeCount) {
|
|
33241
|
+
return false;
|
|
33242
|
+
}
|
|
33243
|
+
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
33244
|
+
return startContainer === endContainer && endOffset === startOffset + 1 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(startContainer.childNodes[startOffset], 'img') && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(jodit.editor, startContainer);
|
|
33245
|
+
}
|
|
33222
33246
|
/**
|
|
33223
33247
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
33224
33248
|
* Selecting the image replaces the caret, and with the text still after a
|
|
@@ -42624,13 +42648,9 @@ class SourceEditor {
|
|
|
42624
42648
|
return;
|
|
42625
42649
|
}
|
|
42626
42650
|
loading = true;
|
|
42627
|
-
|
|
42628
|
-
|
|
42629
|
-
|
|
42630
|
-
if (addEventListener()) {
|
|
42631
|
-
this.syncValueFromWYSIWYG(true);
|
|
42632
|
-
}
|
|
42633
|
-
}, ()=>null);
|
|
42651
|
+
// It formats the source view from the next time it opens:
|
|
42652
|
+
// filling it again now would replace what was typed there
|
|
42653
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
|
|
42634
42654
|
};
|
|
42635
42655
|
editor.e.on('afterSetMode.source', loadBeautify);
|
|
42636
42656
|
loadBeautify();
|