jodit 4.19.10 → 4.19.11
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 +139 -131
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +7 -7
- package/es2015/jodit.js +703 -166
- package/es2015/jodit.min.js +7 -7
- 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.js +7 -7
- package/es2018/jodit.min.js +7 -7
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +13 -13
- package/es2021/jodit.js +703 -166
- package/es2021/jodit.min.js +13 -13
- 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 +1 -1
- package/es2021.en/jodit.fat.min.js +19 -19
- package/es2021.en/jodit.js +703 -166
- package/es2021.en/jodit.min.js +19 -19
- 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 +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +731 -171
- package/es5/jodit.min.css +2 -2
- 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/jodit.js +2 -1
- package/esm/plugins/delete/delete.js +16 -2
- package/esm/plugins/iframe/iframe.js +59 -12
- package/esm/plugins/media/media.js +2 -4
- package/esm/plugins/paste/helpers.js +4 -2
- package/esm/plugins/resizer/resizer.js +2 -4
- 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/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.11
|
|
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.11";
|
|
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);
|
|
@@ -18578,11 +19044,12 @@ View.defaultOptions = {
|
|
|
18578
19044
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84839);
|
|
18579
19045
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
18580
19046
|
/* 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
|
|
19047
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
|
|
19048
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
19049
|
+
/* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73714);
|
|
19050
|
+
/* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80512);
|
|
19051
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5266);
|
|
19052
|
+
/* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60936);
|
|
18586
19053
|
/*!
|
|
18587
19054
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
18588
19055
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -18604,6 +19071,7 @@ View.defaultOptions = {
|
|
|
18604
19071
|
|
|
18605
19072
|
|
|
18606
19073
|
|
|
19074
|
+
|
|
18607
19075
|
const FOCUS_EVENTS = new Set([
|
|
18608
19076
|
'focus',
|
|
18609
19077
|
'blur',
|
|
@@ -18634,7 +19102,7 @@ const NOEDIT = {
|
|
|
18634
19102
|
* `alignClasses.img` when that isn't set
|
|
18635
19103
|
*/ function makeOptions(options) {
|
|
18636
19104
|
var _opt_alignClasses;
|
|
18637
|
-
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)(options || {},
|
|
19105
|
+
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions);
|
|
18638
19106
|
if (opt.imageAlignClasses && !((_opt_alignClasses = opt.alignClasses) === null || _opt_alignClasses === void 0 ? void 0 : _opt_alignClasses.img)) {
|
|
18639
19107
|
opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)({
|
|
18640
19108
|
img: opt.imageAlignClasses
|
|
@@ -18642,7 +19110,7 @@ const NOEDIT = {
|
|
|
18642
19110
|
}
|
|
18643
19111
|
return opt;
|
|
18644
19112
|
}
|
|
18645
|
-
class Jodit extends
|
|
19113
|
+
class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_12__.ViewWithToolbar {
|
|
18646
19114
|
/** @override */ className() {
|
|
18647
19115
|
return 'Jodit';
|
|
18648
19116
|
}
|
|
@@ -18685,7 +19153,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18685
19153
|
* Return a default timeout period in milliseconds for some debounce or throttle functions.
|
|
18686
19154
|
* By default, `{history.timeout}` options
|
|
18687
19155
|
*/ get defaultTimeout() {
|
|
18688
|
-
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout :
|
|
19156
|
+
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
19157
|
}
|
|
18690
19158
|
/**
|
|
18691
19159
|
* Method wrap usual object in Object helper for prevent deep object merging in options*
|
|
@@ -18715,7 +19183,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18715
19183
|
/**
|
|
18716
19184
|
* Default settings
|
|
18717
19185
|
*/ static get defaultOptions() {
|
|
18718
|
-
return
|
|
19186
|
+
return jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions;
|
|
18719
19187
|
}
|
|
18720
19188
|
/**
|
|
18721
19189
|
* Deep-merges partial options into the global defaults without replacing
|
|
@@ -18763,7 +19231,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18763
19231
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigMerge)(Jodit.defaultOptions, options);
|
|
18764
19232
|
}
|
|
18765
19233
|
get createInside() {
|
|
18766
|
-
return new
|
|
19234
|
+
return new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Create(()=>this.ed, this.o.createAttributes);
|
|
18767
19235
|
}
|
|
18768
19236
|
__setPlaceField(field, value) {
|
|
18769
19237
|
if (!this.currentPlace) {
|
|
@@ -18963,7 +19431,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
18963
19431
|
}
|
|
18964
19432
|
value = this.getNativeEditorValue().replace(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.INVISIBLE_SPACE_REG_EXP(), '');
|
|
18965
19433
|
if (removeSelectionMarkers) {
|
|
18966
|
-
value =
|
|
19434
|
+
value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__.removeEmptyMarkedTags)(value, 'span', 'id="jodit-selection_marker_');
|
|
18967
19435
|
}
|
|
18968
19436
|
if (value === '<br>') {
|
|
18969
19437
|
value = '';
|
|
@@ -19277,7 +19745,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19277
19745
|
return this.getMode();
|
|
19278
19746
|
}
|
|
19279
19747
|
const active = this.od.activeElement;
|
|
19280
|
-
if (active && (active === this.iframe ||
|
|
19748
|
+
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
19749
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.MODE_WYSIWYG;
|
|
19282
19750
|
}
|
|
19283
19751
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.MODE_SOURCE;
|
|
@@ -19430,7 +19898,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19430
19898
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(element.attributes).forEach((attr)=>{
|
|
19431
19899
|
const name = attr.name;
|
|
19432
19900
|
let value = attr.value;
|
|
19433
|
-
if (
|
|
19901
|
+
if (jodit_config__WEBPACK_IMPORTED_MODULE_11__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
|
|
19434
19902
|
if ([
|
|
19435
19903
|
'readonly',
|
|
19436
19904
|
'disabled'
|
|
@@ -19467,7 +19935,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19467
19935
|
container = element;
|
|
19468
19936
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, __defaultClassesKey, element.className.toString());
|
|
19469
19937
|
buffer = container.innerHTML;
|
|
19470
|
-
|
|
19938
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.detach(container);
|
|
19471
19939
|
}
|
|
19472
19940
|
container.classList.add('jodit_inline');
|
|
19473
19941
|
container.classList.add('jodit-container');
|
|
@@ -19475,7 +19943,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19475
19943
|
// actual for inline mode
|
|
19476
19944
|
if (element !== container) {
|
|
19477
19945
|
// hide source element
|
|
19478
|
-
const display = (0,
|
|
19946
|
+
const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display');
|
|
19479
19947
|
if (display) {
|
|
19480
19948
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, __defaultStyleDisplayKey, display);
|
|
19481
19949
|
}
|
|
@@ -19487,21 +19955,21 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19487
19955
|
// the toolbar box below it when (re)attaching the toolbar container.
|
|
19488
19956
|
const aboveSlot = this.c.div(this.getFullElName(SLOT, 'above'), NOEDIT);
|
|
19489
19957
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(aboveSlot, 'data-jodit-above-toolbar', '');
|
|
19490
|
-
|
|
19958
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.appendChildFirst(container, aboveSlot);
|
|
19491
19959
|
const topSlot = this.c.div(this.getFullElName(SLOT, 'top'), NOEDIT);
|
|
19492
|
-
|
|
19960
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(container, topSlot);
|
|
19493
19961
|
const centerSlot = this.c.div(this.getFullElName(SLOT, 'center'), NOEDIT);
|
|
19494
19962
|
const workplace = this.c.div('jodit-workplace', NOEDIT);
|
|
19495
19963
|
const leftSlot = this.c.div(this.getFullElName(SLOT, 'left'), NOEDIT);
|
|
19496
19964
|
const rightSlot = this.c.div(this.getFullElName(SLOT, 'right'), NOEDIT);
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19965
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(centerSlot, leftSlot);
|
|
19966
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(centerSlot, workplace);
|
|
19967
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(centerSlot, rightSlot);
|
|
19968
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(container, centerSlot);
|
|
19501
19969
|
const bottomPanel = this.c.div(this.getFullElName(SLOT, 'bottom'), NOEDIT);
|
|
19502
|
-
|
|
19970
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(container, bottomPanel);
|
|
19503
19971
|
if (element.parentNode && element !== container) {
|
|
19504
|
-
|
|
19972
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.before(element, container);
|
|
19505
19973
|
}
|
|
19506
19974
|
Object.defineProperty(element, 'component', {
|
|
19507
19975
|
enumerable: false,
|
|
@@ -19513,7 +19981,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19513
19981
|
'aria-disabled': false,
|
|
19514
19982
|
tabindex: this.o.tabIndex
|
|
19515
19983
|
});
|
|
19516
|
-
|
|
19984
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(workplace, editor);
|
|
19517
19985
|
const currentPlace = {
|
|
19518
19986
|
editor,
|
|
19519
19987
|
element,
|
|
@@ -19527,9 +19995,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19527
19995
|
left: leftSlot,
|
|
19528
19996
|
right: rightSlot
|
|
19529
19997
|
},
|
|
19530
|
-
statusbar: new
|
|
19998
|
+
statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.StatusBar(this, container),
|
|
19531
19999
|
options: this.isReady ? makeOptions(options) : this.options,
|
|
19532
|
-
history: new
|
|
20000
|
+
history: new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.History(this),
|
|
19533
20001
|
editorWindow: this.ow
|
|
19534
20002
|
};
|
|
19535
20003
|
this.__elementToPlace.set(editor, currentPlace);
|
|
@@ -19562,7 +20030,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19562
20030
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(initResult, init);
|
|
19563
20031
|
}
|
|
19564
20032
|
addDisclaimer(elm) {
|
|
19565
|
-
|
|
20033
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(this.workplace, elm);
|
|
19566
20034
|
}
|
|
19567
20035
|
/**
|
|
19568
20036
|
* Set current place object
|
|
@@ -19625,7 +20093,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19625
20093
|
return;
|
|
19626
20094
|
}
|
|
19627
20095
|
if (stayDefault === false || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isPromise)(stayDefault)) {
|
|
19628
|
-
|
|
20096
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(defaultEditorArea);
|
|
19629
20097
|
}
|
|
19630
20098
|
addClassNames(this.o.editorClassName, this.editor);
|
|
19631
20099
|
if (this.o.style) {
|
|
@@ -19674,7 +20142,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19674
20142
|
// and such an element stays in the editor
|
|
19675
20143
|
if (FOCUS_EVENTS.has(type)) {
|
|
19676
20144
|
const inner = type === 'focusin' || type === 'focusout';
|
|
19677
|
-
if (inner === (event.target === editor) ||
|
|
20145
|
+
if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(editor, event.relatedTarget)) {
|
|
19678
20146
|
return;
|
|
19679
20147
|
}
|
|
19680
20148
|
if (inner) {
|
|
@@ -19711,7 +20179,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19711
20179
|
});
|
|
19712
20180
|
}
|
|
19713
20181
|
fetch(url, options) {
|
|
19714
|
-
const ajax = new
|
|
20182
|
+
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_9__.Ajax((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({
|
|
19715
20183
|
url
|
|
19716
20184
|
}, options), this.o.defaultAjaxOptions);
|
|
19717
20185
|
const destroy = ()=>{
|
|
@@ -19732,7 +20200,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19732
20200
|
if (this.isInDestruct) {
|
|
19733
20201
|
return;
|
|
19734
20202
|
}
|
|
19735
|
-
this.setStatus(
|
|
20203
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.STATUSES.beforeDestruct);
|
|
19736
20204
|
this.__elementToPlace.clear();
|
|
19737
20205
|
(_cached = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cached)(this, 'storage')) === null || _cached === void 0 ? void 0 : _cached.clear();
|
|
19738
20206
|
(_cached1 = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cached)(this, 'buffer')) === null || _cached1 === void 0 ? void 0 : _cached1.clear();
|
|
@@ -19770,17 +20238,17 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19770
20238
|
this.e.off(container);
|
|
19771
20239
|
this.e.off(element);
|
|
19772
20240
|
this.e.off(editor);
|
|
19773
|
-
|
|
19774
|
-
|
|
20241
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(workplace);
|
|
20242
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(editor);
|
|
19775
20243
|
if (container !== element) {
|
|
19776
|
-
|
|
20244
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(container);
|
|
19777
20245
|
}
|
|
19778
20246
|
Object.defineProperty(element, 'component', {
|
|
19779
20247
|
enumerable: false,
|
|
19780
20248
|
configurable: true,
|
|
19781
20249
|
value: null
|
|
19782
20250
|
});
|
|
19783
|
-
|
|
20251
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(iframe);
|
|
19784
20252
|
// inline mode
|
|
19785
20253
|
if (container === element) {
|
|
19786
20254
|
element.innerHTML = tmpValue;
|
|
@@ -19825,7 +20293,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19825
20293
|
this.destruct();
|
|
19826
20294
|
throw e;
|
|
19827
20295
|
}
|
|
19828
|
-
this.setStatus(
|
|
20296
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.STATUSES.beforeInit);
|
|
19829
20297
|
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
20298
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.instances[this.id] = this;
|
|
19831
20299
|
this.attachEvents(options);
|
|
@@ -19835,7 +20303,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19835
20303
|
}
|
|
19836
20304
|
});
|
|
19837
20305
|
this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
|
|
19838
|
-
this.selection = new
|
|
20306
|
+
this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Selection(this);
|
|
19839
20307
|
const beforeInitHookResult = this.beforeInitHook();
|
|
19840
20308
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(beforeInitHookResult, ()=>{
|
|
19841
20309
|
if (this.isInDestruct) {
|
|
@@ -19859,7 +20327,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19859
20327
|
this.e.fire('afterInit', this);
|
|
19860
20328
|
}
|
|
19861
20329
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(this.afterInitHook());
|
|
19862
|
-
this.setStatus(
|
|
20330
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.STATUSES.ready);
|
|
19863
20331
|
this.e.fire('afterConstructor', this);
|
|
19864
20332
|
};
|
|
19865
20333
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.callPromise)(addPlaceResult, init);
|
|
@@ -19875,7 +20343,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19875
20343
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.instances);
|
|
19876
20344
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.lang);
|
|
19877
20345
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
|
|
19878
|
-
Plugin:
|
|
20346
|
+
Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Plugin
|
|
19879
20347
|
});
|
|
19880
20348
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_2__._)([
|
|
19881
20349
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cache
|
|
@@ -19902,7 +20370,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
|
|
|
19902
20370
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
|
|
19903
20371
|
], Jodit.prototype, "__prepareWYSIWYGEditor", null);
|
|
19904
20372
|
Jodit = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_2__._)([
|
|
19905
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.derive)(
|
|
20373
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_10__.Dlgs)
|
|
19906
20374
|
], Jodit);
|
|
19907
20375
|
function addClassNames(className, elm) {
|
|
19908
20376
|
if (className) {
|
|
@@ -33030,7 +33498,18 @@ const KEEPS_SPACES = new Set([
|
|
|
33030
33498
|
/**
|
|
33031
33499
|
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
33032
33500
|
* line break, a block or text starting (or ending) with a plain space
|
|
33033
|
-
*/
|
|
33501
|
+
*/ // The run of spaces at the end (or the start) of the text becomes nbsp; counted, as `/ +$/` backtracks on a long run
|
|
33502
|
+
function replaceEdgeSpaces(text, atEnd) {
|
|
33503
|
+
let count = 0;
|
|
33504
|
+
while(count < text.length && text.charAt(atEnd ? text.length - 1 - count : count) === ' '){
|
|
33505
|
+
count += 1;
|
|
33506
|
+
}
|
|
33507
|
+
if (count === 0) {
|
|
33508
|
+
return text;
|
|
33509
|
+
}
|
|
33510
|
+
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);
|
|
33511
|
+
}
|
|
33512
|
+
function hidesSpace(neighbor, edge) {
|
|
33034
33513
|
var _neighbor_nodeValue;
|
|
33035
33514
|
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
33515
|
}
|
|
@@ -33215,10 +33694,10 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
33215
33694
|
const before = this.__findNeighbor(fake, true, block);
|
|
33216
33695
|
const after = this.__findNeighbor(fake, false, block);
|
|
33217
33696
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) && hidesSpace(after, /^ /)) {
|
|
33218
|
-
before.nodeValue = before.nodeValue
|
|
33697
|
+
before.nodeValue = replaceEdgeSpaces(before.nodeValue, true);
|
|
33219
33698
|
}
|
|
33220
33699
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(after) && hidesSpace(before, / $/)) {
|
|
33221
|
-
after.nodeValue = after.nodeValue
|
|
33700
|
+
after.nodeValue = replaceEdgeSpaces(after.nodeValue, false);
|
|
33222
33701
|
}
|
|
33223
33702
|
}
|
|
33224
33703
|
/**
|
|
@@ -36286,7 +36765,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
36286
36765
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
36287
36766
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
36288
36767
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
|
|
36289
|
-
/* harmony import */ var
|
|
36768
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
36769
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17326);
|
|
36290
36770
|
/*!
|
|
36291
36771
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
36292
36772
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -36301,6 +36781,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
36301
36781
|
|
|
36302
36782
|
|
|
36303
36783
|
|
|
36784
|
+
|
|
36304
36785
|
/**
|
|
36305
36786
|
* Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
|
|
36306
36787
|
* in backend of you system
|
|
@@ -36359,13 +36840,66 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
36359
36840
|
const toggleEditable = ()=>{
|
|
36360
36841
|
(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
36842
|
};
|
|
36843
|
+
// The start of the whitespace run that ends at `to`
|
|
36844
|
+
const skipBack = (text, to)=>{
|
|
36845
|
+
while(to > 0 && /\s/.test(text.charAt(to - 1))){
|
|
36846
|
+
to -= 1;
|
|
36847
|
+
}
|
|
36848
|
+
return to;
|
|
36849
|
+
};
|
|
36850
|
+
// The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
|
|
36851
|
+
const cleanBodyTag = (tag)=>{
|
|
36852
|
+
tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
|
|
36853
|
+
const skip = (from, chars)=>{
|
|
36854
|
+
while(chars.test(tag.charAt(from))){
|
|
36855
|
+
from += 1;
|
|
36856
|
+
}
|
|
36857
|
+
return from;
|
|
36858
|
+
};
|
|
36859
|
+
let index = tag.indexOf('contenteditable');
|
|
36860
|
+
while(index !== -1){
|
|
36861
|
+
let to = skip(index + 'contenteditable'.length, /["'\s]/);
|
|
36862
|
+
if (tag.charAt(to) === '=') {
|
|
36863
|
+
to = skip(to + 1, /[\s"']/);
|
|
36864
|
+
if (tag.startsWith('true', to)) {
|
|
36865
|
+
to = skip(to + 4, /["']/);
|
|
36866
|
+
let from = index;
|
|
36867
|
+
if (/["']/.test(tag.charAt(from - 1))) {
|
|
36868
|
+
from -= 1;
|
|
36869
|
+
}
|
|
36870
|
+
from = skipBack(tag, from);
|
|
36871
|
+
return tag.slice(0, from) + tag.slice(to);
|
|
36872
|
+
}
|
|
36873
|
+
}
|
|
36874
|
+
index = tag.indexOf('contenteditable', index + 1);
|
|
36875
|
+
}
|
|
36876
|
+
return tag;
|
|
36877
|
+
};
|
|
36362
36878
|
const clearMarkers = (html)=>{
|
|
36363
36879
|
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
36364
|
-
html =
|
|
36365
|
-
const
|
|
36366
|
-
|
|
36367
|
-
|
|
36368
|
-
|
|
36880
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(html, '<style', '>', '</style>', 'jodit-box');
|
|
36881
|
+
const bodyStart = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag)(html, 'body');
|
|
36882
|
+
let bodyEnd = -1;
|
|
36883
|
+
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)){
|
|
36884
|
+
bodyEnd = index;
|
|
36885
|
+
}
|
|
36886
|
+
if (bodyStart !== -1 && bodyEnd !== -1) {
|
|
36887
|
+
const afterBody = bodyEnd + '</body>'.length;
|
|
36888
|
+
const gt = html.indexOf('>', bodyStart);
|
|
36889
|
+
let body = html.slice(bodyStart, afterBody);
|
|
36890
|
+
if (gt !== -1 && gt < bodyEnd) {
|
|
36891
|
+
body = cleanBodyTag(html.slice(bodyStart, gt)) + html.slice(gt, afterBody);
|
|
36892
|
+
}
|
|
36893
|
+
for (const tag of [
|
|
36894
|
+
'style',
|
|
36895
|
+
'script',
|
|
36896
|
+
'span'
|
|
36897
|
+
]){
|
|
36898
|
+
body = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
|
|
36899
|
+
}
|
|
36900
|
+
// remove markers: the spans outside the body are the editor's own
|
|
36901
|
+
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>');
|
|
36902
|
+
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
36903
|
}
|
|
36370
36904
|
return html;
|
|
36371
36905
|
};
|
|
@@ -42291,9 +42825,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42291
42825
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
42292
42826
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
42293
42827
|
/* 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
|
|
42828
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
|
|
42829
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
|
|
42830
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
42831
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
|
|
42297
42832
|
/*!
|
|
42298
42833
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
42299
42834
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -42308,17 +42843,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42308
42843
|
|
|
42309
42844
|
|
|
42310
42845
|
|
|
42846
|
+
|
|
42311
42847
|
/**
|
|
42312
42848
|
* Process `video` and `audio`
|
|
42313
42849
|
*/ function media(editor) {
|
|
42314
42850
|
const keyFake = 'jodit_fake_wrapper';
|
|
42315
42851
|
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
42316
42852
|
const wrap = (element)=>{
|
|
42317
|
-
if (element.parentNode && (0,
|
|
42853
|
+
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
42318
42854
|
element = element.parentNode;
|
|
42319
42855
|
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
42320
42856
|
var _getMediaWrapper;
|
|
42321
|
-
element = (_getMediaWrapper = (0,
|
|
42857
|
+
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
42858
|
} else if (mediaInFakeBlock) {
|
|
42323
42859
|
const media = element;
|
|
42324
42860
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
@@ -42327,13 +42863,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42327
42863
|
draggable: true,
|
|
42328
42864
|
[`data-${keyFake}`]: 1
|
|
42329
42865
|
});
|
|
42330
|
-
(0,
|
|
42866
|
+
(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
42867
|
// The wrapper fits the media, whose size changes as its metadata loads
|
|
42332
42868
|
// and as it's resized. A percentage width is of the line, so it takes that
|
|
42333
42869
|
const fit = ()=>{
|
|
42334
|
-
(0,
|
|
42335
|
-
display: (0,
|
|
42336
|
-
width: (0,
|
|
42870
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
|
|
42871
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
|
|
42872
|
+
width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
|
|
42337
42873
|
height: ''
|
|
42338
42874
|
});
|
|
42339
42875
|
};
|
|
@@ -42370,15 +42906,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
42370
42906
|
}
|
|
42371
42907
|
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
42372
42908
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
42373
|
-
|
|
42374
|
-
if (rxp.test(data.value)) {
|
|
42375
|
-
data.value = data.value.replace(rxp, '$1');
|
|
42376
|
-
}
|
|
42909
|
+
data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.unwrapMarkedTags)(data.value, mediaFakeTag, `data-${keyFake}`);
|
|
42377
42910
|
}).on('change afterInit afterSetMode changePlace', editor.async.debounce(()=>{
|
|
42378
42911
|
if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE) {
|
|
42379
|
-
(0,
|
|
42380
|
-
if (!(0,
|
|
42381
|
-
(0,
|
|
42912
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
|
|
42913
|
+
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
|
|
42914
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
|
|
42382
42915
|
wrap(elm);
|
|
42383
42916
|
}
|
|
42384
42917
|
});
|
|
@@ -43373,7 +43906,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43373
43906
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
43374
43907
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
43375
43908
|
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
|
|
43376
|
-
/* harmony import */ var
|
|
43909
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
43910
|
+
/* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
|
|
43377
43911
|
/*!
|
|
43378
43912
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
43379
43913
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -43385,11 +43919,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43385
43919
|
|
|
43386
43920
|
|
|
43387
43921
|
|
|
43922
|
+
|
|
43388
43923
|
/**
|
|
43389
43924
|
* Remove special HTML comments
|
|
43390
43925
|
* @private
|
|
43391
43926
|
*/ function removeExtraFragments(html) {
|
|
43392
|
-
html =
|
|
43927
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix)(html, [
|
|
43928
|
+
'<meta'
|
|
43929
|
+
]);
|
|
43393
43930
|
const start = html.search(/<!--StartFragment-->/i);
|
|
43394
43931
|
if (start !== -1) {
|
|
43395
43932
|
html = html.substring(start + 20);
|
|
@@ -43407,7 +43944,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43407
43944
|
* paste bold
|
|
43408
43945
|
* @private
|
|
43409
43946
|
*/ function removeGoogleDocsWrapper(html) {
|
|
43410
|
-
|
|
43947
|
+
// A plain search: the wrapper check is left to the parsed document below
|
|
43948
|
+
if (!/docs-internal-guid-/i.test(html)) {
|
|
43411
43949
|
return html;
|
|
43412
43950
|
}
|
|
43413
43951
|
// An inert document: images don't load and handlers don't run
|
|
@@ -43462,7 +44000,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43462
44000
|
return;
|
|
43463
44001
|
}
|
|
43464
44002
|
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,
|
|
44003
|
+
const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
43466
44004
|
text,
|
|
43467
44005
|
name: text.toLowerCase(),
|
|
43468
44006
|
tabIndex: 0
|
|
@@ -43478,7 +44016,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
|
|
|
43478
44016
|
}
|
|
43479
44017
|
jodit.e.fire('afterClosePasteDialog', dialog);
|
|
43480
44018
|
});
|
|
43481
|
-
const cancel = (0,
|
|
44019
|
+
const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
43482
44020
|
text: 'Cancel',
|
|
43483
44021
|
tabIndex: 0
|
|
43484
44022
|
}).onAction(()=>{
|
|
@@ -44991,12 +45529,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
44991
45529
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
44992
45530
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
44993
45531
|
/* 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
|
|
45532
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
|
|
45533
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
45534
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
|
|
45535
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42259);
|
|
45536
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
|
|
45537
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(56490);
|
|
45538
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(96608);
|
|
45000
45539
|
/*!
|
|
45001
45540
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
45002
45541
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -45020,6 +45559,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
45020
45559
|
|
|
45021
45560
|
|
|
45022
45561
|
|
|
45562
|
+
|
|
45023
45563
|
const keyBInd = '__jodit-resizer_binded';
|
|
45024
45564
|
/**
|
|
45025
45565
|
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
@@ -45037,7 +45577,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
45037
45577
|
* A video with no height of its own takes it from its width and its ratio,
|
|
45038
45578
|
* so resizing it keeps the ratio without setting a height.
|
|
45039
45579
|
*/ 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,
|
|
45580
|
+
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
45581
|
}
|
|
45042
45582
|
const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
45043
45583
|
/**
|
|
@@ -45047,7 +45587,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45047
45587
|
*/ 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
45588
|
/**
|
|
45049
45589
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
45050
|
-
*/ class resizer extends
|
|
45590
|
+
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
|
|
45051
45591
|
/** @override */ afterInit(editor) {
|
|
45052
45592
|
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
45053
45593
|
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
|
|
@@ -45064,10 +45604,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45064
45604
|
.on('keydown', this.onEditorKeyDown, {
|
|
45065
45605
|
top: true
|
|
45066
45606
|
}).on('afterGetValueFromEditor.resizer', (data)=>{
|
|
45067
|
-
|
|
45068
|
-
if (rgx.test(data.value)) {
|
|
45069
|
-
data.value = data.value.replace(rgx, '$1');
|
|
45070
|
-
}
|
|
45607
|
+
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
45608
|
});
|
|
45072
45609
|
this.addEventListeners();
|
|
45073
45610
|
this.__onChangeEditor();
|
|
@@ -45104,7 +45641,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45104
45641
|
return;
|
|
45105
45642
|
}
|
|
45106
45643
|
const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width');
|
|
45107
|
-
if (width && !(0,
|
|
45644
|
+
if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(image, 'width')) {
|
|
45108
45645
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
|
|
45109
45646
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width', null);
|
|
45110
45647
|
}
|
|
@@ -45228,7 +45765,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45228
45765
|
__followCaret() {
|
|
45229
45766
|
const before = this.__keyDownRange;
|
|
45230
45767
|
this.__keyDownRange = null;
|
|
45231
|
-
if (!(0,
|
|
45768
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__.isMoved)(this.j, before)) {
|
|
45232
45769
|
return;
|
|
45233
45770
|
}
|
|
45234
45771
|
if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
|
|
@@ -45263,7 +45800,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45263
45800
|
if (!this.isResizeMode) {
|
|
45264
45801
|
// A click in the element's popup, or in a list it opens, works on
|
|
45265
45802
|
// the element, so it keeps its frame
|
|
45266
|
-
if ((e === null || e === void 0 ? void 0 : e.target) &&
|
|
45803
|
+
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
45804
|
return;
|
|
45268
45805
|
}
|
|
45269
45806
|
return this.hide();
|
|
@@ -45287,7 +45824,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45287
45824
|
if (changeAttrs) {
|
|
45288
45825
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
|
|
45289
45826
|
}
|
|
45290
|
-
if (!changeAttrs || (0,
|
|
45827
|
+
if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, key)) {
|
|
45291
45828
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
|
|
45292
45829
|
}
|
|
45293
45830
|
}
|
|
@@ -45353,7 +45890,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45353
45890
|
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
45354
45891
|
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
45355
45892
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
45356
|
-
display: (0,
|
|
45893
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
|
|
45357
45894
|
});
|
|
45358
45895
|
if (width) {
|
|
45359
45896
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
@@ -45471,7 +46008,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
45471
46008
|
}
|
|
45472
46009
|
if (this.element && this.rect) {
|
|
45473
46010
|
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,
|
|
46011
|
+
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
46012
|
const newTop = pos.top - workplacePosition.top, newLeft = pos.left - workplacePosition.left;
|
|
45476
46013
|
if (top !== newTop || left !== newLeft || w !== this.element.offsetWidth || h !== this.element.offsetHeight) {
|
|
45477
46014
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, {
|