jodit 4.19.10 → 4.19.12
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 +150 -131
- package/es2015/jodit.css +33 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +10 -10
- package/es2015/jodit.js +781 -195
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +10 -10
- 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 +10 -10
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +10 -10
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +33 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +15 -15
- package/es2021/jodit.js +780 -193
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +15 -15
- 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 +33 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +22 -22
- package/es2021.en/jodit.js +780 -193
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +22 -22
- 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 +34 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +827 -200
- 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/core/dom/dom.js +2 -2
- package/esm/core/helpers/checker/is-html-from-word.d.ts +4 -3
- package/esm/core/helpers/checker/is-html-from-word.js +94 -14
- package/esm/core/helpers/checker/is-html.d.ts +4 -0
- package/esm/core/helpers/checker/is-html.js +54 -2
- package/esm/core/helpers/html/apply-styles.js +20 -11
- package/esm/core/helpers/html/clean-from-word.js +2 -3
- package/esm/core/helpers/html/index.d.ts +1 -0
- package/esm/core/helpers/html/index.js +1 -0
- package/esm/core/helpers/html/tag-scan.d.ts +36 -0
- package/esm/core/helpers/html/tag-scan.js +257 -0
- package/esm/core/helpers/string/trim.d.ts +4 -0
- package/esm/core/helpers/string/trim.js +29 -10
- package/esm/core/selection/helpers/index.js +3 -2
- package/esm/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/esm/core/ui/button/tooltip/tooltip.js +14 -3
- package/esm/core/view/view-with-toolbar.js +6 -1
- package/esm/jodit.js +2 -1
- package/esm/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/esm/plugins/add-new-line/add-new-line.js +20 -3
- package/esm/plugins/delete/delete.d.ts +7 -0
- package/esm/plugins/delete/delete.js +38 -2
- package/esm/plugins/hr/hr.js +5 -0
- package/esm/plugins/iframe/iframe.js +59 -12
- package/esm/plugins/media/media.js +10 -9
- package/esm/plugins/paste/helpers.js +4 -2
- package/esm/plugins/resizer/resizer.js +6 -5
- package/esm/plugins/select-cells/select-cells.d.ts +1 -0
- package/esm/plugins/select-cells/select-cells.js +12 -18
- package/package.json +1 -1
- package/types/core/helpers/checker/is-html-from-word.d.ts +4 -3
- package/types/core/helpers/checker/is-html.d.ts +4 -0
- package/types/core/helpers/html/index.d.ts +1 -0
- package/types/core/helpers/html/tag-scan.d.ts +36 -0
- package/types/core/helpers/string/trim.d.ts +4 -0
- package/types/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/types/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/types/plugins/delete/delete.d.ts +7 -0
- package/types/plugins/select-cells/select-cells.d.ts +1 -0
package/es2015/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.19.
|
|
4
|
+
* Version: v4.19.12
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1830,7 +1830,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1830
1830
|
* ```
|
|
1831
1831
|
* @packageDocumentation
|
|
1832
1832
|
* @module constants
|
|
1833
|
-
*/ const APP_VERSION = "4.19.
|
|
1833
|
+
*/ const APP_VERSION = "4.19.12";
|
|
1834
1834
|
// prettier-ignore
|
|
1835
1835
|
const ES = "es2015";
|
|
1836
1836
|
const IS_ES_MODERN = true;
|
|
@@ -3096,14 +3096,15 @@ function wait(condition) {
|
|
|
3096
3096
|
/* harmony import */ var jodit_core_helpers_checker_is_set__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3213);
|
|
3097
3097
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85932);
|
|
3098
3098
|
/* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18303);
|
|
3099
|
-
/* harmony import */ var
|
|
3100
|
-
/* harmony import */ var
|
|
3101
|
-
/* harmony import */ var
|
|
3102
|
-
/* harmony import */ var
|
|
3103
|
-
/* harmony import */ var
|
|
3104
|
-
/* harmony import */ var
|
|
3105
|
-
/* harmony import */ var
|
|
3106
|
-
/* harmony import */ var
|
|
3099
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81910);
|
|
3100
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4040);
|
|
3101
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28712);
|
|
3102
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__);
|
|
3103
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7909);
|
|
3104
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(80991);
|
|
3105
|
+
/* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(36400);
|
|
3106
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(33201);
|
|
3107
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(71125);
|
|
3107
3108
|
/*!
|
|
3108
3109
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3109
3110
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -3128,7 +3129,7 @@ function wait(condition) {
|
|
|
3128
3129
|
|
|
3129
3130
|
|
|
3130
3131
|
|
|
3131
|
-
|
|
3132
|
+
|
|
3132
3133
|
/**
|
|
3133
3134
|
* Module for working with DOM
|
|
3134
3135
|
*/ class Dom {
|
|
@@ -3206,7 +3207,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3206
3207
|
const wrapper = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(tag) ? create.element(tag) : tag;
|
|
3207
3208
|
if (Dom.isNode(current)) {
|
|
3208
3209
|
if (!current.parentNode) {
|
|
3209
|
-
throw (0,
|
|
3210
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_14__.error)('Element should be in DOM');
|
|
3210
3211
|
}
|
|
3211
3212
|
current.parentNode.insertBefore(wrapper, current);
|
|
3212
3213
|
wrapper.appendChild(current);
|
|
@@ -3256,12 +3257,12 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3256
3257
|
}
|
|
3257
3258
|
static replace(elm, newTagName, create, withAttributes = false, notMoveContent = false) {
|
|
3258
3259
|
if ((0,jodit_core_helpers_checker_is_html__WEBPACK_IMPORTED_MODULE_4__.isHTML)(newTagName)) {
|
|
3259
|
-
(0,
|
|
3260
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(create, 'Need create instance for new tag');
|
|
3260
3261
|
newTagName = create.fromHTML(newTagName);
|
|
3261
3262
|
}
|
|
3262
3263
|
let tag;
|
|
3263
3264
|
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(newTagName)) {
|
|
3264
|
-
(0,
|
|
3265
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(create, 'Need create instance for new tag');
|
|
3265
3266
|
tag = create.element(newTagName);
|
|
3266
3267
|
} else {
|
|
3267
3268
|
tag = newTagName;
|
|
@@ -3310,7 +3311,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3310
3311
|
} else {
|
|
3311
3312
|
cond = condNoEmptyElement;
|
|
3312
3313
|
}
|
|
3313
|
-
const emptyText = (node)=>node.nodeValue == null || (0,
|
|
3314
|
+
const emptyText = (node)=>node.nodeValue == null || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(node.nodeValue).length === 0;
|
|
3314
3315
|
if (Dom.isText(node)) {
|
|
3315
3316
|
return emptyText(node);
|
|
3316
3317
|
}
|
|
@@ -3401,7 +3402,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3401
3402
|
return Dom.isElement(node) && !/^(BR|HR)$/i.test(node.tagName) && [
|
|
3402
3403
|
'inline',
|
|
3403
3404
|
'inline-block'
|
|
3404
|
-
].indexOf((0,
|
|
3405
|
+
].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_12__.css)(node, 'display').toString()) !== -1;
|
|
3405
3406
|
}
|
|
3406
3407
|
/**
|
|
3407
3408
|
* It's block and it can be split
|
|
@@ -3576,13 +3577,13 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3576
3577
|
*/ static findNotEmptySibling(node, left) {
|
|
3577
3578
|
return Dom.findSibling(node, left, (n)=>{
|
|
3578
3579
|
var _n_nodeValue;
|
|
3579
|
-
return !Dom.isEmptyTextNode(n) && Boolean(!Dom.isText(n) || ((_n_nodeValue = n.nodeValue) === null || _n_nodeValue === void 0 ? void 0 : _n_nodeValue.length) && (0,
|
|
3580
|
+
return !Dom.isEmptyTextNode(n) && Boolean(!Dom.isText(n) || ((_n_nodeValue = n.nodeValue) === null || _n_nodeValue === void 0 ? void 0 : _n_nodeValue.length) && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(n.nodeValue));
|
|
3580
3581
|
});
|
|
3581
3582
|
}
|
|
3582
3583
|
/**
|
|
3583
3584
|
* Returns the nearest non-empty neighbor
|
|
3584
3585
|
*/ static findNotEmptyNeighbor(node, left, root) {
|
|
3585
|
-
return (0,
|
|
3586
|
+
return (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_15__.call)(left ? Dom.prev : Dom.next, node, (n)=>Boolean(n && (!(Dom.isText(n) || Dom.isComment(n)) || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)((n === null || n === void 0 ? void 0 : n.nodeValue) || '').length)), root);
|
|
3586
3587
|
}
|
|
3587
3588
|
static sibling(node, left) {
|
|
3588
3589
|
return left ? node.previousSibling : node.nextSibling;
|
|
@@ -3729,7 +3730,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3729
3730
|
if (!node) {
|
|
3730
3731
|
return;
|
|
3731
3732
|
}
|
|
3732
|
-
;(0,
|
|
3733
|
+
;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__.dataBind)(node, '__old_display', node.style.getPropertyValue('display'));
|
|
3733
3734
|
node.style.setProperty('display', 'none');
|
|
3734
3735
|
}
|
|
3735
3736
|
/**
|
|
@@ -3738,7 +3739,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3738
3739
|
if (!node) {
|
|
3739
3740
|
return;
|
|
3740
3741
|
}
|
|
3741
|
-
const display = (0,
|
|
3742
|
+
const display = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__.dataBind)(node, '__old_display');
|
|
3742
3743
|
if (node.style.getPropertyValue('display') === 'none') {
|
|
3743
3744
|
node.style.setProperty('display', display || null);
|
|
3744
3745
|
}
|
|
@@ -3759,8 +3760,8 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3759
3760
|
/**
|
|
3760
3761
|
* Marks an item as temporary
|
|
3761
3762
|
*/ static markTemporary(element, attributes) {
|
|
3762
|
-
attributes && (0,
|
|
3763
|
-
(0,
|
|
3763
|
+
attributes && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, attributes);
|
|
3764
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR, true);
|
|
3764
3765
|
return element;
|
|
3765
3766
|
}
|
|
3766
3767
|
/**
|
|
@@ -3769,7 +3770,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3769
3770
|
if (!Dom.isElement(element)) {
|
|
3770
3771
|
return false;
|
|
3771
3772
|
}
|
|
3772
|
-
return Dom.isMarker(element) || (0,
|
|
3773
|
+
return Dom.isMarker(element) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR) === 'true';
|
|
3773
3774
|
}
|
|
3774
3775
|
/**
|
|
3775
3776
|
* Define element is selection helper
|
|
@@ -3779,7 +3780,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3779
3780
|
/**
|
|
3780
3781
|
* Unwrap temporary elements inside a HTML string (keeps their content)
|
|
3781
3782
|
*/ static replaceTemporaryFromString(value) {
|
|
3782
|
-
return
|
|
3783
|
+
return (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_8__.unwrapMarkedTags)(value, null, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR);
|
|
3783
3784
|
}
|
|
3784
3785
|
/**
|
|
3785
3786
|
* Collect the temporary elements (`data-jodit-temp`) inside the root.
|
|
@@ -5349,16 +5350,96 @@ function isFastEqual(a, b) {
|
|
|
5349
5350
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5350
5351
|
*/ /**
|
|
5351
5352
|
* @module helpers/checker
|
|
5352
|
-
*/
|
|
5353
|
+
*/ const SPACE = /\s/;
|
|
5354
|
+
const DIGIT = /\d/;
|
|
5355
|
+
const WORD_CHAR = /\w/;
|
|
5356
|
+
// `content="Microsoft Word 15"` — the name followed by a space and a version digit
|
|
5357
|
+
function hasGenerator(tag, name) {
|
|
5358
|
+
let index = tag.indexOf(name);
|
|
5359
|
+
while(index !== -1){
|
|
5360
|
+
const after = index + name.length;
|
|
5361
|
+
if (SPACE.test(tag.charAt(after)) && DIGIT.test(tag.charAt(after + 1))) {
|
|
5362
|
+
return true;
|
|
5363
|
+
}
|
|
5364
|
+
index = tag.indexOf(name, after);
|
|
5365
|
+
}
|
|
5366
|
+
return false;
|
|
5367
|
+
}
|
|
5368
|
+
// `<meta name=ProgId content=Word.Document>`, `<meta name=Generator content="LibreOffice 7.6">`
|
|
5369
|
+
function isOfficeMeta(tag) {
|
|
5370
|
+
if (hasGenerator(tag, 'Microsoft Word') || hasGenerator(tag, 'Microsoft Excel')) {
|
|
5371
|
+
return true;
|
|
5372
|
+
}
|
|
5373
|
+
const lower = tag.toLowerCase();
|
|
5374
|
+
const progId = lower.indexOf('progid');
|
|
5375
|
+
if (progId !== -1 && (lower.indexOf('word.', progId) !== -1 || lower.indexOf('excel.', progId) !== -1)) {
|
|
5376
|
+
return true;
|
|
5377
|
+
}
|
|
5378
|
+
return lower.includes('libreoffice') || lower.includes('openoffice');
|
|
5379
|
+
}
|
|
5380
|
+
// ` class=MsoNormal`, ` class="MsoListParagraph"` inside one tag
|
|
5381
|
+
function hasMsoClass(tag) {
|
|
5382
|
+
let index = tag.indexOf('class=');
|
|
5383
|
+
while(index !== -1){
|
|
5384
|
+
if (index > 0 && SPACE.test(tag.charAt(index - 1))) {
|
|
5385
|
+
let value = index + 'class='.length;
|
|
5386
|
+
const quote = tag.charAt(value);
|
|
5387
|
+
if (quote === '"' || quote === "'") {
|
|
5388
|
+
value += 1;
|
|
5389
|
+
}
|
|
5390
|
+
if (tag.startsWith('Mso', value)) {
|
|
5391
|
+
return true;
|
|
5392
|
+
}
|
|
5393
|
+
}
|
|
5394
|
+
index = tag.indexOf('class=', index + 'class='.length);
|
|
5395
|
+
}
|
|
5396
|
+
return false;
|
|
5397
|
+
}
|
|
5398
|
+
// `style='mso-list:l0 level1 lfo1'` — an `mso-` property inside a style attribute with the given quote
|
|
5399
|
+
function hasMsoStyle(data, quote) {
|
|
5400
|
+
const open = 'style=' + quote;
|
|
5401
|
+
let index = data.indexOf(open);
|
|
5402
|
+
while(index !== -1){
|
|
5403
|
+
const start = index + open.length;
|
|
5404
|
+
let end = data.indexOf(quote, start);
|
|
5405
|
+
if (end === -1) {
|
|
5406
|
+
end = data.length;
|
|
5407
|
+
}
|
|
5408
|
+
if (data.slice(start, end).includes('mso-')) {
|
|
5409
|
+
return true;
|
|
5410
|
+
}
|
|
5411
|
+
index = data.indexOf(open, end);
|
|
5412
|
+
}
|
|
5413
|
+
return false;
|
|
5414
|
+
}
|
|
5415
|
+
/**
|
|
5353
5416
|
* Detect if string is HTML from MS Word, Excel or LibreOffice/OpenOffice
|
|
5417
|
+
*
|
|
5418
|
+
* The clipboard text is attacker controlled, so every check walks the string
|
|
5419
|
+
* once with `indexOf`: a regex with an unbounded group before a required
|
|
5420
|
+
* literal was quadratic on a long run of `<meta` and froze the tab.
|
|
5354
5421
|
*/ function isHtmlFromWord(data) {
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5422
|
+
if (data.includes('urn:schemas-microsoft-com:office:word') || data.includes('urn:schemas-microsoft-com:office:excel')) {
|
|
5423
|
+
return true;
|
|
5424
|
+
}
|
|
5425
|
+
// Each tag is taken once, from its `<` to the next `>`, so the scan stays linear
|
|
5426
|
+
let index = data.indexOf('<');
|
|
5427
|
+
while(index !== -1){
|
|
5428
|
+
if (!WORD_CHAR.test(data.charAt(index + 1))) {
|
|
5429
|
+
index = data.indexOf('<', index + 1);
|
|
5430
|
+
continue;
|
|
5431
|
+
}
|
|
5432
|
+
let end = data.indexOf('>', index);
|
|
5433
|
+
if (end === -1) {
|
|
5434
|
+
end = data.length;
|
|
5435
|
+
}
|
|
5436
|
+
const tag = data.slice(index, end);
|
|
5437
|
+
if (tag.slice(0, 5).toLowerCase() === '<meta' && isOfficeMeta(tag) || hasMsoClass(tag)) {
|
|
5438
|
+
return true;
|
|
5439
|
+
}
|
|
5440
|
+
index = data.indexOf('<', end);
|
|
5441
|
+
}
|
|
5442
|
+
return hasMsoStyle(data, "'") || hasMsoStyle(data, '"') && data.includes('<font');
|
|
5362
5443
|
}
|
|
5363
5444
|
|
|
5364
5445
|
|
|
@@ -5376,9 +5457,62 @@ function isFastEqual(a, b) {
|
|
|
5376
5457
|
*/ /**
|
|
5377
5458
|
* @module helpers/checker
|
|
5378
5459
|
*/
|
|
5460
|
+
const NAME_START = /[A-Za-z]/;
|
|
5461
|
+
const NAME_CHAR = /[A-Za-z0-9]/;
|
|
5462
|
+
const WORD_CHAR = /\w/;
|
|
5463
|
+
// The tag name at `from`, or '' when there is none
|
|
5464
|
+
function readTagName(str, from) {
|
|
5465
|
+
if (!NAME_START.test(str.charAt(from))) {
|
|
5466
|
+
return '';
|
|
5467
|
+
}
|
|
5468
|
+
let end = from + 1;
|
|
5469
|
+
while(NAME_CHAR.test(str.charAt(end))){
|
|
5470
|
+
end += 1;
|
|
5471
|
+
}
|
|
5472
|
+
return str.slice(from, end);
|
|
5473
|
+
}
|
|
5474
|
+
// Is there an element `<name ...>` closed later by `</name>`? One pass for the closing tags, one for the opening ones
|
|
5475
|
+
function hasElement(str) {
|
|
5476
|
+
const lastClose = new Map();
|
|
5477
|
+
let index = str.indexOf('</');
|
|
5478
|
+
while(index !== -1){
|
|
5479
|
+
const name = readTagName(str, index + 2);
|
|
5480
|
+
if (name !== '' && str.charAt(index + 2 + name.length) === '>') {
|
|
5481
|
+
lastClose.set(name, index);
|
|
5482
|
+
}
|
|
5483
|
+
index = str.indexOf('</', index + 2);
|
|
5484
|
+
}
|
|
5485
|
+
if (lastClose.size === 0) {
|
|
5486
|
+
return false;
|
|
5487
|
+
}
|
|
5488
|
+
let gt = -1;
|
|
5489
|
+
index = str.indexOf('<');
|
|
5490
|
+
while(index !== -1){
|
|
5491
|
+
const name = readTagName(str, index + 1);
|
|
5492
|
+
const after = index + 1 + name.length;
|
|
5493
|
+
if (name !== '' && !WORD_CHAR.test(str.charAt(after))) {
|
|
5494
|
+
if (gt < after) {
|
|
5495
|
+
gt = str.indexOf('>', after);
|
|
5496
|
+
}
|
|
5497
|
+
if (gt === -1) {
|
|
5498
|
+
return false;
|
|
5499
|
+
}
|
|
5500
|
+
const close = lastClose.get(name);
|
|
5501
|
+
if (close !== undefined && close > gt) {
|
|
5502
|
+
return true;
|
|
5503
|
+
}
|
|
5504
|
+
}
|
|
5505
|
+
index = str.indexOf('<', index + 1);
|
|
5506
|
+
}
|
|
5507
|
+
return false;
|
|
5508
|
+
}
|
|
5379
5509
|
/**
|
|
5380
5510
|
* Check if a string is html or not
|
|
5381
|
-
|
|
5511
|
+
*
|
|
5512
|
+
* The pasted text is attacker controlled, so the check walks the string with
|
|
5513
|
+
* `indexOf`: the former regex `<(\w+)[^>]*>(.*?)<\/\1>` was quadratic on a
|
|
5514
|
+
* long run of `<a>` and froze the tab.
|
|
5515
|
+
*/ const isHTML = (str)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString)(str) && hasElement(str);
|
|
5382
5516
|
|
|
5383
5517
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
5384
5518
|
/* harmony export */ "isHTML", 0, /* binding */ isHTML
|
|
@@ -5897,11 +6031,12 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5897
6031
|
/* harmony export */ });
|
|
5898
6032
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
5899
6033
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
5900
|
-
/* harmony import */ var
|
|
5901
|
-
/* harmony import */ var
|
|
5902
|
-
/* harmony import */ var
|
|
5903
|
-
/* harmony import */ var
|
|
5904
|
-
/* harmony import */ var
|
|
6034
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81910);
|
|
6035
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
|
|
6036
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
|
|
6037
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
|
|
6038
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
|
|
6039
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(28723);
|
|
5905
6040
|
/*!
|
|
5906
6041
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
5907
6042
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -5915,8 +6050,19 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5915
6050
|
|
|
5916
6051
|
|
|
5917
6052
|
|
|
6053
|
+
|
|
6054
|
+
// Drop the `mso-*` and `border*` declarations and turn pt/cm into px; one declaration at a time, so a long value cannot make the regexes backtrack
|
|
5918
6055
|
function normalizeCSS(s) {
|
|
5919
|
-
|
|
6056
|
+
const declarations = s.split(';');
|
|
6057
|
+
const last = declarations.length - 1;
|
|
6058
|
+
return declarations.filter((declaration, index)=>{
|
|
6059
|
+
const match = /^\s*([a-z-]{1,64})\s*:/i.exec(declaration);
|
|
6060
|
+
if (!match) {
|
|
6061
|
+
return true;
|
|
6062
|
+
}
|
|
6063
|
+
const property = match[1].toLowerCase();
|
|
6064
|
+
return !(property.startsWith('mso-') || property.startsWith('border') && index !== last);
|
|
6065
|
+
}).join(';').replace(/([0-9.]{1,32})(pt|cm)/gi, (match, units, metrics)=>{
|
|
5920
6066
|
switch(metrics.toLowerCase()){
|
|
5921
6067
|
case 'pt':
|
|
5922
6068
|
return (parseFloat(units) * 1.328).toFixed(0) + 'px';
|
|
@@ -5938,17 +6084,17 @@ function normalizeCSS(s) {
|
|
|
5938
6084
|
// cell backgrounds/borders, e.g. `.xl31 { background:#FCE4D6 }`) were never
|
|
5939
6085
|
// inlined and all styling was lost once the `<style>` block got stripped.
|
|
5940
6086
|
// See https://github.com/xdan/jodit/issues/1362
|
|
5941
|
-
const
|
|
5942
|
-
if (
|
|
6087
|
+
const open = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__.indexOfOpenTag)(html, 'html');
|
|
6088
|
+
if (open === -1) {
|
|
5943
6089
|
return html;
|
|
5944
6090
|
}
|
|
5945
|
-
html = html.substring(
|
|
6091
|
+
html = html.substring(open);
|
|
5946
6092
|
const closeIndex = html.toLowerCase().lastIndexOf('</html>');
|
|
5947
6093
|
if (closeIndex !== -1) {
|
|
5948
6094
|
html = html.substring(0, closeIndex + '</html>'.length);
|
|
5949
6095
|
}
|
|
5950
6096
|
const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
|
|
5951
|
-
(0,
|
|
6097
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(iframe, 'display', 'none');
|
|
5952
6098
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
|
|
5953
6099
|
let convertedString = '', collection;
|
|
5954
6100
|
try {
|
|
@@ -5957,14 +6103,14 @@ function normalizeCSS(s) {
|
|
|
5957
6103
|
iframeDoc.open();
|
|
5958
6104
|
iframeDoc.write(html);
|
|
5959
6105
|
iframeDoc.close();
|
|
5960
|
-
const listItems = (0,
|
|
6106
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(iframeDoc.body);
|
|
5961
6107
|
// Word marks its auto-generated list markers (the literal
|
|
5962
6108
|
// bullet/number, e.g. `1.` or `·`) with `mso-list:Ignore`.
|
|
5963
6109
|
// They are display-only and must not be imported, otherwise
|
|
5964
6110
|
// the marker text leaks into the content. Drop them before any
|
|
5965
6111
|
// style normalization strips the `mso-list` hint. See #948
|
|
5966
6112
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5967
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,
|
|
6113
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style') || '')) {
|
|
5968
6114
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
|
|
5969
6115
|
}
|
|
5970
6116
|
});
|
|
@@ -5975,7 +6121,7 @@ function normalizeCSS(s) {
|
|
|
5975
6121
|
if (rules[idx].selectorText === '') {
|
|
5976
6122
|
continue;
|
|
5977
6123
|
}
|
|
5978
|
-
collection = (0,
|
|
6124
|
+
collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_7__.$$)(rules[idx].selectorText, iframeDoc.body);
|
|
5979
6125
|
// `style.cssText` on purpose: the CSSOM parses the text,
|
|
5980
6126
|
// drops invalid declarations and re-serializes it. The raw
|
|
5981
6127
|
// `style` attribute would keep Word-only junk verbatim
|
|
@@ -5989,19 +6135,19 @@ function normalizeCSS(s) {
|
|
|
5989
6135
|
throw e;
|
|
5990
6136
|
}
|
|
5991
6137
|
}
|
|
5992
|
-
;(0,
|
|
6138
|
+
;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
|
|
5993
6139
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5994
6140
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node)) {
|
|
5995
|
-
const cssText = (0,
|
|
6141
|
+
const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style');
|
|
5996
6142
|
if (cssText) {
|
|
5997
6143
|
node.style.cssText = normalizeCSS(cssText);
|
|
5998
6144
|
}
|
|
5999
|
-
if (!(0,
|
|
6000
|
-
(0,
|
|
6145
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style')) {
|
|
6146
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style', null);
|
|
6001
6147
|
}
|
|
6002
6148
|
}
|
|
6003
6149
|
});
|
|
6004
|
-
convertedString = iframeDoc.firstChild ? (0,
|
|
6150
|
+
convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim)(iframeDoc.body.innerHTML) : '';
|
|
6005
6151
|
}
|
|
6006
6152
|
} catch (unused) {} finally{
|
|
6007
6153
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(iframe);
|
|
@@ -6009,7 +6155,7 @@ function normalizeCSS(s) {
|
|
|
6009
6155
|
if (convertedString) {
|
|
6010
6156
|
html = convertedString;
|
|
6011
6157
|
}
|
|
6012
|
-
return (0,
|
|
6158
|
+
return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim)((0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__.removeWordWrappers)(html));
|
|
6013
6159
|
}
|
|
6014
6160
|
|
|
6015
6161
|
|
|
@@ -6025,9 +6171,10 @@ function normalizeCSS(s) {
|
|
|
6025
6171
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
6026
6172
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
6027
6173
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
6028
|
-
/* harmony import */ var
|
|
6029
|
-
/* harmony import */ var
|
|
6030
|
-
/* harmony import */ var
|
|
6174
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
|
|
6175
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75480);
|
|
6176
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4040);
|
|
6177
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7909);
|
|
6031
6178
|
/*!
|
|
6032
6179
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6033
6180
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -6040,6 +6187,7 @@ function normalizeCSS(s) {
|
|
|
6040
6187
|
|
|
6041
6188
|
|
|
6042
6189
|
|
|
6190
|
+
|
|
6043
6191
|
/**
|
|
6044
6192
|
* The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
|
|
6045
6193
|
* content that matches the look and feel of the site.
|
|
@@ -6053,7 +6201,7 @@ function normalizeCSS(s) {
|
|
|
6053
6201
|
const div = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('div');
|
|
6054
6202
|
div.innerHTML = html;
|
|
6055
6203
|
const marks = [];
|
|
6056
|
-
const listItems = (0,
|
|
6204
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__.readWordListItems)(div);
|
|
6057
6205
|
if (div.firstChild) {
|
|
6058
6206
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(div, (node)=>{
|
|
6059
6207
|
if (!node) {
|
|
@@ -6078,7 +6226,7 @@ function normalizeCSS(s) {
|
|
|
6078
6226
|
// with `mso-list:Ignore`. They are display-only
|
|
6079
6227
|
// and must not be imported, otherwise the marker
|
|
6080
6228
|
// text leaks into the content. See #948
|
|
6081
|
-
if (/mso-list:\s*ignore/i.test((0,
|
|
6229
|
+
if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attr)(node, 'style') || '')) {
|
|
6082
6230
|
marks.push(node);
|
|
6083
6231
|
break;
|
|
6084
6232
|
}
|
|
@@ -6092,7 +6240,7 @@ function normalizeCSS(s) {
|
|
|
6092
6240
|
// `attrRaw`: SVG keeps camelCase names
|
|
6093
6241
|
// (`viewBox`), `attr()` would kebab-case
|
|
6094
6242
|
// them and silently skip the removal
|
|
6095
|
-
(0,
|
|
6243
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attrRaw)(node, attribute.name, null);
|
|
6096
6244
|
}
|
|
6097
6245
|
});
|
|
6098
6246
|
}
|
|
@@ -6105,14 +6253,14 @@ function normalizeCSS(s) {
|
|
|
6105
6253
|
});
|
|
6106
6254
|
}
|
|
6107
6255
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove.apply(null, marks);
|
|
6108
|
-
(0,
|
|
6256
|
+
(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__.wrapWordListItems)(listItems);
|
|
6109
6257
|
convertedString = div.innerHTML;
|
|
6110
6258
|
} catch (e) {}
|
|
6111
6259
|
if (convertedString) {
|
|
6112
6260
|
html = convertedString;
|
|
6113
6261
|
}
|
|
6114
|
-
html = html.split(/(\n)/).filter(
|
|
6115
|
-
return
|
|
6262
|
+
html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_5__.trim).join('\n');
|
|
6263
|
+
return (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.removeWordWrappers)(html);
|
|
6116
6264
|
}
|
|
6117
6265
|
|
|
6118
6266
|
|
|
@@ -6152,10 +6300,17 @@ function normalizeCSS(s) {
|
|
|
6152
6300
|
/* harmony export */ applyStyles: function() { return /* reexport safe */ _apply_styles__WEBPACK_IMPORTED_MODULE_0__.applyStyles; },
|
|
6153
6301
|
/* harmony export */ cleanFromWord: function() { return /* reexport safe */ _clean_from_word__WEBPACK_IMPORTED_MODULE_1__.cleanFromWord; },
|
|
6154
6302
|
/* harmony export */ htmlspecialchars: function() { return /* reexport safe */ _htmlspecialchars__WEBPACK_IMPORTED_MODULE_2__.htmlspecialchars; },
|
|
6303
|
+
/* harmony export */ indexOfClosingTag: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.indexOfClosingTag; },
|
|
6304
|
+
/* harmony export */ indexOfOpenTag: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.indexOfOpenTag; },
|
|
6155
6305
|
/* harmony export */ nl2br: function() { return /* reexport safe */ _nl2br__WEBPACK_IMPORTED_MODULE_3__.nl2br; },
|
|
6306
|
+
/* harmony export */ removeBetween: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeBetween; },
|
|
6307
|
+
/* harmony export */ removeEmptyMarkedTags: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags; },
|
|
6308
|
+
/* harmony export */ removeTagsByPrefix: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeTagsByPrefix; },
|
|
6309
|
+
/* harmony export */ removeWordWrappers: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeWordWrappers; },
|
|
6156
6310
|
/* harmony export */ safeHTML: function() { return /* reexport safe */ _safe_html__WEBPACK_IMPORTED_MODULE_4__.safeHTML; },
|
|
6157
6311
|
/* harmony export */ sanitizeHTMLElement: function() { return /* reexport safe */ _safe_html__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTMLElement; },
|
|
6158
|
-
/* harmony export */ stripTags: function() { return /* reexport safe */ _strip_tags__WEBPACK_IMPORTED_MODULE_5__.stripTags; }
|
|
6312
|
+
/* harmony export */ stripTags: function() { return /* reexport safe */ _strip_tags__WEBPACK_IMPORTED_MODULE_5__.stripTags; },
|
|
6313
|
+
/* harmony export */ unwrapMarkedTags: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.unwrapMarkedTags; }
|
|
6159
6314
|
/* harmony export */ });
|
|
6160
6315
|
/* harmony import */ var _apply_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30893);
|
|
6161
6316
|
/* harmony import */ var _clean_from_word__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1277);
|
|
@@ -6163,6 +6318,7 @@ function normalizeCSS(s) {
|
|
|
6163
6318
|
/* harmony import */ var _nl2br__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48838);
|
|
6164
6319
|
/* harmony import */ var _safe_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48155);
|
|
6165
6320
|
/* harmony import */ var _strip_tags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(22852);
|
|
6321
|
+
/* harmony import */ var _tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
|
|
6166
6322
|
/*!
|
|
6167
6323
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6168
6324
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -6177,6 +6333,7 @@ function normalizeCSS(s) {
|
|
|
6177
6333
|
|
|
6178
6334
|
|
|
6179
6335
|
|
|
6336
|
+
|
|
6180
6337
|
/***/ }),
|
|
6181
6338
|
|
|
6182
6339
|
/***/ 48838:
|
|
@@ -6537,6 +6694,282 @@ function restoreTags(content) {
|
|
|
6537
6694
|
}
|
|
6538
6695
|
|
|
6539
6696
|
|
|
6697
|
+
/***/ }),
|
|
6698
|
+
|
|
6699
|
+
/***/ 81910:
|
|
6700
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6701
|
+
|
|
6702
|
+
"use strict";
|
|
6703
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6704
|
+
/* harmony export */ indexOfClosingTag: function() { return /* binding */ indexOfClosingTag; },
|
|
6705
|
+
/* harmony export */ indexOfOpenTag: function() { return /* binding */ indexOfOpenTag; },
|
|
6706
|
+
/* harmony export */ removeBetween: function() { return /* binding */ removeBetween; },
|
|
6707
|
+
/* harmony export */ removeEmptyMarkedTags: function() { return /* binding */ removeEmptyMarkedTags; },
|
|
6708
|
+
/* harmony export */ removeTagsByPrefix: function() { return /* binding */ removeTagsByPrefix; },
|
|
6709
|
+
/* harmony export */ removeWordWrappers: function() { return /* binding */ removeWordWrappers; },
|
|
6710
|
+
/* harmony export */ unwrapMarkedTags: function() { return /* binding */ unwrapMarkedTags; }
|
|
6711
|
+
/* harmony export */ });
|
|
6712
|
+
/*!
|
|
6713
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6714
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
6715
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
6716
|
+
*/ /**
|
|
6717
|
+
* @module helpers/html
|
|
6718
|
+
*/ // Single passes over HTML that comes from the clipboard or the editor value.
|
|
6719
|
+
// A regex with `[^>]*` or `.*?` before a required literal backtracks
|
|
6720
|
+
// quadratically on a long run of tag openers, so these walk with `indexOf`.
|
|
6721
|
+
const TAG_NAME = /[a-z0-9:-]/i;
|
|
6722
|
+
// The tags the Word clean-up strips: `<html>`, `<colgroup>`, `<col>`, `<o:p>` and their closers
|
|
6723
|
+
const WORD_WRAPPER_TAGS = [
|
|
6724
|
+
'<html',
|
|
6725
|
+
'</html',
|
|
6726
|
+
'<col',
|
|
6727
|
+
'</col',
|
|
6728
|
+
'<o:p',
|
|
6729
|
+
'</o:p'
|
|
6730
|
+
];
|
|
6731
|
+
function startsWithIgnoreCase(html, index, prefix) {
|
|
6732
|
+
return html.substr(index, prefix.length).toLowerCase() === prefix;
|
|
6733
|
+
}
|
|
6734
|
+
// The first `<` at or after `from` that opens one of the prefixes (`<meta`, `</html`, `<!--`)
|
|
6735
|
+
function indexOfPrefix(html, prefixes, from) {
|
|
6736
|
+
let index = html.indexOf('<', from);
|
|
6737
|
+
while(index !== -1){
|
|
6738
|
+
for (const prefix of prefixes){
|
|
6739
|
+
if (startsWithIgnoreCase(html, index, prefix)) {
|
|
6740
|
+
return [
|
|
6741
|
+
index,
|
|
6742
|
+
prefix
|
|
6743
|
+
];
|
|
6744
|
+
}
|
|
6745
|
+
}
|
|
6746
|
+
index = html.indexOf('<', index + 1);
|
|
6747
|
+
}
|
|
6748
|
+
return [
|
|
6749
|
+
-1,
|
|
6750
|
+
''
|
|
6751
|
+
];
|
|
6752
|
+
}
|
|
6753
|
+
/**
|
|
6754
|
+
* The first `</name>` at or after `from`, case-insensitive, or -1
|
|
6755
|
+
*/ function indexOfClosingTag(html, name, from) {
|
|
6756
|
+
const closing = '</' + name + '>';
|
|
6757
|
+
let index = html.indexOf('</', from);
|
|
6758
|
+
while(index !== -1){
|
|
6759
|
+
if (startsWithIgnoreCase(html, index, closing)) {
|
|
6760
|
+
return index;
|
|
6761
|
+
}
|
|
6762
|
+
index = html.indexOf('</', index + 2);
|
|
6763
|
+
}
|
|
6764
|
+
return -1;
|
|
6765
|
+
}
|
|
6766
|
+
/**
|
|
6767
|
+
* Remove every tag that starts with one of the prefixes, up to its `>`:
|
|
6768
|
+
* `removeTagsByPrefix(html, ['<meta', '<!--'])`
|
|
6769
|
+
*/ function removeTagsByPrefix(html, prefixes) {
|
|
6770
|
+
const lower = prefixes.map((prefix)=>prefix.toLowerCase());
|
|
6771
|
+
let result = '';
|
|
6772
|
+
let cursor = 0;
|
|
6773
|
+
for(;;){
|
|
6774
|
+
const [start] = indexOfPrefix(html, lower, cursor);
|
|
6775
|
+
if (start === -1) {
|
|
6776
|
+
break;
|
|
6777
|
+
}
|
|
6778
|
+
const end = html.indexOf('>', start);
|
|
6779
|
+
if (end === -1) {
|
|
6780
|
+
break;
|
|
6781
|
+
}
|
|
6782
|
+
result += html.slice(cursor, start);
|
|
6783
|
+
cursor = end + 1;
|
|
6784
|
+
}
|
|
6785
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6786
|
+
}
|
|
6787
|
+
/**
|
|
6788
|
+
* Strip the Word wrapper tags and then the comments, as the clean-up always did
|
|
6789
|
+
*/ function removeWordWrappers(html) {
|
|
6790
|
+
return removeTagsByPrefix(removeTagsByPrefix(html, WORD_WRAPPER_TAGS), [
|
|
6791
|
+
'<!--'
|
|
6792
|
+
]);
|
|
6793
|
+
}
|
|
6794
|
+
// Every `</name>` position by name, so the closer of an element is found by a binary search
|
|
6795
|
+
function closingTagPositions(html) {
|
|
6796
|
+
const positions = new Map();
|
|
6797
|
+
let index = html.indexOf('</');
|
|
6798
|
+
while(index !== -1){
|
|
6799
|
+
const name = readTagName(html, index + 2).toLowerCase();
|
|
6800
|
+
if (name !== '' && html.charAt(index + 2 + name.length) === '>') {
|
|
6801
|
+
const list = positions.get(name);
|
|
6802
|
+
if (list) {
|
|
6803
|
+
list.push(index);
|
|
6804
|
+
} else {
|
|
6805
|
+
positions.set(name, [
|
|
6806
|
+
index
|
|
6807
|
+
]);
|
|
6808
|
+
}
|
|
6809
|
+
}
|
|
6810
|
+
index = html.indexOf('</', index + 2);
|
|
6811
|
+
}
|
|
6812
|
+
return positions;
|
|
6813
|
+
}
|
|
6814
|
+
// The first position in the sorted list that is >= from, or -1
|
|
6815
|
+
function firstAfter(list, from) {
|
|
6816
|
+
if (!list) {
|
|
6817
|
+
return -1;
|
|
6818
|
+
}
|
|
6819
|
+
let low = 0;
|
|
6820
|
+
let high = list.length;
|
|
6821
|
+
while(low < high){
|
|
6822
|
+
const middle = low + high >> 1;
|
|
6823
|
+
if (list[middle] < from) {
|
|
6824
|
+
low = middle + 1;
|
|
6825
|
+
} else {
|
|
6826
|
+
high = middle;
|
|
6827
|
+
}
|
|
6828
|
+
}
|
|
6829
|
+
return low < list.length ? list[low] : -1;
|
|
6830
|
+
}
|
|
6831
|
+
/**
|
|
6832
|
+
* The index of the first `<name>` or `<name …>` tag, or -1
|
|
6833
|
+
*/ function indexOfOpenTag(html, name) {
|
|
6834
|
+
const prefix = '<' + name.toLowerCase();
|
|
6835
|
+
let cursor = 0;
|
|
6836
|
+
for(;;){
|
|
6837
|
+
const [start] = indexOfPrefix(html, [
|
|
6838
|
+
prefix
|
|
6839
|
+
], cursor);
|
|
6840
|
+
if (start === -1) {
|
|
6841
|
+
return -1;
|
|
6842
|
+
}
|
|
6843
|
+
const next = html.charAt(start + prefix.length);
|
|
6844
|
+
if (next === '>') {
|
|
6845
|
+
return start;
|
|
6846
|
+
}
|
|
6847
|
+
if (/\s/.test(next)) {
|
|
6848
|
+
if (html.indexOf('>', start) === -1) {
|
|
6849
|
+
return -1;
|
|
6850
|
+
}
|
|
6851
|
+
return start;
|
|
6852
|
+
}
|
|
6853
|
+
cursor = start + 1;
|
|
6854
|
+
}
|
|
6855
|
+
}
|
|
6856
|
+
function readTagName(html, from) {
|
|
6857
|
+
let end = from;
|
|
6858
|
+
while(TAG_NAME.test(html.charAt(end))){
|
|
6859
|
+
end += 1;
|
|
6860
|
+
}
|
|
6861
|
+
return html.slice(from, end);
|
|
6862
|
+
}
|
|
6863
|
+
/**
|
|
6864
|
+
* Replace every `<name … marker …>inner</name>` with `inner`.
|
|
6865
|
+
* `name` null takes any tag; `keep` can refuse an element by its inner HTML.
|
|
6866
|
+
*/ function unwrapMarkedTags(html, name, marker, keep) {
|
|
6867
|
+
const lowerMarker = marker.toLowerCase();
|
|
6868
|
+
const prefixes = [
|
|
6869
|
+
name == null ? '<' : '<' + name.toLowerCase()
|
|
6870
|
+
];
|
|
6871
|
+
const closings = closingTagPositions(html);
|
|
6872
|
+
let result = '';
|
|
6873
|
+
let cursor = 0;
|
|
6874
|
+
for(;;){
|
|
6875
|
+
const [start] = indexOfPrefix(html, prefixes, cursor);
|
|
6876
|
+
if (start === -1) {
|
|
6877
|
+
break;
|
|
6878
|
+
}
|
|
6879
|
+
const tagName = (name !== null && name !== void 0 ? name : readTagName(html, start + 1)).toLowerCase();
|
|
6880
|
+
const gt = html.indexOf('>', start);
|
|
6881
|
+
if (gt === -1) {
|
|
6882
|
+
break;
|
|
6883
|
+
}
|
|
6884
|
+
const close = tagName !== '' && html.slice(start, gt).toLowerCase().includes(lowerMarker) ? firstAfter(closings.get(tagName), gt + 1) : -1;
|
|
6885
|
+
// Not a marked element: the `<` is text, the next one may still open an element
|
|
6886
|
+
if (close === -1) {
|
|
6887
|
+
result += html.slice(cursor, start + 1);
|
|
6888
|
+
cursor = start + 1;
|
|
6889
|
+
continue;
|
|
6890
|
+
}
|
|
6891
|
+
const inner = html.slice(gt + 1, close);
|
|
6892
|
+
const after = close + tagName.length + 3;
|
|
6893
|
+
result += html.slice(cursor, start);
|
|
6894
|
+
result += inner !== '' && (!keep || keep(inner)) ? inner : html.slice(start, after);
|
|
6895
|
+
cursor = after;
|
|
6896
|
+
}
|
|
6897
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6898
|
+
}
|
|
6899
|
+
// The first `literal` at or after `from`, case-insensitive, or -1
|
|
6900
|
+
function indexOfLiteral(html, literal, from) {
|
|
6901
|
+
const head = literal.charAt(0);
|
|
6902
|
+
let index = html.indexOf(head, from);
|
|
6903
|
+
while(index !== -1){
|
|
6904
|
+
if (startsWithIgnoreCase(html, index, literal)) {
|
|
6905
|
+
return index;
|
|
6906
|
+
}
|
|
6907
|
+
index = html.indexOf(head, index + 1);
|
|
6908
|
+
}
|
|
6909
|
+
return -1;
|
|
6910
|
+
}
|
|
6911
|
+
/**
|
|
6912
|
+
* Remove every `open … openEnd … close` block whose opener holds `marker` (any opener when it is ''):
|
|
6913
|
+
* `removeBetween(html, '<style', '>', '</style>', 'jodit-box')`
|
|
6914
|
+
*/ function removeBetween(html, open, openEnd, close, marker = '') {
|
|
6915
|
+
const lowerOpen = open.toLowerCase();
|
|
6916
|
+
const lowerMarker = marker.toLowerCase();
|
|
6917
|
+
let result = '';
|
|
6918
|
+
let cursor = 0;
|
|
6919
|
+
for(;;){
|
|
6920
|
+
const start = indexOfLiteral(html, lowerOpen, cursor);
|
|
6921
|
+
if (start === -1) {
|
|
6922
|
+
break;
|
|
6923
|
+
}
|
|
6924
|
+
const end = indexOfLiteral(html, openEnd, start + open.length);
|
|
6925
|
+
if (end === -1) {
|
|
6926
|
+
break;
|
|
6927
|
+
}
|
|
6928
|
+
if (lowerMarker !== '' && !html.slice(start, end).toLowerCase().includes(lowerMarker)) {
|
|
6929
|
+
result += html.slice(cursor, end + openEnd.length);
|
|
6930
|
+
cursor = end + openEnd.length;
|
|
6931
|
+
continue;
|
|
6932
|
+
}
|
|
6933
|
+
const closeIndex = indexOfLiteral(html, close, end + openEnd.length);
|
|
6934
|
+
if (closeIndex === -1) {
|
|
6935
|
+
break;
|
|
6936
|
+
}
|
|
6937
|
+
result += html.slice(cursor, start);
|
|
6938
|
+
cursor = closeIndex + close.length;
|
|
6939
|
+
}
|
|
6940
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6941
|
+
}
|
|
6942
|
+
/**
|
|
6943
|
+
* Remove every empty `<name … marker …></name>` element
|
|
6944
|
+
*/ function removeEmptyMarkedTags(html, name, marker) {
|
|
6945
|
+
const lowerName = name.toLowerCase();
|
|
6946
|
+
const lowerMarker = marker.toLowerCase();
|
|
6947
|
+
const closing = '</' + lowerName + '>';
|
|
6948
|
+
let result = '';
|
|
6949
|
+
let cursor = 0;
|
|
6950
|
+
for(;;){
|
|
6951
|
+
const [start] = indexOfPrefix(html, [
|
|
6952
|
+
'<' + lowerName
|
|
6953
|
+
], cursor);
|
|
6954
|
+
if (start === -1) {
|
|
6955
|
+
break;
|
|
6956
|
+
}
|
|
6957
|
+
const gt = html.indexOf('>', start);
|
|
6958
|
+
if (gt === -1) {
|
|
6959
|
+
break;
|
|
6960
|
+
}
|
|
6961
|
+
if (html.slice(start, gt).toLowerCase().includes(lowerMarker) && startsWithIgnoreCase(html, gt + 1, closing)) {
|
|
6962
|
+
result += html.slice(cursor, start);
|
|
6963
|
+
cursor = gt + 1 + closing.length;
|
|
6964
|
+
continue;
|
|
6965
|
+
}
|
|
6966
|
+
result += html.slice(cursor, gt + 1);
|
|
6967
|
+
cursor = gt + 1;
|
|
6968
|
+
}
|
|
6969
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6970
|
+
}
|
|
6971
|
+
|
|
6972
|
+
|
|
6540
6973
|
/***/ }),
|
|
6541
6974
|
|
|
6542
6975
|
/***/ 75480:
|
|
@@ -6737,6 +7170,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6737
7170
|
/* harmony export */ hasContainer: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.hasContainer; },
|
|
6738
7171
|
/* harmony export */ htmlspecialchars: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.htmlspecialchars; },
|
|
6739
7172
|
/* harmony export */ i18n: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.i18n; },
|
|
7173
|
+
/* harmony export */ indexOfClosingTag: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag; },
|
|
7174
|
+
/* harmony export */ indexOfOpenTag: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag; },
|
|
6740
7175
|
/* harmony export */ innerWidth: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.innerWidth; },
|
|
6741
7176
|
/* harmony export */ isAbortError: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.isAbortError; },
|
|
6742
7177
|
/* harmony export */ isArray: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.isArray; },
|
|
@@ -6778,6 +7213,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6778
7213
|
/* harmony export */ normalizeUrl: function() { return /* reexport safe */ _normalize__WEBPACK_IMPORTED_MODULE_5__.normalizeUrl; },
|
|
6779
7214
|
/* harmony export */ offset: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.offset; },
|
|
6780
7215
|
/* harmony export */ position: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.position; },
|
|
7216
|
+
/* harmony export */ removeBetween: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeBetween; },
|
|
7217
|
+
/* harmony export */ removeEmptyMarkedTags: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeEmptyMarkedTags; },
|
|
7218
|
+
/* harmony export */ removeTagsByPrefix: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix; },
|
|
7219
|
+
/* harmony export */ removeWordWrappers: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeWordWrappers; },
|
|
6781
7220
|
/* harmony export */ safeHTML: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.safeHTML; },
|
|
6782
7221
|
/* harmony export */ sanitizeHTMLElement: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTMLElement; },
|
|
6783
7222
|
/* harmony export */ setTimeout: function() { return /* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_1__.setTimeout; },
|
|
@@ -6790,7 +7229,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6790
7229
|
/* harmony export */ trim: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trim; },
|
|
6791
7230
|
/* harmony export */ trimChars: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimChars; },
|
|
6792
7231
|
/* harmony export */ trimInv: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimInv; },
|
|
6793
|
-
/* harmony export */
|
|
7232
|
+
/* harmony export */ trimInvEnd: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimInvEnd; },
|
|
7233
|
+
/* harmony export */ ucfirst: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.ucfirst; },
|
|
7234
|
+
/* harmony export */ unwrapMarkedTags: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.unwrapMarkedTags; }
|
|
6794
7235
|
/* harmony export */ });
|
|
6795
7236
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45664);
|
|
6796
7237
|
/* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61077);
|
|
@@ -6802,7 +7243,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6802
7243
|
/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97642);
|
|
6803
7244
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(93640);
|
|
6804
7245
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
6805
|
-
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _utils__WEBPACK_IMPORTED_MODULE_8__) if(["default","asArray","splitArray","toArray","clearTimeout","setTimeout","hasBrowserColorPicker","hasContainer","isAbortError","isArray","isBoolean","isDestructable","isEqual","isFastEqual","isFunction","isHTML","isHtmlFromWord","isInitable","isInt","isJoditObject","isLicense","isMarker","isNativeFunction","isNumber","isNumeric","isPlainObject","isPromise","isSet","isString","isStringArray","isURL","isValidName","isViewObject","isVoid","isWindow","colorToHex","applyStyles","cleanFromWord","htmlspecialchars","nl2br","safeHTML","sanitizeHTMLElement","stripTags","NUMBER_FIELDS_REG","normalizeColor","normalizeCssNumericValue","normalizeCssValue","normalizeKeyAliases","normalizeLicense","normalizePath","normalizeRelativePath","normalizeSize","normalizeUrl","getContentWidth","getFixedPositionOffset","getScrollParent","innerWidth","offset","position","size","CamelCaseToKebabCase","camelCase","fuzzySearchIndex","i18n","kebabCase","sprintf","stringify","trim","trimChars","trimInv","ucfirst"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _utils__WEBPACK_IMPORTED_MODULE_8__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
7246
|
+
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _utils__WEBPACK_IMPORTED_MODULE_8__) if(["default","asArray","splitArray","toArray","clearTimeout","setTimeout","hasBrowserColorPicker","hasContainer","isAbortError","isArray","isBoolean","isDestructable","isEqual","isFastEqual","isFunction","isHTML","isHtmlFromWord","isInitable","isInt","isJoditObject","isLicense","isMarker","isNativeFunction","isNumber","isNumeric","isPlainObject","isPromise","isSet","isString","isStringArray","isURL","isValidName","isViewObject","isVoid","isWindow","colorToHex","applyStyles","cleanFromWord","htmlspecialchars","indexOfClosingTag","indexOfOpenTag","nl2br","removeBetween","removeEmptyMarkedTags","removeTagsByPrefix","removeWordWrappers","safeHTML","sanitizeHTMLElement","stripTags","unwrapMarkedTags","NUMBER_FIELDS_REG","normalizeColor","normalizeCssNumericValue","normalizeCssValue","normalizeKeyAliases","normalizeLicense","normalizePath","normalizeRelativePath","normalizeSize","normalizeUrl","getContentWidth","getFixedPositionOffset","getScrollParent","innerWidth","offset","position","size","CamelCaseToKebabCase","camelCase","fuzzySearchIndex","i18n","kebabCase","sprintf","stringify","trim","trimChars","trimInv","trimInvEnd","ucfirst"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _utils__WEBPACK_IMPORTED_MODULE_8__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
|
|
6806
7247
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
6807
7248
|
/*!
|
|
6808
7249
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
@@ -7700,6 +8141,7 @@ function size(subject) {
|
|
|
7700
8141
|
/* harmony export */ trim: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trim; },
|
|
7701
8142
|
/* harmony export */ trimChars: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimChars; },
|
|
7702
8143
|
/* harmony export */ trimInv: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimInv; },
|
|
8144
|
+
/* harmony export */ trimInvEnd: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimInvEnd; },
|
|
7703
8145
|
/* harmony export */ ucfirst: function() { return /* reexport safe */ _ucfirst__WEBPACK_IMPORTED_MODULE_6__.ucfirst; }
|
|
7704
8146
|
/* harmony export */ });
|
|
7705
8147
|
/* harmony import */ var _camel_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57821);
|
|
@@ -7797,29 +8239,51 @@ const CamelCaseToKebabCase = (key)=>{
|
|
|
7797
8239
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7798
8240
|
/* harmony export */ trim: function() { return /* binding */ trim; },
|
|
7799
8241
|
/* harmony export */ trimChars: function() { return /* binding */ trimChars; },
|
|
7800
|
-
/* harmony export */ trimInv: function() { return /* binding */ trimInv; }
|
|
8242
|
+
/* harmony export */ trimInv: function() { return /* binding */ trimInv; },
|
|
8243
|
+
/* harmony export */ trimInvEnd: function() { return /* binding */ trimInvEnd; }
|
|
7801
8244
|
/* harmony export */ });
|
|
7802
|
-
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
7803
8245
|
/*!
|
|
7804
8246
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7805
8247
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
7806
8248
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
7807
8249
|
*/ /**
|
|
7808
8250
|
* @module helpers/string
|
|
7809
|
-
*/
|
|
8251
|
+
*/ const SPACE = /[\s\u200b]/;
|
|
8252
|
+
const INVISIBLE = /\uFEFF/;
|
|
8253
|
+
// Cut the chars matching `char` from both ends; `[…]+$` backtracks on a long run that is not at the end
|
|
8254
|
+
function trimBy(value, char) {
|
|
8255
|
+
let start = 0;
|
|
8256
|
+
let end = value.length;
|
|
8257
|
+
while(start < end && char.test(value.charAt(start))){
|
|
8258
|
+
start += 1;
|
|
8259
|
+
}
|
|
8260
|
+
while(end > start && char.test(value.charAt(end - 1))){
|
|
8261
|
+
end -= 1;
|
|
8262
|
+
}
|
|
8263
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
8264
|
+
}
|
|
7810
8265
|
/**
|
|
7811
8266
|
* It clears the line of all auxiliary invisible characters , from the spaces and line breaks , tabs
|
|
7812
8267
|
* from the beginning and end of the line
|
|
7813
8268
|
*/ function trim(value) {
|
|
7814
|
-
return value
|
|
8269
|
+
return trimBy(value, SPACE);
|
|
7815
8270
|
}
|
|
7816
8271
|
function trimChars(value, chars) {
|
|
7817
|
-
return value
|
|
8272
|
+
return trimBy(value, RegExp(`[${chars}]`));
|
|
7818
8273
|
}
|
|
7819
8274
|
/**
|
|
7820
8275
|
* Trim only invisible chars
|
|
7821
8276
|
*/ function trimInv(value) {
|
|
7822
|
-
return value
|
|
8277
|
+
return trimBy(value, INVISIBLE);
|
|
8278
|
+
}
|
|
8279
|
+
/**
|
|
8280
|
+
* Without the invisible chars at the end
|
|
8281
|
+
*/ function trimInvEnd(value) {
|
|
8282
|
+
let end = value.length;
|
|
8283
|
+
while(end > 0 && INVISIBLE.test(value.charAt(end - 1))){
|
|
8284
|
+
end -= 1;
|
|
8285
|
+
}
|
|
8286
|
+
return end === value.length ? value : value.slice(0, end);
|
|
7823
8287
|
}
|
|
7824
8288
|
|
|
7825
8289
|
|
|
@@ -11214,18 +11678,19 @@ function usable(ranges, shadowRoot) {
|
|
|
11214
11678
|
|
|
11215
11679
|
"use strict";
|
|
11216
11680
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11217
|
-
/* harmony export */ composedRanges: function() { return /* reexport safe */
|
|
11681
|
+
/* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_3__.composedRanges; },
|
|
11218
11682
|
/* harmony export */ cursorInTheEdgeOfString: function() { return /* binding */ cursorInTheEdgeOfString; },
|
|
11219
11683
|
/* harmony export */ findCorrectCurrentNode: function() { return /* binding */ findCorrectCurrentNode; },
|
|
11220
|
-
/* harmony export */ isMoved: function() { return /* reexport safe */
|
|
11221
|
-
/* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */
|
|
11684
|
+
/* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_4__.isMoved; },
|
|
11685
|
+
/* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_5__.moveNodeInsideStart; }
|
|
11222
11686
|
/* harmony export */ });
|
|
11223
11687
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
11224
11688
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
11225
|
-
/* harmony import */ var
|
|
11226
|
-
/* harmony import */ var
|
|
11227
|
-
/* harmony import */ var
|
|
11228
|
-
/* harmony import */ var
|
|
11689
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
|
|
11690
|
+
/* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43134);
|
|
11691
|
+
/* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90657);
|
|
11692
|
+
/* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89817);
|
|
11693
|
+
/* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7470);
|
|
11229
11694
|
/*!
|
|
11230
11695
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
11231
11696
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -11238,6 +11703,7 @@ function usable(ranges, shadowRoot) {
|
|
|
11238
11703
|
|
|
11239
11704
|
|
|
11240
11705
|
|
|
11706
|
+
|
|
11241
11707
|
/**
|
|
11242
11708
|
* Despite the name, returns `true` when the cursor is NOT at the checked edge
|
|
11243
11709
|
* of the text node: there is significant (non invisible-space) text between
|
|
@@ -11246,7 +11712,7 @@ function usable(ranges, shadowRoot) {
|
|
|
11246
11712
|
*/ function cursorInTheEdgeOfString(container, offset, start, end) {
|
|
11247
11713
|
var _container_nodeValue;
|
|
11248
11714
|
const text = ((_container_nodeValue = container.nodeValue) === null || _container_nodeValue === void 0 ? void 0 : _container_nodeValue.length) ? container.nodeValue : '';
|
|
11249
|
-
if (end &&
|
|
11715
|
+
if (end && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trimInvEnd)(text).length > offset) {
|
|
11250
11716
|
return true;
|
|
11251
11717
|
}
|
|
11252
11718
|
const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
|
|
@@ -15683,6 +16149,18 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
|
|
|
15683
16149
|
render() {
|
|
15684
16150
|
return '<div><div class="&__content"></div></div>';
|
|
15685
16151
|
}
|
|
16152
|
+
get __isEnabled() {
|
|
16153
|
+
const { o } = this.j;
|
|
16154
|
+
return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
|
|
16155
|
+
}
|
|
16156
|
+
/**
|
|
16157
|
+
* Show tooltips for the buttons in an element outside the editor's
|
|
16158
|
+
* container, such as a toolbar placed by the `toolbar` option
|
|
16159
|
+
*/ attach(container) {
|
|
16160
|
+
if (this.__isEnabled) {
|
|
16161
|
+
this.__onAttach(container);
|
|
16162
|
+
}
|
|
16163
|
+
}
|
|
15686
16164
|
__onAttach(container) {
|
|
15687
16165
|
// TODO Move it inside __show method. Now it is here because testcase failed with capturing
|
|
15688
16166
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(this.j, UITooltip), this.container);
|
|
@@ -15817,7 +16295,7 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
|
|
|
15817
16295
|
}
|
|
15818
16296
|
constructor(view){
|
|
15819
16297
|
super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isOpened", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__attachedContainers", new Set()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__listenClose", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__currentTarget", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__delayShowTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hideTimeout", 0);
|
|
15820
|
-
if (
|
|
16298
|
+
if (this.__isEnabled) {
|
|
15821
16299
|
this.j.e.on('getContainer', (box)=>{
|
|
15822
16300
|
this.__onAttach(box);
|
|
15823
16301
|
});
|
|
@@ -18163,7 +18641,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
|
|
|
18163
18641
|
return;
|
|
18164
18642
|
}
|
|
18165
18643
|
const buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__.splitArray)(this.o.buttons) : [];
|
|
18166
|
-
|
|
18644
|
+
const container = this.toolbarContainer;
|
|
18645
|
+
(_this_toolbar = this.toolbar) === null || _this_toolbar === void 0 ? void 0 : _this_toolbar.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(container);
|
|
18646
|
+
// The toolbar's own element, as editors can share the one it is placed in
|
|
18647
|
+
if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isOrContains(this.container, container)) {
|
|
18648
|
+
this.__tooltip.attach(this.toolbar.container);
|
|
18649
|
+
}
|
|
18167
18650
|
}
|
|
18168
18651
|
getRegisteredButtonGroups() {
|
|
18169
18652
|
return this.groupToButtons;
|
|
@@ -18578,11 +19061,12 @@ View.defaultOptions = {
|
|
|
18578
19061
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84839);
|
|
18579
19062
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
18580
19063
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
18581
|
-
/* harmony import */ var
|
|
18582
|
-
/* harmony import */ var
|
|
18583
|
-
/* harmony import */ var
|
|
18584
|
-
/* harmony import */ var
|
|
18585
|
-
/* harmony import */ var
|
|
19064
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
|
|
19065
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
19066
|
+
/* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73714);
|
|
19067
|
+
/* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80512);
|
|
19068
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5266);
|
|
19069
|
+
/* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60936);
|
|
18586
19070
|
/*!
|
|
18587
19071
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
18588
19072
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -18604,6 +19088,7 @@ View.defaultOptions = {
|
|
|
18604
19088
|
|
|
18605
19089
|
|
|
18606
19090
|
|
|
19091
|
+
|
|
18607
19092
|
const FOCUS_EVENTS = new Set([
|
|
18608
19093
|
'focus',
|
|
18609
19094
|
'blur',
|
|
@@ -18634,7 +19119,7 @@ const NOEDIT = {
|
|
|
18634
19119
|
* `alignClasses.img` when that isn't set
|
|
18635
19120
|
*/ function makeOptions(options) {
|
|
18636
19121
|
var _opt_alignClasses;
|
|
18637
|
-
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)(options || {},
|
|
19122
|
+
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions);
|
|
18638
19123
|
if (opt.imageAlignClasses && !((_opt_alignClasses = opt.alignClasses) === null || _opt_alignClasses === void 0 ? void 0 : _opt_alignClasses.img)) {
|
|
18639
19124
|
opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)({
|
|
18640
19125
|
img: opt.imageAlignClasses
|
|
@@ -18642,7 +19127,7 @@ const NOEDIT = {
|
|
|
18642
19127
|
}
|
|
18643
19128
|
return opt;
|
|
18644
19129
|
}
|
|
18645
|
-
class Jodit extends
|
|
19130
|
+
class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_12__.ViewWithToolbar {
|
|
18646
19131
|
/** @override */ className() {
|
|
18647
19132
|
return 'Jodit';
|
|
18648
19133
|
}
|
|
@@ -18685,7 +19170,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18685
19170
|
* Return a default timeout period in milliseconds for some debounce or throttle functions.
|
|
18686
19171
|
* By default, `{history.timeout}` options
|
|
18687
19172
|
*/ get defaultTimeout() {
|
|
18688
|
-
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout :
|
|
19173
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout : jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions.defaultTimeout;
|
|
18689
19174
|
}
|
|
18690
19175
|
/**
|
|
18691
19176
|
* Method wrap usual object in Object helper for prevent deep object merging in options*
|
|
@@ -18715,7 +19200,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18715
19200
|
/**
|
|
18716
19201
|
* Default settings
|
|
18717
19202
|
*/ static get defaultOptions() {
|
|
18718
|
-
return
|
|
19203
|
+
return jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions;
|
|
18719
19204
|
}
|
|
18720
19205
|
/**
|
|
18721
19206
|
* Deep-merges partial options into the global defaults without replacing
|
|
@@ -18763,7 +19248,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18763
19248
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigMerge)(Jodit.defaultOptions, options);
|
|
18764
19249
|
}
|
|
18765
19250
|
get createInside() {
|
|
18766
|
-
return new
|
|
19251
|
+
return new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Create(()=>this.ed, this.o.createAttributes);
|
|
18767
19252
|
}
|
|
18768
19253
|
__setPlaceField(field, value) {
|
|
18769
19254
|
if (!this.currentPlace) {
|
|
@@ -18963,7 +19448,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18963
19448
|
}
|
|
18964
19449
|
value = this.getNativeEditorValue().replace(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.INVISIBLE_SPACE_REG_EXP(), '');
|
|
18965
19450
|
if (removeSelectionMarkers) {
|
|
18966
|
-
value =
|
|
19451
|
+
value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__.removeEmptyMarkedTags)(value, 'span', 'id="jodit-selection_marker_');
|
|
18967
19452
|
}
|
|
18968
19453
|
if (value === '<br>') {
|
|
18969
19454
|
value = '';
|
|
@@ -19277,7 +19762,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19277
19762
|
return this.getMode();
|
|
19278
19763
|
}
|
|
19279
19764
|
const active = this.od.activeElement;
|
|
19280
|
-
if (active && (active === this.iframe ||
|
|
19765
|
+
if (active && (active === this.iframe || jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(this.editor, active) || jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(this.toolbar.container, active))) {
|
|
19281
19766
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.MODE_WYSIWYG;
|
|
19282
19767
|
}
|
|
19283
19768
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.MODE_SOURCE;
|
|
@@ -19430,7 +19915,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19430
19915
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(element.attributes).forEach((attr)=>{
|
|
19431
19916
|
const name = attr.name;
|
|
19432
19917
|
let value = attr.value;
|
|
19433
|
-
if (
|
|
19918
|
+
if (jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
|
|
19434
19919
|
if ([
|
|
19435
19920
|
'readonly',
|
|
19436
19921
|
'disabled'
|
|
@@ -19467,7 +19952,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19467
19952
|
container = element;
|
|
19468
19953
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, __defaultClassesKey, element.className.toString());
|
|
19469
19954
|
buffer = container.innerHTML;
|
|
19470
|
-
|
|
19955
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.detach(container);
|
|
19471
19956
|
}
|
|
19472
19957
|
container.classList.add('jodit_inline');
|
|
19473
19958
|
container.classList.add('jodit-container');
|
|
@@ -19475,7 +19960,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19475
19960
|
// actual for inline mode
|
|
19476
19961
|
if (element !== container) {
|
|
19477
19962
|
// hide source element
|
|
19478
|
-
const display = (0,
|
|
19963
|
+
const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display');
|
|
19479
19964
|
if (display) {
|
|
19480
19965
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, __defaultStyleDisplayKey, display);
|
|
19481
19966
|
}
|
|
@@ -19487,21 +19972,21 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19487
19972
|
// the toolbar box below it when (re)attaching the toolbar container.
|
|
19488
19973
|
const aboveSlot = this.c.div(this.getFullElName(SLOT, 'above'), NOEDIT);
|
|
19489
19974
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(aboveSlot, 'data-jodit-above-toolbar', '');
|
|
19490
|
-
|
|
19975
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.appendChildFirst(container, aboveSlot);
|
|
19491
19976
|
const topSlot = this.c.div(this.getFullElName(SLOT, 'top'), NOEDIT);
|
|
19492
|
-
|
|
19977
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(container, topSlot);
|
|
19493
19978
|
const centerSlot = this.c.div(this.getFullElName(SLOT, 'center'), NOEDIT);
|
|
19494
19979
|
const workplace = this.c.div('jodit-workplace', NOEDIT);
|
|
19495
19980
|
const leftSlot = this.c.div(this.getFullElName(SLOT, 'left'), NOEDIT);
|
|
19496
19981
|
const rightSlot = this.c.div(this.getFullElName(SLOT, 'right'), NOEDIT);
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19982
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(centerSlot, leftSlot);
|
|
19983
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(centerSlot, workplace);
|
|
19984
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(centerSlot, rightSlot);
|
|
19985
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(container, centerSlot);
|
|
19501
19986
|
const bottomPanel = this.c.div(this.getFullElName(SLOT, 'bottom'), NOEDIT);
|
|
19502
|
-
|
|
19987
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(container, bottomPanel);
|
|
19503
19988
|
if (element.parentNode && element !== container) {
|
|
19504
|
-
|
|
19989
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.before(element, container);
|
|
19505
19990
|
}
|
|
19506
19991
|
Object.defineProperty(element, 'component', {
|
|
19507
19992
|
enumerable: false,
|
|
@@ -19513,7 +19998,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19513
19998
|
'aria-disabled': false,
|
|
19514
19999
|
tabindex: this.o.tabIndex
|
|
19515
20000
|
});
|
|
19516
|
-
|
|
20001
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(workplace, editor);
|
|
19517
20002
|
const currentPlace = {
|
|
19518
20003
|
editor,
|
|
19519
20004
|
element,
|
|
@@ -19527,9 +20012,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19527
20012
|
left: leftSlot,
|
|
19528
20013
|
right: rightSlot
|
|
19529
20014
|
},
|
|
19530
|
-
statusbar: new
|
|
20015
|
+
statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.StatusBar(this, container),
|
|
19531
20016
|
options: this.isReady ? makeOptions(options) : this.options,
|
|
19532
|
-
history: new
|
|
20017
|
+
history: new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.History(this),
|
|
19533
20018
|
editorWindow: this.ow
|
|
19534
20019
|
};
|
|
19535
20020
|
this.__elementToPlace.set(editor, currentPlace);
|
|
@@ -19562,7 +20047,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19562
20047
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(initResult, init);
|
|
19563
20048
|
}
|
|
19564
20049
|
addDisclaimer(elm) {
|
|
19565
|
-
|
|
20050
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(this.workplace, elm);
|
|
19566
20051
|
}
|
|
19567
20052
|
/**
|
|
19568
20053
|
* Set current place object
|
|
@@ -19625,7 +20110,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19625
20110
|
return;
|
|
19626
20111
|
}
|
|
19627
20112
|
if (stayDefault === false || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isPromise)(stayDefault)) {
|
|
19628
|
-
|
|
20113
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(defaultEditorArea);
|
|
19629
20114
|
}
|
|
19630
20115
|
addClassNames(this.o.editorClassName, this.editor);
|
|
19631
20116
|
if (this.o.style) {
|
|
@@ -19674,7 +20159,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19674
20159
|
// and such an element stays in the editor
|
|
19675
20160
|
if (FOCUS_EVENTS.has(type)) {
|
|
19676
20161
|
const inner = type === 'focusin' || type === 'focusout';
|
|
19677
|
-
if (inner === (event.target === editor) ||
|
|
20162
|
+
if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(editor, event.relatedTarget)) {
|
|
19678
20163
|
return;
|
|
19679
20164
|
}
|
|
19680
20165
|
if (inner) {
|
|
@@ -19711,7 +20196,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19711
20196
|
});
|
|
19712
20197
|
}
|
|
19713
20198
|
fetch(url, options) {
|
|
19714
|
-
const ajax = new
|
|
20199
|
+
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_9__.Ajax((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({
|
|
19715
20200
|
url
|
|
19716
20201
|
}, options), this.o.defaultAjaxOptions);
|
|
19717
20202
|
const destroy = ()=>{
|
|
@@ -19732,7 +20217,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19732
20217
|
if (this.isInDestruct) {
|
|
19733
20218
|
return;
|
|
19734
20219
|
}
|
|
19735
|
-
this.setStatus(
|
|
20220
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.STATUSES.beforeDestruct);
|
|
19736
20221
|
this.__elementToPlace.clear();
|
|
19737
20222
|
(_cached = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cached)(this, 'storage')) === null || _cached === void 0 ? void 0 : _cached.clear();
|
|
19738
20223
|
(_cached1 = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cached)(this, 'buffer')) === null || _cached1 === void 0 ? void 0 : _cached1.clear();
|
|
@@ -19770,17 +20255,17 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19770
20255
|
this.e.off(container);
|
|
19771
20256
|
this.e.off(element);
|
|
19772
20257
|
this.e.off(editor);
|
|
19773
|
-
|
|
19774
|
-
|
|
20258
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(workplace);
|
|
20259
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(editor);
|
|
19775
20260
|
if (container !== element) {
|
|
19776
|
-
|
|
20261
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(container);
|
|
19777
20262
|
}
|
|
19778
20263
|
Object.defineProperty(element, 'component', {
|
|
19779
20264
|
enumerable: false,
|
|
19780
20265
|
configurable: true,
|
|
19781
20266
|
value: null
|
|
19782
20267
|
});
|
|
19783
|
-
|
|
20268
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(iframe);
|
|
19784
20269
|
// inline mode
|
|
19785
20270
|
if (container === element) {
|
|
19786
20271
|
element.innerHTML = tmpValue;
|
|
@@ -19825,7 +20310,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19825
20310
|
this.destruct();
|
|
19826
20311
|
throw e;
|
|
19827
20312
|
}
|
|
19828
|
-
this.setStatus(
|
|
20313
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.STATUSES.beforeInit);
|
|
19829
20314
|
this.id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.resolveElement)(element, this.o.shadowRoot || this.od), 'id') || new Date().getTime().toString();
|
|
19830
20315
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.instances[this.id] = this;
|
|
19831
20316
|
this.attachEvents(options);
|
|
@@ -19835,7 +20320,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19835
20320
|
}
|
|
19836
20321
|
});
|
|
19837
20322
|
this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
|
|
19838
|
-
this.selection = new
|
|
20323
|
+
this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Selection(this);
|
|
19839
20324
|
const beforeInitHookResult = this.beforeInitHook();
|
|
19840
20325
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(beforeInitHookResult, ()=>{
|
|
19841
20326
|
if (this.isInDestruct) {
|
|
@@ -19859,7 +20344,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19859
20344
|
this.e.fire('afterInit', this);
|
|
19860
20345
|
}
|
|
19861
20346
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(this.afterInitHook());
|
|
19862
|
-
this.setStatus(
|
|
20347
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.STATUSES.ready);
|
|
19863
20348
|
this.e.fire('afterConstructor', this);
|
|
19864
20349
|
};
|
|
19865
20350
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(addPlaceResult, init);
|
|
@@ -19875,7 +20360,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19875
20360
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.instances);
|
|
19876
20361
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.lang);
|
|
19877
20362
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
|
|
19878
|
-
Plugin:
|
|
20363
|
+
Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Plugin
|
|
19879
20364
|
});
|
|
19880
20365
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_2__._)([
|
|
19881
20366
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cache
|
|
@@ -19902,7 +20387,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19902
20387
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
19903
20388
|
], Jodit.prototype, "__prepareWYSIWYGEditor", null);
|
|
19904
20389
|
Jodit = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_2__._)([
|
|
19905
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.derive)(
|
|
20390
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_10__.Dlgs)
|
|
19906
20391
|
], Jodit);
|
|
19907
20392
|
function addClassNames(className, elm) {
|
|
19908
20393
|
if (className) {
|
|
@@ -28208,6 +28693,17 @@ const ns = 'addnewline';
|
|
|
28208
28693
|
editor.editor
|
|
28209
28694
|
], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
|
|
28210
28695
|
}
|
|
28696
|
+
/**
|
|
28697
|
+
* An empty line with a `<br>`, as Enter makes, so it keeps its height
|
|
28698
|
+
* without clean-html's fillEmptyParagraph (#1807)
|
|
28699
|
+
*/ __newLine() {
|
|
28700
|
+
const { j } = this;
|
|
28701
|
+
const line = j.createInside.element(j.o.enter);
|
|
28702
|
+
if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(line, 'br')) {
|
|
28703
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(line, j.createInside.element('br'));
|
|
28704
|
+
}
|
|
28705
|
+
return line;
|
|
28706
|
+
}
|
|
28211
28707
|
/**
|
|
28212
28708
|
* A paragraph holding only an embed has no place for the caret, so the
|
|
28213
28709
|
* arrow keys can't get past one that ends the content, or before one that
|
|
@@ -28220,6 +28716,11 @@ const ns = 'addnewline';
|
|
|
28220
28716
|
return;
|
|
28221
28717
|
}
|
|
28222
28718
|
const { startContainer, startOffset } = editor.s.range;
|
|
28719
|
+
// A caret in the editor itself, as beside a horizontal line, is in no
|
|
28720
|
+
// paragraph, and the browsers can leave it there with text beyond (#1803)
|
|
28721
|
+
if (startContainer === editor.editor) {
|
|
28722
|
+
return;
|
|
28723
|
+
}
|
|
28223
28724
|
// Once the browser has moved the caret, if it could. With a 0 timeout
|
|
28224
28725
|
// Jodit would run this at once, before the browser moves it
|
|
28225
28726
|
editor.async.setTimeout(()=>{
|
|
@@ -28228,7 +28729,7 @@ const ns = 'addnewline';
|
|
|
28228
28729
|
if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
|
|
28229
28730
|
return;
|
|
28230
28731
|
}
|
|
28231
|
-
const p =
|
|
28732
|
+
const p = this.__newLine();
|
|
28232
28733
|
forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
28233
28734
|
editor.s.setCursorIn(p);
|
|
28234
28735
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
|
|
@@ -28240,7 +28741,7 @@ const ns = 'addnewline';
|
|
|
28240
28741
|
if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
|
|
28241
28742
|
const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
|
|
28242
28743
|
const top = e.pageY - editor.ew.scrollX;
|
|
28243
|
-
const p =
|
|
28744
|
+
const p = this.__newLine();
|
|
28244
28745
|
if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
|
|
28245
28746
|
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
28246
28747
|
} else {
|
|
@@ -28325,7 +28826,7 @@ const ns = 'addnewline';
|
|
|
28325
28826
|
return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
|
|
28326
28827
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
|
|
28327
28828
|
const editor = this.j;
|
|
28328
|
-
const p =
|
|
28829
|
+
const p = this.__newLine();
|
|
28329
28830
|
if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
|
|
28330
28831
|
if (this.__current === editor.editor) {
|
|
28331
28832
|
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
@@ -33030,7 +33531,18 @@ const KEEPS_SPACES = new Set([
|
|
|
33030
33531
|
/**
|
|
33031
33532
|
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
33032
33533
|
* line break, a block or text starting (or ending) with a plain space
|
|
33033
|
-
*/
|
|
33534
|
+
*/ // The run of spaces at the end (or the start) of the text becomes nbsp; counted, as `/ +$/` backtracks on a long run
|
|
33535
|
+
function replaceEdgeSpaces(text, atEnd) {
|
|
33536
|
+
let count = 0;
|
|
33537
|
+
while(count < text.length && text.charAt(atEnd ? text.length - 1 - count : count) === ' '){
|
|
33538
|
+
count += 1;
|
|
33539
|
+
}
|
|
33540
|
+
if (count === 0) {
|
|
33541
|
+
return text;
|
|
33542
|
+
}
|
|
33543
|
+
return atEnd ? text.slice(0, text.length - count) + jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.NBSP_SPACE.repeat(count) : jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.NBSP_SPACE.repeat(count) + text.slice(count);
|
|
33544
|
+
}
|
|
33545
|
+
function hidesSpace(neighbor, edge) {
|
|
33034
33546
|
var _neighbor_nodeValue;
|
|
33035
33547
|
return !neighbor || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(neighbor, 'br') || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock(neighbor) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(neighbor) && edge.test((_neighbor_nodeValue = neighbor.nodeValue) !== null && _neighbor_nodeValue !== void 0 ? _neighbor_nodeValue : '');
|
|
33036
33548
|
}
|
|
@@ -33071,6 +33583,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
33071
33583
|
}
|
|
33072
33584
|
jodit.s.expandSelection();
|
|
33073
33585
|
const range = jodit.s.range;
|
|
33586
|
+
this.__moveEdgesIntoCells(range);
|
|
33074
33587
|
const caret = this.__clearSelectedCells(range);
|
|
33075
33588
|
if (caret && range.collapsed) {
|
|
33076
33589
|
jodit.s.selectRange(caret);
|
|
@@ -33092,6 +33605,22 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
33092
33605
|
jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
|
|
33093
33606
|
return false;
|
|
33094
33607
|
}
|
|
33608
|
+
/**
|
|
33609
|
+
* Firefox selects cells whole from their row, as after a drag into or out
|
|
33610
|
+
* of a table nested in a cell, and `deleteContents` would remove them. The
|
|
33611
|
+
* edges move into the cells, so their content is cleared instead, as in
|
|
33612
|
+
* Firefox's own delete
|
|
33613
|
+
*/ __moveEdgesIntoCells(range) {
|
|
33614
|
+
const { startContainer, startOffset, endContainer, endOffset } = range;
|
|
33615
|
+
const first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
|
|
33616
|
+
const last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
|
|
33617
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(first)) {
|
|
33618
|
+
range.setStart(first, 0);
|
|
33619
|
+
}
|
|
33620
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(last)) {
|
|
33621
|
+
range.setEnd(last, last.childNodes.length);
|
|
33622
|
+
}
|
|
33623
|
+
}
|
|
33095
33624
|
/**
|
|
33096
33625
|
* A selection that starts or ends in a table cell clears the selected part
|
|
33097
33626
|
* of each cell it covers and keeps the cells, as the browsers do.
|
|
@@ -33215,10 +33744,10 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
33215
33744
|
const before = this.__findNeighbor(fake, true, block);
|
|
33216
33745
|
const after = this.__findNeighbor(fake, false, block);
|
|
33217
33746
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) && hidesSpace(after, /^ /)) {
|
|
33218
|
-
before.nodeValue = before.nodeValue
|
|
33747
|
+
before.nodeValue = replaceEdgeSpaces(before.nodeValue, true);
|
|
33219
33748
|
}
|
|
33220
33749
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(after) && hidesSpace(before, / $/)) {
|
|
33221
|
-
after.nodeValue = after.nodeValue
|
|
33750
|
+
after.nodeValue = replaceEdgeSpaces(after.nodeValue, false);
|
|
33222
33751
|
}
|
|
33223
33752
|
}
|
|
33224
33753
|
/**
|
|
@@ -36244,6 +36773,11 @@ function hr(editor) {
|
|
|
36244
36773
|
return false;
|
|
36245
36774
|
}
|
|
36246
36775
|
const p = editor.createInside.element(editor.o.enter);
|
|
36776
|
+
// As Enter's new line has, so it keeps its height without clean-html's
|
|
36777
|
+
// fillEmptyParagraph (#1807)
|
|
36778
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
|
|
36779
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
|
|
36780
|
+
}
|
|
36247
36781
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
|
|
36248
36782
|
editor.s.setCursorIn(p);
|
|
36249
36783
|
return false;
|
|
@@ -36286,7 +36820,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
36286
36820
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
36287
36821
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
36288
36822
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
|
|
36289
|
-
/* harmony import */ var
|
|
36823
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
36824
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17326);
|
|
36290
36825
|
/*!
|
|
36291
36826
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36292
36827
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36301,6 +36836,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
36301
36836
|
|
|
36302
36837
|
|
|
36303
36838
|
|
|
36839
|
+
|
|
36304
36840
|
/**
|
|
36305
36841
|
* Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
|
|
36306
36842
|
* in backend of you system
|
|
@@ -36359,13 +36895,66 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
36359
36895
|
const toggleEditable = ()=>{
|
|
36360
36896
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(doc.body, 'contenteditable', editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && !editor.getReadOnly() || null);
|
|
36361
36897
|
};
|
|
36898
|
+
// The start of the whitespace run that ends at `to`
|
|
36899
|
+
const skipBack = (text, to)=>{
|
|
36900
|
+
while(to > 0 && /\s/.test(text.charAt(to - 1))){
|
|
36901
|
+
to -= 1;
|
|
36902
|
+
}
|
|
36903
|
+
return to;
|
|
36904
|
+
};
|
|
36905
|
+
// The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
|
|
36906
|
+
const cleanBodyTag = (tag)=>{
|
|
36907
|
+
tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
|
|
36908
|
+
const skip = (from, chars)=>{
|
|
36909
|
+
while(chars.test(tag.charAt(from))){
|
|
36910
|
+
from += 1;
|
|
36911
|
+
}
|
|
36912
|
+
return from;
|
|
36913
|
+
};
|
|
36914
|
+
let index = tag.indexOf('contenteditable');
|
|
36915
|
+
while(index !== -1){
|
|
36916
|
+
let to = skip(index + 'contenteditable'.length, /["'\s]/);
|
|
36917
|
+
if (tag.charAt(to) === '=') {
|
|
36918
|
+
to = skip(to + 1, /[\s"']/);
|
|
36919
|
+
if (tag.startsWith('true', to)) {
|
|
36920
|
+
to = skip(to + 4, /["']/);
|
|
36921
|
+
let from = index;
|
|
36922
|
+
if (/["']/.test(tag.charAt(from - 1))) {
|
|
36923
|
+
from -= 1;
|
|
36924
|
+
}
|
|
36925
|
+
from = skipBack(tag, from);
|
|
36926
|
+
return tag.slice(0, from) + tag.slice(to);
|
|
36927
|
+
}
|
|
36928
|
+
}
|
|
36929
|
+
index = tag.indexOf('contenteditable', index + 1);
|
|
36930
|
+
}
|
|
36931
|
+
return tag;
|
|
36932
|
+
};
|
|
36362
36933
|
const clearMarkers = (html)=>{
|
|
36363
36934
|
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
36364
|
-
html =
|
|
36365
|
-
const
|
|
36366
|
-
|
|
36367
|
-
|
|
36368
|
-
|
|
36935
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(html, '<style', '>', '</style>', 'jodit-box');
|
|
36936
|
+
const bodyStart = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag)(html, 'body');
|
|
36937
|
+
let bodyEnd = -1;
|
|
36938
|
+
for(let index = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag)(html, 'body', bodyStart + 1); index !== -1; index = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag)(html, 'body', index + 1)){
|
|
36939
|
+
bodyEnd = index;
|
|
36940
|
+
}
|
|
36941
|
+
if (bodyStart !== -1 && bodyEnd !== -1) {
|
|
36942
|
+
const afterBody = bodyEnd + '</body>'.length;
|
|
36943
|
+
const gt = html.indexOf('>', bodyStart);
|
|
36944
|
+
let body = html.slice(bodyStart, afterBody);
|
|
36945
|
+
if (gt !== -1 && gt < bodyEnd) {
|
|
36946
|
+
body = cleanBodyTag(html.slice(bodyStart, gt)) + html.slice(gt, afterBody);
|
|
36947
|
+
}
|
|
36948
|
+
for (const tag of [
|
|
36949
|
+
'style',
|
|
36950
|
+
'script',
|
|
36951
|
+
'span'
|
|
36952
|
+
]){
|
|
36953
|
+
body = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
|
|
36954
|
+
}
|
|
36955
|
+
// remove markers: the spans outside the body are the editor's own
|
|
36956
|
+
const stripSpans = (part)=>(0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)((0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(part, '<span', '>', '</span>'), '<span', '>', '</span>');
|
|
36957
|
+
html = (stripSpans(html.slice(0, bodyStart)) + body + stripSpans(html.slice(afterBody))).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g, '$1$2$3$5').replace(/(<[^<]+?)\sclass="[\s]*"/gim, '$1').replace(/(<[^<]+?)\sstyle="[\s;]*"/gim, '$1').replace(/(<[^<]+?)\sdir="[\s]*"/gim, '$1');
|
|
36369
36958
|
}
|
|
36370
36959
|
return html;
|
|
36371
36960
|
};
|
|
@@ -42291,9 +42880,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42291
42880
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
42292
42881
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
42293
42882
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
42294
|
-
/* harmony import */ var
|
|
42295
|
-
/* harmony import */ var
|
|
42296
|
-
/* harmony import */ var
|
|
42883
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
|
|
42884
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
|
|
42885
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
42886
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
|
|
42297
42887
|
/*!
|
|
42298
42888
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
42299
42889
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -42308,17 +42898,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42308
42898
|
|
|
42309
42899
|
|
|
42310
42900
|
|
|
42901
|
+
|
|
42311
42902
|
/**
|
|
42312
42903
|
* Process `video` and `audio`
|
|
42313
42904
|
*/ function media(editor) {
|
|
42314
42905
|
const keyFake = 'jodit_fake_wrapper';
|
|
42315
42906
|
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
42316
42907
|
const wrap = (element)=>{
|
|
42317
|
-
if (element.parentNode && (0,
|
|
42908
|
+
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
42318
42909
|
element = element.parentNode;
|
|
42319
42910
|
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
42320
42911
|
var _getMediaWrapper;
|
|
42321
|
-
element = (_getMediaWrapper = (0,
|
|
42912
|
+
element = (_getMediaWrapper = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, element)) !== null && _getMediaWrapper !== void 0 ? _getMediaWrapper : (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.wrapMedia)(editor, element);
|
|
42322
42913
|
} else if (mediaInFakeBlock) {
|
|
42323
42914
|
const media = element;
|
|
42324
42915
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
@@ -42327,13 +42918,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42327
42918
|
draggable: true,
|
|
42328
42919
|
[`data-${keyFake}`]: 1
|
|
42329
42920
|
});
|
|
42330
|
-
(0,
|
|
42921
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
|
|
42331
42922
|
// The wrapper fits the media, whose size changes as its metadata loads
|
|
42332
|
-
// and as it's resized.
|
|
42923
|
+
// and as it's resized. It's inline, as the media is by default, so the
|
|
42924
|
+
// line's text-align still places it, or a block when the media is one.
|
|
42925
|
+
// A percentage width is of the line, so the wrapper is a block that
|
|
42926
|
+
// takes the line, and the media in it follows the text-align it inherits
|
|
42333
42927
|
const fit = ()=>{
|
|
42334
|
-
(0,
|
|
42335
|
-
|
|
42336
|
-
|
|
42928
|
+
const ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%');
|
|
42929
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
|
|
42930
|
+
display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(media, 'display').toString()) ? 'inline-block' : 'block',
|
|
42931
|
+
width: ofLine ? '' : 'fit-content',
|
|
42337
42932
|
height: ''
|
|
42338
42933
|
});
|
|
42339
42934
|
};
|
|
@@ -42370,15 +42965,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42370
42965
|
}
|
|
42371
42966
|
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
42372
42967
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
42373
|
-
|
|
42374
|
-
if (rxp.test(data.value)) {
|
|
42375
|
-
data.value = data.value.replace(rxp, '$1');
|
|
42376
|
-
}
|
|
42968
|
+
data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.unwrapMarkedTags)(data.value, mediaFakeTag, `data-${keyFake}`);
|
|
42377
42969
|
}).on('change afterInit afterSetMode changePlace', editor.async.debounce(()=>{
|
|
42378
42970
|
if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE) {
|
|
42379
|
-
(0,
|
|
42380
|
-
if (!(0,
|
|
42381
|
-
(0,
|
|
42971
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
|
|
42972
|
+
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
|
|
42973
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
|
|
42382
42974
|
wrap(elm);
|
|
42383
42975
|
}
|
|
42384
42976
|
});
|
|
@@ -43373,7 +43965,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43373
43965
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
43374
43966
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
43375
43967
|
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
|
|
43376
|
-
/* harmony import */ var
|
|
43968
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
43969
|
+
/* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
|
|
43377
43970
|
/*!
|
|
43378
43971
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
43379
43972
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -43385,11 +43978,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43385
43978
|
|
|
43386
43979
|
|
|
43387
43980
|
|
|
43981
|
+
|
|
43388
43982
|
/**
|
|
43389
43983
|
* Remove special HTML comments
|
|
43390
43984
|
* @private
|
|
43391
43985
|
*/ function removeExtraFragments(html) {
|
|
43392
|
-
html =
|
|
43986
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix)(html, [
|
|
43987
|
+
'<meta'
|
|
43988
|
+
]);
|
|
43393
43989
|
const start = html.search(/<!--StartFragment-->/i);
|
|
43394
43990
|
if (start !== -1) {
|
|
43395
43991
|
html = html.substring(start + 20);
|
|
@@ -43407,7 +44003,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43407
44003
|
* paste bold
|
|
43408
44004
|
* @private
|
|
43409
44005
|
*/ function removeGoogleDocsWrapper(html) {
|
|
43410
|
-
|
|
44006
|
+
// A plain search: the wrapper check is left to the parsed document below
|
|
44007
|
+
if (!/docs-internal-guid-/i.test(html)) {
|
|
43411
44008
|
return html;
|
|
43412
44009
|
}
|
|
43413
44010
|
// An inert document: images don't load and handlers don't run
|
|
@@ -43462,7 +44059,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43462
44059
|
return;
|
|
43463
44060
|
}
|
|
43464
44061
|
const dialog = jodit.confirm(`<div style="word-break: normal; white-space: normal">${jodit.i18n(msg)}</div>`, jodit.i18n(title));
|
|
43465
|
-
const buttons = buttonList.map(({ text, value })=>(0,
|
|
44062
|
+
const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
43466
44063
|
text,
|
|
43467
44064
|
name: text.toLowerCase(),
|
|
43468
44065
|
tabIndex: 0
|
|
@@ -43478,7 +44075,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43478
44075
|
}
|
|
43479
44076
|
jodit.e.fire('afterClosePasteDialog', dialog);
|
|
43480
44077
|
});
|
|
43481
|
-
const cancel = (0,
|
|
44078
|
+
const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
43482
44079
|
text: 'Cancel',
|
|
43483
44080
|
tabIndex: 0
|
|
43484
44081
|
}).onAction(()=>{
|
|
@@ -44991,12 +45588,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
44991
45588
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
44992
45589
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
44993
45590
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
44994
|
-
/* harmony import */ var
|
|
44995
|
-
/* harmony import */ var
|
|
44996
|
-
/* harmony import */ var
|
|
44997
|
-
/* harmony import */ var
|
|
44998
|
-
/* harmony import */ var
|
|
44999
|
-
/* harmony import */ var
|
|
45591
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
|
|
45592
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
45593
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
|
|
45594
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42259);
|
|
45595
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
|
|
45596
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(56490);
|
|
45597
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(96608);
|
|
45000
45598
|
/*!
|
|
45001
45599
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45002
45600
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -45020,6 +45618,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
45020
45618
|
|
|
45021
45619
|
|
|
45022
45620
|
|
|
45621
|
+
|
|
45023
45622
|
const keyBInd = '__jodit-resizer_binded';
|
|
45024
45623
|
/**
|
|
45025
45624
|
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
@@ -45037,7 +45636,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
45037
45636
|
* A video with no height of its own takes it from its width and its ratio,
|
|
45038
45637
|
* so resizing it keeps the ratio without setting a height.
|
|
45039
45638
|
*/ function heightFollowsWidth(element) {
|
|
45040
|
-
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,
|
|
45639
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'height');
|
|
45041
45640
|
}
|
|
45042
45641
|
const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
45043
45642
|
/**
|
|
@@ -45047,7 +45646,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45047
45646
|
*/ const EMBED_WRAPPER_STYLE = `${IFRAME_WRAPPER}{position:relative;display:block;user-select:none}` + `${IFRAME_WRAPPER} iframe{position:relative}` + `${IFRAME_WRAPPER}::after{position:absolute;z-index:1;display:block;background:transparent;content:'';cursor:pointer;inset:0}` + `${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:2}` + `.jodit_lock ${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:1}`;
|
|
45048
45647
|
/**
|
|
45049
45648
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
45050
|
-
*/ class resizer extends
|
|
45649
|
+
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
|
|
45051
45650
|
/** @override */ afterInit(editor) {
|
|
45052
45651
|
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
45053
45652
|
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
|
|
@@ -45064,10 +45663,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45064
45663
|
.on('keydown', this.onEditorKeyDown, {
|
|
45065
45664
|
top: true
|
|
45066
45665
|
}).on('afterGetValueFromEditor.resizer', (data)=>{
|
|
45067
|
-
|
|
45068
|
-
if (rgx.test(data.value)) {
|
|
45069
|
-
data.value = data.value.replace(rgx, '$1');
|
|
45070
|
-
}
|
|
45666
|
+
data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__.unwrapMarkedTags)(data.value, 'jodit', 'data-jodit_iframe_wrapper', (inner)=>/<iframe/i.test(inner));
|
|
45071
45667
|
});
|
|
45072
45668
|
this.addEventListeners();
|
|
45073
45669
|
this.__onChangeEditor();
|
|
@@ -45104,7 +45700,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45104
45700
|
return;
|
|
45105
45701
|
}
|
|
45106
45702
|
const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width');
|
|
45107
|
-
if (width && !(0,
|
|
45703
|
+
if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(image, 'width')) {
|
|
45108
45704
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
|
|
45109
45705
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width', null);
|
|
45110
45706
|
}
|
|
@@ -45228,7 +45824,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45228
45824
|
__followCaret() {
|
|
45229
45825
|
const before = this.__keyDownRange;
|
|
45230
45826
|
this.__keyDownRange = null;
|
|
45231
|
-
if (!(0,
|
|
45827
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__.isMoved)(this.j, before)) {
|
|
45232
45828
|
return;
|
|
45233
45829
|
}
|
|
45234
45830
|
if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
|
|
@@ -45263,7 +45859,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45263
45859
|
if (!this.isResizeMode) {
|
|
45264
45860
|
// A click in the element's popup, or in a list it opens, works on
|
|
45265
45861
|
// the element, so it keeps its frame
|
|
45266
|
-
if ((e === null || e === void 0 ? void 0 : e.target) &&
|
|
45862
|
+
if ((e === null || e === void 0 ? void 0 : e.target) && jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__.Popup)) {
|
|
45267
45863
|
return;
|
|
45268
45864
|
}
|
|
45269
45865
|
return this.hide();
|
|
@@ -45287,7 +45883,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45287
45883
|
if (changeAttrs) {
|
|
45288
45884
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
|
|
45289
45885
|
}
|
|
45290
|
-
if (!changeAttrs || (0,
|
|
45886
|
+
if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, key)) {
|
|
45291
45887
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
|
|
45292
45888
|
}
|
|
45293
45889
|
}
|
|
@@ -45352,8 +45948,11 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45352
45948
|
// is nothing measurable at all, let the wrapper size itself.
|
|
45353
45949
|
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
45354
45950
|
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
45951
|
+
// The wrapper takes the iframe's place in its line: inline, as an
|
|
45952
|
+
// iframe is by default, so the line's text-align still places it,
|
|
45953
|
+
// or a block when the iframe is one
|
|
45355
45954
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
45356
|
-
display: (0,
|
|
45955
|
+
display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
|
|
45357
45956
|
});
|
|
45358
45957
|
if (width) {
|
|
45359
45958
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
@@ -45471,7 +46070,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45471
46070
|
}
|
|
45472
46071
|
if (this.element && this.rect) {
|
|
45473
46072
|
const workplacePosition = this.getWorkplacePosition();
|
|
45474
|
-
const pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.element, this.j, this.j.ed), left = parseInt((0,
|
|
46073
|
+
const pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.element, this.j, this.j.ed), left = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(this.rect, 'left') || '0', 10), top = parseInt((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(this.rect, 'top') || '0', 10), w = this.rect.offsetWidth, h = this.rect.offsetHeight;
|
|
45475
46074
|
const newTop = pos.top - workplacePosition.top, newLeft = pos.left - workplacePosition.left;
|
|
45476
46075
|
if (top !== newTop || left !== newLeft || w !== this.element.offsetWidth || h !== this.element.offsetHeight) {
|
|
45477
46076
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, {
|
|
@@ -46687,20 +47286,13 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
46687
47286
|
/**
|
|
46688
47287
|
* Mouse move inside the table
|
|
46689
47288
|
*/ __onMove(table, e) {
|
|
46690
|
-
var _this_j_o_shadowRoot;
|
|
46691
47289
|
if (this.j.o.readonly && !this.j.isLocked) {
|
|
46692
47290
|
return;
|
|
46693
47291
|
}
|
|
46694
47292
|
if (this.j.isLockedNotBy(key)) {
|
|
46695
47293
|
return;
|
|
46696
47294
|
}
|
|
46697
|
-
|
|
46698
|
-
// host, so the lookup must start from the shadow root
|
|
46699
|
-
const node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
46700
|
-
const cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
|
|
46701
|
-
'td',
|
|
46702
|
-
'th'
|
|
46703
|
-
], table);
|
|
47295
|
+
const cell = this.__cellUnder(e, table);
|
|
46704
47296
|
if (!cell || !this.__selectedCell) {
|
|
46705
47297
|
return;
|
|
46706
47298
|
}
|
|
@@ -46745,32 +47337,26 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
46745
47337
|
this.__isSelectionMode = false;
|
|
46746
47338
|
this.__selectedCell = null;
|
|
46747
47339
|
}
|
|
47340
|
+
// The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
|
|
47341
|
+
__cellUnder(e, table) {
|
|
47342
|
+
var _this_j_o_shadowRoot;
|
|
47343
|
+
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
47344
|
+
// host, so the lookup must start from the shadow root
|
|
47345
|
+
const node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
47346
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(elm, 'table', table), table);
|
|
47347
|
+
}
|
|
46748
47348
|
/**
|
|
46749
47349
|
* Stop a selection process
|
|
46750
47350
|
*/ __onStopSelection(table, e) {
|
|
46751
|
-
var _this_j_o_shadowRoot;
|
|
46752
47351
|
if (!this.__selectedCell) {
|
|
46753
47352
|
return;
|
|
46754
47353
|
}
|
|
46755
47354
|
this.__isSelectionMode = false;
|
|
46756
47355
|
this.j.unlock();
|
|
46757
|
-
|
|
46758
|
-
// host, so the lookup must start from the shadow root
|
|
46759
|
-
const node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
46760
|
-
if (!node) {
|
|
46761
|
-
return;
|
|
46762
|
-
}
|
|
46763
|
-
const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
|
|
46764
|
-
'td',
|
|
46765
|
-
'th'
|
|
46766
|
-
], table);
|
|
47356
|
+
const cell = this.__cellUnder(e, table);
|
|
46767
47357
|
if (!cell) {
|
|
46768
47358
|
return;
|
|
46769
47359
|
}
|
|
46770
|
-
const ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', table);
|
|
46771
|
-
if (ownTable && ownTable !== table) {
|
|
46772
|
-
return; // Nested tables
|
|
46773
|
-
}
|
|
46774
47360
|
this.__showCellsPopup(table, [
|
|
46775
47361
|
cell,
|
|
46776
47362
|
this.__selectedCell
|