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/es2021.en/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
|
*/
|
|
@@ -1824,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1824
1824
|
* ```
|
|
1825
1825
|
* @packageDocumentation
|
|
1826
1826
|
* @module constants
|
|
1827
|
-
*/ const APP_VERSION = "4.19.
|
|
1827
|
+
*/ const APP_VERSION = "4.19.11";
|
|
1828
1828
|
// prettier-ignore
|
|
1829
1829
|
const ES = "es2021";
|
|
1830
1830
|
const IS_ES_MODERN = true;
|
|
@@ -3086,14 +3086,15 @@ function wait(condition) {
|
|
|
3086
3086
|
/* harmony import */ var jodit_core_helpers_checker_is_set__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3213);
|
|
3087
3087
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85932);
|
|
3088
3088
|
/* harmony import */ var jodit_core_helpers_checker_is_void__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18303);
|
|
3089
|
-
/* harmony import */ var
|
|
3090
|
-
/* harmony import */ var
|
|
3091
|
-
/* harmony import */ var
|
|
3092
|
-
/* harmony import */ var
|
|
3093
|
-
/* harmony import */ var
|
|
3094
|
-
/* harmony import */ var
|
|
3095
|
-
/* harmony import */ var
|
|
3096
|
-
/* harmony import */ var
|
|
3089
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81910);
|
|
3090
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4040);
|
|
3091
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28712);
|
|
3092
|
+
/* 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__);
|
|
3093
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7909);
|
|
3094
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(80991);
|
|
3095
|
+
/* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(36400);
|
|
3096
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(33201);
|
|
3097
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(71125);
|
|
3097
3098
|
/*!
|
|
3098
3099
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3099
3100
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -3118,7 +3119,7 @@ function wait(condition) {
|
|
|
3118
3119
|
|
|
3119
3120
|
|
|
3120
3121
|
|
|
3121
|
-
|
|
3122
|
+
|
|
3122
3123
|
/**
|
|
3123
3124
|
* Module for working with DOM
|
|
3124
3125
|
*/ class Dom {
|
|
@@ -3196,7 +3197,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3196
3197
|
const wrapper = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(tag) ? create.element(tag) : tag;
|
|
3197
3198
|
if (Dom.isNode(current)) {
|
|
3198
3199
|
if (!current.parentNode) {
|
|
3199
|
-
throw (0,
|
|
3200
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_14__.error)('Element should be in DOM');
|
|
3200
3201
|
}
|
|
3201
3202
|
current.parentNode.insertBefore(wrapper, current);
|
|
3202
3203
|
wrapper.appendChild(current);
|
|
@@ -3246,12 +3247,12 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3246
3247
|
}
|
|
3247
3248
|
static replace(elm, newTagName, create, withAttributes = false, notMoveContent = false) {
|
|
3248
3249
|
if ((0,jodit_core_helpers_checker_is_html__WEBPACK_IMPORTED_MODULE_4__.isHTML)(newTagName)) {
|
|
3249
|
-
(0,
|
|
3250
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(create, 'Need create instance for new tag');
|
|
3250
3251
|
newTagName = create.fromHTML(newTagName);
|
|
3251
3252
|
}
|
|
3252
3253
|
let tag;
|
|
3253
3254
|
if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__.isString)(newTagName)) {
|
|
3254
|
-
(0,
|
|
3255
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(create, 'Need create instance for new tag');
|
|
3255
3256
|
tag = create.element(newTagName);
|
|
3256
3257
|
} else {
|
|
3257
3258
|
tag = newTagName;
|
|
@@ -3300,7 +3301,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3300
3301
|
} else {
|
|
3301
3302
|
cond = condNoEmptyElement;
|
|
3302
3303
|
}
|
|
3303
|
-
const emptyText = (node)=>node.nodeValue == null || (0,
|
|
3304
|
+
const emptyText = (node)=>node.nodeValue == null || (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(node.nodeValue).length === 0;
|
|
3304
3305
|
if (Dom.isText(node)) {
|
|
3305
3306
|
return emptyText(node);
|
|
3306
3307
|
}
|
|
@@ -3390,7 +3391,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3390
3391
|
return Dom.isElement(node) && !/^(BR|HR)$/i.test(node.tagName) && [
|
|
3391
3392
|
'inline',
|
|
3392
3393
|
'inline-block'
|
|
3393
|
-
].indexOf((0,
|
|
3394
|
+
].indexOf((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_12__.css)(node, 'display').toString()) !== -1;
|
|
3394
3395
|
}
|
|
3395
3396
|
/**
|
|
3396
3397
|
* It's block and it can be split
|
|
@@ -3564,13 +3565,13 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3564
3565
|
* Returns the nearest non-empty sibling
|
|
3565
3566
|
*/ static findNotEmptySibling(node, left) {
|
|
3566
3567
|
return Dom.findSibling(node, left, (n)=>{
|
|
3567
|
-
return !Dom.isEmptyTextNode(n) && Boolean(!Dom.isText(n) || n.nodeValue?.length && (0,
|
|
3568
|
+
return !Dom.isEmptyTextNode(n) && Boolean(!Dom.isText(n) || n.nodeValue?.length && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_9__.trim)(n.nodeValue));
|
|
3568
3569
|
});
|
|
3569
3570
|
}
|
|
3570
3571
|
/**
|
|
3571
3572
|
* Returns the nearest non-empty neighbor
|
|
3572
3573
|
*/ static findNotEmptyNeighbor(node, left, root) {
|
|
3573
|
-
return (0,
|
|
3574
|
+
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?.nodeValue || '').length)), root);
|
|
3574
3575
|
}
|
|
3575
3576
|
static sibling(node, left) {
|
|
3576
3577
|
return left ? node.previousSibling : node.nextSibling;
|
|
@@ -3715,7 +3716,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3715
3716
|
if (!node) {
|
|
3716
3717
|
return;
|
|
3717
3718
|
}
|
|
3718
|
-
;(0,
|
|
3719
|
+
;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__.dataBind)(node, '__old_display', node.style.getPropertyValue('display'));
|
|
3719
3720
|
node.style.setProperty('display', 'none');
|
|
3720
3721
|
}
|
|
3721
3722
|
/**
|
|
@@ -3724,7 +3725,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3724
3725
|
if (!node) {
|
|
3725
3726
|
return;
|
|
3726
3727
|
}
|
|
3727
|
-
const display = (0,
|
|
3728
|
+
const display = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_13__.dataBind)(node, '__old_display');
|
|
3728
3729
|
if (node.style.getPropertyValue('display') === 'none') {
|
|
3729
3730
|
node.style.setProperty('display', display || null);
|
|
3730
3731
|
}
|
|
@@ -3745,8 +3746,8 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3745
3746
|
/**
|
|
3746
3747
|
* Marks an item as temporary
|
|
3747
3748
|
*/ static markTemporary(element, attributes) {
|
|
3748
|
-
attributes && (0,
|
|
3749
|
-
(0,
|
|
3749
|
+
attributes && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, attributes);
|
|
3750
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_11__.attr)(element, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR, true);
|
|
3750
3751
|
return element;
|
|
3751
3752
|
}
|
|
3752
3753
|
/**
|
|
@@ -3755,7 +3756,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3755
3756
|
if (!Dom.isElement(element)) {
|
|
3756
3757
|
return false;
|
|
3757
3758
|
}
|
|
3758
|
-
return Dom.isMarker(element) || (0,
|
|
3759
|
+
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';
|
|
3759
3760
|
}
|
|
3760
3761
|
/**
|
|
3761
3762
|
* Define element is selection helper
|
|
@@ -3765,7 +3766,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
|
|
|
3765
3766
|
/**
|
|
3766
3767
|
* Unwrap temporary elements inside a HTML string (keeps their content)
|
|
3767
3768
|
*/ static replaceTemporaryFromString(value) {
|
|
3768
|
-
return
|
|
3769
|
+
return (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_8__.unwrapMarkedTags)(value, null, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.TEMP_ATTR);
|
|
3769
3770
|
}
|
|
3770
3771
|
/**
|
|
3771
3772
|
* Collect the temporary elements (`data-jodit-temp`) inside the root.
|
|
@@ -5325,16 +5326,96 @@ function isFastEqual(a, b) {
|
|
|
5325
5326
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5326
5327
|
*/ /**
|
|
5327
5328
|
* @module helpers/checker
|
|
5328
|
-
*/
|
|
5329
|
+
*/ const SPACE = /\s/;
|
|
5330
|
+
const DIGIT = /\d/;
|
|
5331
|
+
const WORD_CHAR = /\w/;
|
|
5332
|
+
// `content="Microsoft Word 15"` — the name followed by a space and a version digit
|
|
5333
|
+
function hasGenerator(tag, name) {
|
|
5334
|
+
let index = tag.indexOf(name);
|
|
5335
|
+
while(index !== -1){
|
|
5336
|
+
const after = index + name.length;
|
|
5337
|
+
if (SPACE.test(tag.charAt(after)) && DIGIT.test(tag.charAt(after + 1))) {
|
|
5338
|
+
return true;
|
|
5339
|
+
}
|
|
5340
|
+
index = tag.indexOf(name, after);
|
|
5341
|
+
}
|
|
5342
|
+
return false;
|
|
5343
|
+
}
|
|
5344
|
+
// `<meta name=ProgId content=Word.Document>`, `<meta name=Generator content="LibreOffice 7.6">`
|
|
5345
|
+
function isOfficeMeta(tag) {
|
|
5346
|
+
if (hasGenerator(tag, 'Microsoft Word') || hasGenerator(tag, 'Microsoft Excel')) {
|
|
5347
|
+
return true;
|
|
5348
|
+
}
|
|
5349
|
+
const lower = tag.toLowerCase();
|
|
5350
|
+
const progId = lower.indexOf('progid');
|
|
5351
|
+
if (progId !== -1 && (lower.indexOf('word.', progId) !== -1 || lower.indexOf('excel.', progId) !== -1)) {
|
|
5352
|
+
return true;
|
|
5353
|
+
}
|
|
5354
|
+
return lower.includes('libreoffice') || lower.includes('openoffice');
|
|
5355
|
+
}
|
|
5356
|
+
// ` class=MsoNormal`, ` class="MsoListParagraph"` inside one tag
|
|
5357
|
+
function hasMsoClass(tag) {
|
|
5358
|
+
let index = tag.indexOf('class=');
|
|
5359
|
+
while(index !== -1){
|
|
5360
|
+
if (index > 0 && SPACE.test(tag.charAt(index - 1))) {
|
|
5361
|
+
let value = index + 'class='.length;
|
|
5362
|
+
const quote = tag.charAt(value);
|
|
5363
|
+
if (quote === '"' || quote === "'") {
|
|
5364
|
+
value += 1;
|
|
5365
|
+
}
|
|
5366
|
+
if (tag.startsWith('Mso', value)) {
|
|
5367
|
+
return true;
|
|
5368
|
+
}
|
|
5369
|
+
}
|
|
5370
|
+
index = tag.indexOf('class=', index + 'class='.length);
|
|
5371
|
+
}
|
|
5372
|
+
return false;
|
|
5373
|
+
}
|
|
5374
|
+
// `style='mso-list:l0 level1 lfo1'` — an `mso-` property inside a style attribute with the given quote
|
|
5375
|
+
function hasMsoStyle(data, quote) {
|
|
5376
|
+
const open = 'style=' + quote;
|
|
5377
|
+
let index = data.indexOf(open);
|
|
5378
|
+
while(index !== -1){
|
|
5379
|
+
const start = index + open.length;
|
|
5380
|
+
let end = data.indexOf(quote, start);
|
|
5381
|
+
if (end === -1) {
|
|
5382
|
+
end = data.length;
|
|
5383
|
+
}
|
|
5384
|
+
if (data.slice(start, end).includes('mso-')) {
|
|
5385
|
+
return true;
|
|
5386
|
+
}
|
|
5387
|
+
index = data.indexOf(open, end);
|
|
5388
|
+
}
|
|
5389
|
+
return false;
|
|
5390
|
+
}
|
|
5391
|
+
/**
|
|
5329
5392
|
* Detect if string is HTML from MS Word, Excel or LibreOffice/OpenOffice
|
|
5393
|
+
*
|
|
5394
|
+
* The clipboard text is attacker controlled, so every check walks the string
|
|
5395
|
+
* once with `indexOf`: a regex with an unbounded group before a required
|
|
5396
|
+
* literal was quadratic on a long run of `<meta` and froze the tab.
|
|
5330
5397
|
*/ function isHtmlFromWord(data) {
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5398
|
+
if (data.includes('urn:schemas-microsoft-com:office:word') || data.includes('urn:schemas-microsoft-com:office:excel')) {
|
|
5399
|
+
return true;
|
|
5400
|
+
}
|
|
5401
|
+
// Each tag is taken once, from its `<` to the next `>`, so the scan stays linear
|
|
5402
|
+
let index = data.indexOf('<');
|
|
5403
|
+
while(index !== -1){
|
|
5404
|
+
if (!WORD_CHAR.test(data.charAt(index + 1))) {
|
|
5405
|
+
index = data.indexOf('<', index + 1);
|
|
5406
|
+
continue;
|
|
5407
|
+
}
|
|
5408
|
+
let end = data.indexOf('>', index);
|
|
5409
|
+
if (end === -1) {
|
|
5410
|
+
end = data.length;
|
|
5411
|
+
}
|
|
5412
|
+
const tag = data.slice(index, end);
|
|
5413
|
+
if (tag.slice(0, 5).toLowerCase() === '<meta' && isOfficeMeta(tag) || hasMsoClass(tag)) {
|
|
5414
|
+
return true;
|
|
5415
|
+
}
|
|
5416
|
+
index = data.indexOf('<', end);
|
|
5417
|
+
}
|
|
5418
|
+
return hasMsoStyle(data, "'") || hasMsoStyle(data, '"') && data.includes('<font');
|
|
5338
5419
|
}
|
|
5339
5420
|
|
|
5340
5421
|
|
|
@@ -5352,9 +5433,62 @@ function isFastEqual(a, b) {
|
|
|
5352
5433
|
*/ /**
|
|
5353
5434
|
* @module helpers/checker
|
|
5354
5435
|
*/
|
|
5436
|
+
const NAME_START = /[A-Za-z]/;
|
|
5437
|
+
const NAME_CHAR = /[A-Za-z0-9]/;
|
|
5438
|
+
const WORD_CHAR = /\w/;
|
|
5439
|
+
// The tag name at `from`, or '' when there is none
|
|
5440
|
+
function readTagName(str, from) {
|
|
5441
|
+
if (!NAME_START.test(str.charAt(from))) {
|
|
5442
|
+
return '';
|
|
5443
|
+
}
|
|
5444
|
+
let end = from + 1;
|
|
5445
|
+
while(NAME_CHAR.test(str.charAt(end))){
|
|
5446
|
+
end += 1;
|
|
5447
|
+
}
|
|
5448
|
+
return str.slice(from, end);
|
|
5449
|
+
}
|
|
5450
|
+
// Is there an element `<name ...>` closed later by `</name>`? One pass for the closing tags, one for the opening ones
|
|
5451
|
+
function hasElement(str) {
|
|
5452
|
+
const lastClose = new Map();
|
|
5453
|
+
let index = str.indexOf('</');
|
|
5454
|
+
while(index !== -1){
|
|
5455
|
+
const name = readTagName(str, index + 2);
|
|
5456
|
+
if (name !== '' && str.charAt(index + 2 + name.length) === '>') {
|
|
5457
|
+
lastClose.set(name, index);
|
|
5458
|
+
}
|
|
5459
|
+
index = str.indexOf('</', index + 2);
|
|
5460
|
+
}
|
|
5461
|
+
if (lastClose.size === 0) {
|
|
5462
|
+
return false;
|
|
5463
|
+
}
|
|
5464
|
+
let gt = -1;
|
|
5465
|
+
index = str.indexOf('<');
|
|
5466
|
+
while(index !== -1){
|
|
5467
|
+
const name = readTagName(str, index + 1);
|
|
5468
|
+
const after = index + 1 + name.length;
|
|
5469
|
+
if (name !== '' && !WORD_CHAR.test(str.charAt(after))) {
|
|
5470
|
+
if (gt < after) {
|
|
5471
|
+
gt = str.indexOf('>', after);
|
|
5472
|
+
}
|
|
5473
|
+
if (gt === -1) {
|
|
5474
|
+
return false;
|
|
5475
|
+
}
|
|
5476
|
+
const close = lastClose.get(name);
|
|
5477
|
+
if (close !== undefined && close > gt) {
|
|
5478
|
+
return true;
|
|
5479
|
+
}
|
|
5480
|
+
}
|
|
5481
|
+
index = str.indexOf('<', index + 1);
|
|
5482
|
+
}
|
|
5483
|
+
return false;
|
|
5484
|
+
}
|
|
5355
5485
|
/**
|
|
5356
5486
|
* Check if a string is html or not
|
|
5357
|
-
|
|
5487
|
+
*
|
|
5488
|
+
* The pasted text is attacker controlled, so the check walks the string with
|
|
5489
|
+
* `indexOf`: the former regex `<(\w+)[^>]*>(.*?)<\/\1>` was quadratic on a
|
|
5490
|
+
* long run of `<a>` and froze the tab.
|
|
5491
|
+
*/ const isHTML = (str)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString)(str) && hasElement(str);
|
|
5358
5492
|
|
|
5359
5493
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
5360
5494
|
/* harmony export */ "isHTML", 0, /* binding */ isHTML
|
|
@@ -5873,11 +6007,12 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5873
6007
|
/* harmony export */ });
|
|
5874
6008
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
5875
6009
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
5876
|
-
/* harmony import */ var
|
|
5877
|
-
/* harmony import */ var
|
|
5878
|
-
/* harmony import */ var
|
|
5879
|
-
/* harmony import */ var
|
|
5880
|
-
/* harmony import */ var
|
|
6010
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81910);
|
|
6011
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
|
|
6012
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
|
|
6013
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
|
|
6014
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
|
|
6015
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(28723);
|
|
5881
6016
|
/*!
|
|
5882
6017
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
5883
6018
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -5891,8 +6026,19 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
|
|
|
5891
6026
|
|
|
5892
6027
|
|
|
5893
6028
|
|
|
6029
|
+
|
|
6030
|
+
// 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
|
|
5894
6031
|
function normalizeCSS(s) {
|
|
5895
|
-
|
|
6032
|
+
const declarations = s.split(';');
|
|
6033
|
+
const last = declarations.length - 1;
|
|
6034
|
+
return declarations.filter((declaration, index)=>{
|
|
6035
|
+
const match = /^\s*([a-z-]{1,64})\s*:/i.exec(declaration);
|
|
6036
|
+
if (!match) {
|
|
6037
|
+
return true;
|
|
6038
|
+
}
|
|
6039
|
+
const property = match[1].toLowerCase();
|
|
6040
|
+
return !(property.startsWith('mso-') || property.startsWith('border') && index !== last);
|
|
6041
|
+
}).join(';').replace(/([0-9.]{1,32})(pt|cm)/gi, (match, units, metrics)=>{
|
|
5896
6042
|
switch(metrics.toLowerCase()){
|
|
5897
6043
|
case 'pt':
|
|
5898
6044
|
return (parseFloat(units) * 1.328).toFixed(0) + 'px';
|
|
@@ -5914,17 +6060,17 @@ function normalizeCSS(s) {
|
|
|
5914
6060
|
// cell backgrounds/borders, e.g. `.xl31 { background:#FCE4D6 }`) were never
|
|
5915
6061
|
// inlined and all styling was lost once the `<style>` block got stripped.
|
|
5916
6062
|
// See https://github.com/xdan/jodit/issues/1362
|
|
5917
|
-
const
|
|
5918
|
-
if (
|
|
6063
|
+
const open = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_2__.indexOfOpenTag)(html, 'html');
|
|
6064
|
+
if (open === -1) {
|
|
5919
6065
|
return html;
|
|
5920
6066
|
}
|
|
5921
|
-
html = html.substring(
|
|
6067
|
+
html = html.substring(open);
|
|
5922
6068
|
const closeIndex = html.toLowerCase().lastIndexOf('</html>');
|
|
5923
6069
|
if (closeIndex !== -1) {
|
|
5924
6070
|
html = html.substring(0, closeIndex + '</html>'.length);
|
|
5925
6071
|
}
|
|
5926
6072
|
const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
|
|
5927
|
-
(0,
|
|
6073
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(iframe, 'display', 'none');
|
|
5928
6074
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
|
|
5929
6075
|
let convertedString = '', collection;
|
|
5930
6076
|
try {
|
|
@@ -5933,14 +6079,14 @@ function normalizeCSS(s) {
|
|
|
5933
6079
|
iframeDoc.open();
|
|
5934
6080
|
iframeDoc.write(html);
|
|
5935
6081
|
iframeDoc.close();
|
|
5936
|
-
const listItems = (0,
|
|
6082
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(iframeDoc.body);
|
|
5937
6083
|
// Word marks its auto-generated list markers (the literal
|
|
5938
6084
|
// bullet/number, e.g. `1.` or `·`) with `mso-list:Ignore`.
|
|
5939
6085
|
// They are display-only and must not be imported, otherwise
|
|
5940
6086
|
// the marker text leaks into the content. Drop them before any
|
|
5941
6087
|
// style normalization strips the `mso-list` hint. See #948
|
|
5942
6088
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5943
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,
|
|
6089
|
+
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') || '')) {
|
|
5944
6090
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
|
|
5945
6091
|
}
|
|
5946
6092
|
});
|
|
@@ -5951,7 +6097,7 @@ function normalizeCSS(s) {
|
|
|
5951
6097
|
if (rules[idx].selectorText === '') {
|
|
5952
6098
|
continue;
|
|
5953
6099
|
}
|
|
5954
|
-
collection = (0,
|
|
6100
|
+
collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_7__.$$)(rules[idx].selectorText, iframeDoc.body);
|
|
5955
6101
|
// `style.cssText` on purpose: the CSSOM parses the text,
|
|
5956
6102
|
// drops invalid declarations and re-serializes it. The raw
|
|
5957
6103
|
// `style` attribute would keep Word-only junk verbatim
|
|
@@ -5965,19 +6111,19 @@ function normalizeCSS(s) {
|
|
|
5965
6111
|
throw e;
|
|
5966
6112
|
}
|
|
5967
6113
|
}
|
|
5968
|
-
;(0,
|
|
6114
|
+
;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
|
|
5969
6115
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
|
|
5970
6116
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node)) {
|
|
5971
|
-
const cssText = (0,
|
|
6117
|
+
const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style');
|
|
5972
6118
|
if (cssText) {
|
|
5973
6119
|
node.style.cssText = normalizeCSS(cssText);
|
|
5974
6120
|
}
|
|
5975
|
-
if (!(0,
|
|
5976
|
-
(0,
|
|
6121
|
+
if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style')) {
|
|
6122
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style', null);
|
|
5977
6123
|
}
|
|
5978
6124
|
}
|
|
5979
6125
|
});
|
|
5980
|
-
convertedString = iframeDoc.firstChild ? (0,
|
|
6126
|
+
convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim)(iframeDoc.body.innerHTML) : '';
|
|
5981
6127
|
}
|
|
5982
6128
|
} catch {} finally{
|
|
5983
6129
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(iframe);
|
|
@@ -5985,7 +6131,7 @@ function normalizeCSS(s) {
|
|
|
5985
6131
|
if (convertedString) {
|
|
5986
6132
|
html = convertedString;
|
|
5987
6133
|
}
|
|
5988
|
-
return (0,
|
|
6134
|
+
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));
|
|
5989
6135
|
}
|
|
5990
6136
|
|
|
5991
6137
|
|
|
@@ -6001,9 +6147,10 @@ function normalizeCSS(s) {
|
|
|
6001
6147
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
6002
6148
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
6003
6149
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
6004
|
-
/* harmony import */ var
|
|
6005
|
-
/* harmony import */ var
|
|
6006
|
-
/* harmony import */ var
|
|
6150
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
|
|
6151
|
+
/* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75480);
|
|
6152
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4040);
|
|
6153
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7909);
|
|
6007
6154
|
/*!
|
|
6008
6155
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6009
6156
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -6016,6 +6163,7 @@ function normalizeCSS(s) {
|
|
|
6016
6163
|
|
|
6017
6164
|
|
|
6018
6165
|
|
|
6166
|
+
|
|
6019
6167
|
/**
|
|
6020
6168
|
* The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
|
|
6021
6169
|
* content that matches the look and feel of the site.
|
|
@@ -6029,7 +6177,7 @@ function normalizeCSS(s) {
|
|
|
6029
6177
|
const div = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('div');
|
|
6030
6178
|
div.innerHTML = html;
|
|
6031
6179
|
const marks = [];
|
|
6032
|
-
const listItems = (0,
|
|
6180
|
+
const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__.readWordListItems)(div);
|
|
6033
6181
|
if (div.firstChild) {
|
|
6034
6182
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(div, (node)=>{
|
|
6035
6183
|
if (!node) {
|
|
@@ -6054,7 +6202,7 @@ function normalizeCSS(s) {
|
|
|
6054
6202
|
// with `mso-list:Ignore`. They are display-only
|
|
6055
6203
|
// and must not be imported, otherwise the marker
|
|
6056
6204
|
// text leaks into the content. See #948
|
|
6057
|
-
if (/mso-list:\s*ignore/i.test((0,
|
|
6205
|
+
if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attr)(node, 'style') || '')) {
|
|
6058
6206
|
marks.push(node);
|
|
6059
6207
|
break;
|
|
6060
6208
|
}
|
|
@@ -6068,7 +6216,7 @@ function normalizeCSS(s) {
|
|
|
6068
6216
|
// `attrRaw`: SVG keeps camelCase names
|
|
6069
6217
|
// (`viewBox`), `attr()` would kebab-case
|
|
6070
6218
|
// them and silently skip the removal
|
|
6071
|
-
(0,
|
|
6219
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attrRaw)(node, attribute.name, null);
|
|
6072
6220
|
}
|
|
6073
6221
|
});
|
|
6074
6222
|
}
|
|
@@ -6081,14 +6229,14 @@ function normalizeCSS(s) {
|
|
|
6081
6229
|
});
|
|
6082
6230
|
}
|
|
6083
6231
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove.apply(null, marks);
|
|
6084
|
-
(0,
|
|
6232
|
+
(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_4__.wrapWordListItems)(listItems);
|
|
6085
6233
|
convertedString = div.innerHTML;
|
|
6086
6234
|
} catch (e) {}
|
|
6087
6235
|
if (convertedString) {
|
|
6088
6236
|
html = convertedString;
|
|
6089
6237
|
}
|
|
6090
|
-
html = html.split(/(\n)/).filter(
|
|
6091
|
-
return
|
|
6238
|
+
html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_5__.trim).join('\n');
|
|
6239
|
+
return (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.removeWordWrappers)(html);
|
|
6092
6240
|
}
|
|
6093
6241
|
|
|
6094
6242
|
|
|
@@ -6128,10 +6276,17 @@ function normalizeCSS(s) {
|
|
|
6128
6276
|
/* harmony export */ applyStyles: function() { return /* reexport safe */ _apply_styles__WEBPACK_IMPORTED_MODULE_0__.applyStyles; },
|
|
6129
6277
|
/* harmony export */ cleanFromWord: function() { return /* reexport safe */ _clean_from_word__WEBPACK_IMPORTED_MODULE_1__.cleanFromWord; },
|
|
6130
6278
|
/* harmony export */ htmlspecialchars: function() { return /* reexport safe */ _htmlspecialchars__WEBPACK_IMPORTED_MODULE_2__.htmlspecialchars; },
|
|
6279
|
+
/* harmony export */ indexOfClosingTag: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.indexOfClosingTag; },
|
|
6280
|
+
/* harmony export */ indexOfOpenTag: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.indexOfOpenTag; },
|
|
6131
6281
|
/* harmony export */ nl2br: function() { return /* reexport safe */ _nl2br__WEBPACK_IMPORTED_MODULE_3__.nl2br; },
|
|
6282
|
+
/* harmony export */ removeBetween: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeBetween; },
|
|
6283
|
+
/* harmony export */ removeEmptyMarkedTags: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags; },
|
|
6284
|
+
/* harmony export */ removeTagsByPrefix: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeTagsByPrefix; },
|
|
6285
|
+
/* harmony export */ removeWordWrappers: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeWordWrappers; },
|
|
6132
6286
|
/* harmony export */ safeHTML: function() { return /* reexport safe */ _safe_html__WEBPACK_IMPORTED_MODULE_4__.safeHTML; },
|
|
6133
6287
|
/* harmony export */ sanitizeHTMLElement: function() { return /* reexport safe */ _safe_html__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTMLElement; },
|
|
6134
|
-
/* harmony export */ stripTags: function() { return /* reexport safe */ _strip_tags__WEBPACK_IMPORTED_MODULE_5__.stripTags; }
|
|
6288
|
+
/* harmony export */ stripTags: function() { return /* reexport safe */ _strip_tags__WEBPACK_IMPORTED_MODULE_5__.stripTags; },
|
|
6289
|
+
/* harmony export */ unwrapMarkedTags: function() { return /* reexport safe */ _tag_scan__WEBPACK_IMPORTED_MODULE_6__.unwrapMarkedTags; }
|
|
6135
6290
|
/* harmony export */ });
|
|
6136
6291
|
/* harmony import */ var _apply_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30893);
|
|
6137
6292
|
/* harmony import */ var _clean_from_word__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1277);
|
|
@@ -6139,6 +6294,7 @@ function normalizeCSS(s) {
|
|
|
6139
6294
|
/* harmony import */ var _nl2br__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48838);
|
|
6140
6295
|
/* harmony import */ var _safe_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48155);
|
|
6141
6296
|
/* harmony import */ var _strip_tags__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(22852);
|
|
6297
|
+
/* harmony import */ var _tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
|
|
6142
6298
|
/*!
|
|
6143
6299
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6144
6300
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -6153,6 +6309,7 @@ function normalizeCSS(s) {
|
|
|
6153
6309
|
|
|
6154
6310
|
|
|
6155
6311
|
|
|
6312
|
+
|
|
6156
6313
|
/***/ }),
|
|
6157
6314
|
|
|
6158
6315
|
/***/ 48838:
|
|
@@ -6512,6 +6669,282 @@ function restoreTags(content) {
|
|
|
6512
6669
|
}
|
|
6513
6670
|
|
|
6514
6671
|
|
|
6672
|
+
/***/ }),
|
|
6673
|
+
|
|
6674
|
+
/***/ 81910:
|
|
6675
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6676
|
+
|
|
6677
|
+
"use strict";
|
|
6678
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6679
|
+
/* harmony export */ indexOfClosingTag: function() { return /* binding */ indexOfClosingTag; },
|
|
6680
|
+
/* harmony export */ indexOfOpenTag: function() { return /* binding */ indexOfOpenTag; },
|
|
6681
|
+
/* harmony export */ removeBetween: function() { return /* binding */ removeBetween; },
|
|
6682
|
+
/* harmony export */ removeEmptyMarkedTags: function() { return /* binding */ removeEmptyMarkedTags; },
|
|
6683
|
+
/* harmony export */ removeTagsByPrefix: function() { return /* binding */ removeTagsByPrefix; },
|
|
6684
|
+
/* harmony export */ removeWordWrappers: function() { return /* binding */ removeWordWrappers; },
|
|
6685
|
+
/* harmony export */ unwrapMarkedTags: function() { return /* binding */ unwrapMarkedTags; }
|
|
6686
|
+
/* harmony export */ });
|
|
6687
|
+
/*!
|
|
6688
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
6689
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
6690
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
6691
|
+
*/ /**
|
|
6692
|
+
* @module helpers/html
|
|
6693
|
+
*/ // Single passes over HTML that comes from the clipboard or the editor value.
|
|
6694
|
+
// A regex with `[^>]*` or `.*?` before a required literal backtracks
|
|
6695
|
+
// quadratically on a long run of tag openers, so these walk with `indexOf`.
|
|
6696
|
+
const TAG_NAME = /[a-z0-9:-]/i;
|
|
6697
|
+
// The tags the Word clean-up strips: `<html>`, `<colgroup>`, `<col>`, `<o:p>` and their closers
|
|
6698
|
+
const WORD_WRAPPER_TAGS = [
|
|
6699
|
+
'<html',
|
|
6700
|
+
'</html',
|
|
6701
|
+
'<col',
|
|
6702
|
+
'</col',
|
|
6703
|
+
'<o:p',
|
|
6704
|
+
'</o:p'
|
|
6705
|
+
];
|
|
6706
|
+
function startsWithIgnoreCase(html, index, prefix) {
|
|
6707
|
+
return html.substr(index, prefix.length).toLowerCase() === prefix;
|
|
6708
|
+
}
|
|
6709
|
+
// The first `<` at or after `from` that opens one of the prefixes (`<meta`, `</html`, `<!--`)
|
|
6710
|
+
function indexOfPrefix(html, prefixes, from) {
|
|
6711
|
+
let index = html.indexOf('<', from);
|
|
6712
|
+
while(index !== -1){
|
|
6713
|
+
for (const prefix of prefixes){
|
|
6714
|
+
if (startsWithIgnoreCase(html, index, prefix)) {
|
|
6715
|
+
return [
|
|
6716
|
+
index,
|
|
6717
|
+
prefix
|
|
6718
|
+
];
|
|
6719
|
+
}
|
|
6720
|
+
}
|
|
6721
|
+
index = html.indexOf('<', index + 1);
|
|
6722
|
+
}
|
|
6723
|
+
return [
|
|
6724
|
+
-1,
|
|
6725
|
+
''
|
|
6726
|
+
];
|
|
6727
|
+
}
|
|
6728
|
+
/**
|
|
6729
|
+
* The first `</name>` at or after `from`, case-insensitive, or -1
|
|
6730
|
+
*/ function indexOfClosingTag(html, name, from) {
|
|
6731
|
+
const closing = '</' + name + '>';
|
|
6732
|
+
let index = html.indexOf('</', from);
|
|
6733
|
+
while(index !== -1){
|
|
6734
|
+
if (startsWithIgnoreCase(html, index, closing)) {
|
|
6735
|
+
return index;
|
|
6736
|
+
}
|
|
6737
|
+
index = html.indexOf('</', index + 2);
|
|
6738
|
+
}
|
|
6739
|
+
return -1;
|
|
6740
|
+
}
|
|
6741
|
+
/**
|
|
6742
|
+
* Remove every tag that starts with one of the prefixes, up to its `>`:
|
|
6743
|
+
* `removeTagsByPrefix(html, ['<meta', '<!--'])`
|
|
6744
|
+
*/ function removeTagsByPrefix(html, prefixes) {
|
|
6745
|
+
const lower = prefixes.map((prefix)=>prefix.toLowerCase());
|
|
6746
|
+
let result = '';
|
|
6747
|
+
let cursor = 0;
|
|
6748
|
+
for(;;){
|
|
6749
|
+
const [start] = indexOfPrefix(html, lower, cursor);
|
|
6750
|
+
if (start === -1) {
|
|
6751
|
+
break;
|
|
6752
|
+
}
|
|
6753
|
+
const end = html.indexOf('>', start);
|
|
6754
|
+
if (end === -1) {
|
|
6755
|
+
break;
|
|
6756
|
+
}
|
|
6757
|
+
result += html.slice(cursor, start);
|
|
6758
|
+
cursor = end + 1;
|
|
6759
|
+
}
|
|
6760
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6761
|
+
}
|
|
6762
|
+
/**
|
|
6763
|
+
* Strip the Word wrapper tags and then the comments, as the clean-up always did
|
|
6764
|
+
*/ function removeWordWrappers(html) {
|
|
6765
|
+
return removeTagsByPrefix(removeTagsByPrefix(html, WORD_WRAPPER_TAGS), [
|
|
6766
|
+
'<!--'
|
|
6767
|
+
]);
|
|
6768
|
+
}
|
|
6769
|
+
// Every `</name>` position by name, so the closer of an element is found by a binary search
|
|
6770
|
+
function closingTagPositions(html) {
|
|
6771
|
+
const positions = new Map();
|
|
6772
|
+
let index = html.indexOf('</');
|
|
6773
|
+
while(index !== -1){
|
|
6774
|
+
const name = readTagName(html, index + 2).toLowerCase();
|
|
6775
|
+
if (name !== '' && html.charAt(index + 2 + name.length) === '>') {
|
|
6776
|
+
const list = positions.get(name);
|
|
6777
|
+
if (list) {
|
|
6778
|
+
list.push(index);
|
|
6779
|
+
} else {
|
|
6780
|
+
positions.set(name, [
|
|
6781
|
+
index
|
|
6782
|
+
]);
|
|
6783
|
+
}
|
|
6784
|
+
}
|
|
6785
|
+
index = html.indexOf('</', index + 2);
|
|
6786
|
+
}
|
|
6787
|
+
return positions;
|
|
6788
|
+
}
|
|
6789
|
+
// The first position in the sorted list that is >= from, or -1
|
|
6790
|
+
function firstAfter(list, from) {
|
|
6791
|
+
if (!list) {
|
|
6792
|
+
return -1;
|
|
6793
|
+
}
|
|
6794
|
+
let low = 0;
|
|
6795
|
+
let high = list.length;
|
|
6796
|
+
while(low < high){
|
|
6797
|
+
const middle = low + high >> 1;
|
|
6798
|
+
if (list[middle] < from) {
|
|
6799
|
+
low = middle + 1;
|
|
6800
|
+
} else {
|
|
6801
|
+
high = middle;
|
|
6802
|
+
}
|
|
6803
|
+
}
|
|
6804
|
+
return low < list.length ? list[low] : -1;
|
|
6805
|
+
}
|
|
6806
|
+
/**
|
|
6807
|
+
* The index of the first `<name>` or `<name …>` tag, or -1
|
|
6808
|
+
*/ function indexOfOpenTag(html, name) {
|
|
6809
|
+
const prefix = '<' + name.toLowerCase();
|
|
6810
|
+
let cursor = 0;
|
|
6811
|
+
for(;;){
|
|
6812
|
+
const [start] = indexOfPrefix(html, [
|
|
6813
|
+
prefix
|
|
6814
|
+
], cursor);
|
|
6815
|
+
if (start === -1) {
|
|
6816
|
+
return -1;
|
|
6817
|
+
}
|
|
6818
|
+
const next = html.charAt(start + prefix.length);
|
|
6819
|
+
if (next === '>') {
|
|
6820
|
+
return start;
|
|
6821
|
+
}
|
|
6822
|
+
if (/\s/.test(next)) {
|
|
6823
|
+
if (html.indexOf('>', start) === -1) {
|
|
6824
|
+
return -1;
|
|
6825
|
+
}
|
|
6826
|
+
return start;
|
|
6827
|
+
}
|
|
6828
|
+
cursor = start + 1;
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
function readTagName(html, from) {
|
|
6832
|
+
let end = from;
|
|
6833
|
+
while(TAG_NAME.test(html.charAt(end))){
|
|
6834
|
+
end += 1;
|
|
6835
|
+
}
|
|
6836
|
+
return html.slice(from, end);
|
|
6837
|
+
}
|
|
6838
|
+
/**
|
|
6839
|
+
* Replace every `<name … marker …>inner</name>` with `inner`.
|
|
6840
|
+
* `name` null takes any tag; `keep` can refuse an element by its inner HTML.
|
|
6841
|
+
*/ function unwrapMarkedTags(html, name, marker, keep) {
|
|
6842
|
+
const lowerMarker = marker.toLowerCase();
|
|
6843
|
+
const prefixes = [
|
|
6844
|
+
name == null ? '<' : '<' + name.toLowerCase()
|
|
6845
|
+
];
|
|
6846
|
+
const closings = closingTagPositions(html);
|
|
6847
|
+
let result = '';
|
|
6848
|
+
let cursor = 0;
|
|
6849
|
+
for(;;){
|
|
6850
|
+
const [start] = indexOfPrefix(html, prefixes, cursor);
|
|
6851
|
+
if (start === -1) {
|
|
6852
|
+
break;
|
|
6853
|
+
}
|
|
6854
|
+
const tagName = (name ?? readTagName(html, start + 1)).toLowerCase();
|
|
6855
|
+
const gt = html.indexOf('>', start);
|
|
6856
|
+
if (gt === -1) {
|
|
6857
|
+
break;
|
|
6858
|
+
}
|
|
6859
|
+
const close = tagName !== '' && html.slice(start, gt).toLowerCase().includes(lowerMarker) ? firstAfter(closings.get(tagName), gt + 1) : -1;
|
|
6860
|
+
// Not a marked element: the `<` is text, the next one may still open an element
|
|
6861
|
+
if (close === -1) {
|
|
6862
|
+
result += html.slice(cursor, start + 1);
|
|
6863
|
+
cursor = start + 1;
|
|
6864
|
+
continue;
|
|
6865
|
+
}
|
|
6866
|
+
const inner = html.slice(gt + 1, close);
|
|
6867
|
+
const after = close + tagName.length + 3;
|
|
6868
|
+
result += html.slice(cursor, start);
|
|
6869
|
+
result += inner !== '' && (!keep || keep(inner)) ? inner : html.slice(start, after);
|
|
6870
|
+
cursor = after;
|
|
6871
|
+
}
|
|
6872
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6873
|
+
}
|
|
6874
|
+
// The first `literal` at or after `from`, case-insensitive, or -1
|
|
6875
|
+
function indexOfLiteral(html, literal, from) {
|
|
6876
|
+
const head = literal.charAt(0);
|
|
6877
|
+
let index = html.indexOf(head, from);
|
|
6878
|
+
while(index !== -1){
|
|
6879
|
+
if (startsWithIgnoreCase(html, index, literal)) {
|
|
6880
|
+
return index;
|
|
6881
|
+
}
|
|
6882
|
+
index = html.indexOf(head, index + 1);
|
|
6883
|
+
}
|
|
6884
|
+
return -1;
|
|
6885
|
+
}
|
|
6886
|
+
/**
|
|
6887
|
+
* Remove every `open … openEnd … close` block whose opener holds `marker` (any opener when it is ''):
|
|
6888
|
+
* `removeBetween(html, '<style', '>', '</style>', 'jodit-box')`
|
|
6889
|
+
*/ function removeBetween(html, open, openEnd, close, marker = '') {
|
|
6890
|
+
const lowerOpen = open.toLowerCase();
|
|
6891
|
+
const lowerMarker = marker.toLowerCase();
|
|
6892
|
+
let result = '';
|
|
6893
|
+
let cursor = 0;
|
|
6894
|
+
for(;;){
|
|
6895
|
+
const start = indexOfLiteral(html, lowerOpen, cursor);
|
|
6896
|
+
if (start === -1) {
|
|
6897
|
+
break;
|
|
6898
|
+
}
|
|
6899
|
+
const end = indexOfLiteral(html, openEnd, start + open.length);
|
|
6900
|
+
if (end === -1) {
|
|
6901
|
+
break;
|
|
6902
|
+
}
|
|
6903
|
+
if (lowerMarker !== '' && !html.slice(start, end).toLowerCase().includes(lowerMarker)) {
|
|
6904
|
+
result += html.slice(cursor, end + openEnd.length);
|
|
6905
|
+
cursor = end + openEnd.length;
|
|
6906
|
+
continue;
|
|
6907
|
+
}
|
|
6908
|
+
const closeIndex = indexOfLiteral(html, close, end + openEnd.length);
|
|
6909
|
+
if (closeIndex === -1) {
|
|
6910
|
+
break;
|
|
6911
|
+
}
|
|
6912
|
+
result += html.slice(cursor, start);
|
|
6913
|
+
cursor = closeIndex + close.length;
|
|
6914
|
+
}
|
|
6915
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6916
|
+
}
|
|
6917
|
+
/**
|
|
6918
|
+
* Remove every empty `<name … marker …></name>` element
|
|
6919
|
+
*/ function removeEmptyMarkedTags(html, name, marker) {
|
|
6920
|
+
const lowerName = name.toLowerCase();
|
|
6921
|
+
const lowerMarker = marker.toLowerCase();
|
|
6922
|
+
const closing = '</' + lowerName + '>';
|
|
6923
|
+
let result = '';
|
|
6924
|
+
let cursor = 0;
|
|
6925
|
+
for(;;){
|
|
6926
|
+
const [start] = indexOfPrefix(html, [
|
|
6927
|
+
'<' + lowerName
|
|
6928
|
+
], cursor);
|
|
6929
|
+
if (start === -1) {
|
|
6930
|
+
break;
|
|
6931
|
+
}
|
|
6932
|
+
const gt = html.indexOf('>', start);
|
|
6933
|
+
if (gt === -1) {
|
|
6934
|
+
break;
|
|
6935
|
+
}
|
|
6936
|
+
if (html.slice(start, gt).toLowerCase().includes(lowerMarker) && startsWithIgnoreCase(html, gt + 1, closing)) {
|
|
6937
|
+
result += html.slice(cursor, start);
|
|
6938
|
+
cursor = gt + 1 + closing.length;
|
|
6939
|
+
continue;
|
|
6940
|
+
}
|
|
6941
|
+
result += html.slice(cursor, gt + 1);
|
|
6942
|
+
cursor = gt + 1;
|
|
6943
|
+
}
|
|
6944
|
+
return cursor === 0 ? html : result + html.slice(cursor);
|
|
6945
|
+
}
|
|
6946
|
+
|
|
6947
|
+
|
|
6515
6948
|
/***/ }),
|
|
6516
6949
|
|
|
6517
6950
|
/***/ 75480:
|
|
@@ -6711,6 +7144,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6711
7144
|
/* harmony export */ hasContainer: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.hasContainer; },
|
|
6712
7145
|
/* harmony export */ htmlspecialchars: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.htmlspecialchars; },
|
|
6713
7146
|
/* harmony export */ i18n: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.i18n; },
|
|
7147
|
+
/* harmony export */ indexOfClosingTag: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.indexOfClosingTag; },
|
|
7148
|
+
/* harmony export */ indexOfOpenTag: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag; },
|
|
6714
7149
|
/* harmony export */ innerWidth: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.innerWidth; },
|
|
6715
7150
|
/* harmony export */ isAbortError: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.isAbortError; },
|
|
6716
7151
|
/* harmony export */ isArray: function() { return /* reexport safe */ _checker__WEBPACK_IMPORTED_MODULE_2__.isArray; },
|
|
@@ -6752,6 +7187,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6752
7187
|
/* harmony export */ normalizeUrl: function() { return /* reexport safe */ _normalize__WEBPACK_IMPORTED_MODULE_5__.normalizeUrl; },
|
|
6753
7188
|
/* harmony export */ offset: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.offset; },
|
|
6754
7189
|
/* harmony export */ position: function() { return /* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_6__.position; },
|
|
7190
|
+
/* harmony export */ removeBetween: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeBetween; },
|
|
7191
|
+
/* harmony export */ removeEmptyMarkedTags: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeEmptyMarkedTags; },
|
|
7192
|
+
/* harmony export */ removeTagsByPrefix: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix; },
|
|
7193
|
+
/* harmony export */ removeWordWrappers: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.removeWordWrappers; },
|
|
6755
7194
|
/* harmony export */ safeHTML: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.safeHTML; },
|
|
6756
7195
|
/* harmony export */ sanitizeHTMLElement: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTMLElement; },
|
|
6757
7196
|
/* harmony export */ setTimeout: function() { return /* reexport safe */ _async__WEBPACK_IMPORTED_MODULE_1__.setTimeout; },
|
|
@@ -6764,7 +7203,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6764
7203
|
/* harmony export */ trim: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trim; },
|
|
6765
7204
|
/* harmony export */ trimChars: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimChars; },
|
|
6766
7205
|
/* harmony export */ trimInv: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimInv; },
|
|
6767
|
-
/* harmony export */
|
|
7206
|
+
/* harmony export */ trimInvEnd: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.trimInvEnd; },
|
|
7207
|
+
/* harmony export */ ucfirst: function() { return /* reexport safe */ _string__WEBPACK_IMPORTED_MODULE_7__.ucfirst; },
|
|
7208
|
+
/* harmony export */ unwrapMarkedTags: function() { return /* reexport safe */ _html__WEBPACK_IMPORTED_MODULE_4__.unwrapMarkedTags; }
|
|
6768
7209
|
/* harmony export */ });
|
|
6769
7210
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45664);
|
|
6770
7211
|
/* harmony import */ var _async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61077);
|
|
@@ -6776,7 +7217,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6776
7217
|
/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97642);
|
|
6777
7218
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(93640);
|
|
6778
7219
|
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
6779
|
-
/* 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__)
|
|
7220
|
+
/* 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__)
|
|
6780
7221
|
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
6781
7222
|
/*!
|
|
6782
7223
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
@@ -7672,6 +8113,7 @@ function size(subject) {
|
|
|
7672
8113
|
/* harmony export */ trim: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trim; },
|
|
7673
8114
|
/* harmony export */ trimChars: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimChars; },
|
|
7674
8115
|
/* harmony export */ trimInv: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimInv; },
|
|
8116
|
+
/* harmony export */ trimInvEnd: function() { return /* reexport safe */ _trim__WEBPACK_IMPORTED_MODULE_5__.trimInvEnd; },
|
|
7675
8117
|
/* harmony export */ ucfirst: function() { return /* reexport safe */ _ucfirst__WEBPACK_IMPORTED_MODULE_6__.ucfirst; }
|
|
7676
8118
|
/* harmony export */ });
|
|
7677
8119
|
/* harmony import */ var _camel_case__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57821);
|
|
@@ -7769,29 +8211,51 @@ const CamelCaseToKebabCase = (key)=>{
|
|
|
7769
8211
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7770
8212
|
/* harmony export */ trim: function() { return /* binding */ trim; },
|
|
7771
8213
|
/* harmony export */ trimChars: function() { return /* binding */ trimChars; },
|
|
7772
|
-
/* harmony export */ trimInv: function() { return /* binding */ trimInv; }
|
|
8214
|
+
/* harmony export */ trimInv: function() { return /* binding */ trimInv; },
|
|
8215
|
+
/* harmony export */ trimInvEnd: function() { return /* binding */ trimInvEnd; }
|
|
7773
8216
|
/* harmony export */ });
|
|
7774
|
-
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
7775
8217
|
/*!
|
|
7776
8218
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7777
8219
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
7778
8220
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
7779
8221
|
*/ /**
|
|
7780
8222
|
* @module helpers/string
|
|
7781
|
-
*/
|
|
8223
|
+
*/ const SPACE = /[\s\u200b]/;
|
|
8224
|
+
const INVISIBLE = /\uFEFF/;
|
|
8225
|
+
// Cut the chars matching `char` from both ends; `[…]+$` backtracks on a long run that is not at the end
|
|
8226
|
+
function trimBy(value, char) {
|
|
8227
|
+
let start = 0;
|
|
8228
|
+
let end = value.length;
|
|
8229
|
+
while(start < end && char.test(value.charAt(start))){
|
|
8230
|
+
start += 1;
|
|
8231
|
+
}
|
|
8232
|
+
while(end > start && char.test(value.charAt(end - 1))){
|
|
8233
|
+
end -= 1;
|
|
8234
|
+
}
|
|
8235
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
8236
|
+
}
|
|
7782
8237
|
/**
|
|
7783
8238
|
* It clears the line of all auxiliary invisible characters , from the spaces and line breaks , tabs
|
|
7784
8239
|
* from the beginning and end of the line
|
|
7785
8240
|
*/ function trim(value) {
|
|
7786
|
-
return value
|
|
8241
|
+
return trimBy(value, SPACE);
|
|
7787
8242
|
}
|
|
7788
8243
|
function trimChars(value, chars) {
|
|
7789
|
-
return value
|
|
8244
|
+
return trimBy(value, RegExp(`[${chars}]`));
|
|
7790
8245
|
}
|
|
7791
8246
|
/**
|
|
7792
8247
|
* Trim only invisible chars
|
|
7793
8248
|
*/ function trimInv(value) {
|
|
7794
|
-
return value
|
|
8249
|
+
return trimBy(value, INVISIBLE);
|
|
8250
|
+
}
|
|
8251
|
+
/**
|
|
8252
|
+
* Without the invisible chars at the end
|
|
8253
|
+
*/ function trimInvEnd(value) {
|
|
8254
|
+
let end = value.length;
|
|
8255
|
+
while(end > 0 && INVISIBLE.test(value.charAt(end - 1))){
|
|
8256
|
+
end -= 1;
|
|
8257
|
+
}
|
|
8258
|
+
return end === value.length ? value : value.slice(0, end);
|
|
7795
8259
|
}
|
|
7796
8260
|
|
|
7797
8261
|
|
|
@@ -11151,18 +11615,19 @@ function usable(ranges, shadowRoot) {
|
|
|
11151
11615
|
|
|
11152
11616
|
"use strict";
|
|
11153
11617
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11154
|
-
/* harmony export */ composedRanges: function() { return /* reexport safe */
|
|
11618
|
+
/* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_3__.composedRanges; },
|
|
11155
11619
|
/* harmony export */ cursorInTheEdgeOfString: function() { return /* binding */ cursorInTheEdgeOfString; },
|
|
11156
11620
|
/* harmony export */ findCorrectCurrentNode: function() { return /* binding */ findCorrectCurrentNode; },
|
|
11157
|
-
/* harmony export */ isMoved: function() { return /* reexport safe */
|
|
11158
|
-
/* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */
|
|
11621
|
+
/* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_4__.isMoved; },
|
|
11622
|
+
/* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_5__.moveNodeInsideStart; }
|
|
11159
11623
|
/* harmony export */ });
|
|
11160
11624
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
11161
11625
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
11162
|
-
/* harmony import */ var
|
|
11163
|
-
/* harmony import */ var
|
|
11164
|
-
/* harmony import */ var
|
|
11165
|
-
/* harmony import */ var
|
|
11626
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
|
|
11627
|
+
/* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43134);
|
|
11628
|
+
/* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90657);
|
|
11629
|
+
/* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89817);
|
|
11630
|
+
/* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7470);
|
|
11166
11631
|
/*!
|
|
11167
11632
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
11168
11633
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -11175,6 +11640,7 @@ function usable(ranges, shadowRoot) {
|
|
|
11175
11640
|
|
|
11176
11641
|
|
|
11177
11642
|
|
|
11643
|
+
|
|
11178
11644
|
/**
|
|
11179
11645
|
* Despite the name, returns `true` when the cursor is NOT at the checked edge
|
|
11180
11646
|
* of the text node: there is significant (non invisible-space) text between
|
|
@@ -11182,7 +11648,7 @@ function usable(ranges, shadowRoot) {
|
|
|
11182
11648
|
* @private
|
|
11183
11649
|
*/ function cursorInTheEdgeOfString(container, offset, start, end) {
|
|
11184
11650
|
const text = container.nodeValue?.length ? container.nodeValue : '';
|
|
11185
|
-
if (end &&
|
|
11651
|
+
if (end && (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trimInvEnd)(text).length > offset) {
|
|
11186
11652
|
return true;
|
|
11187
11653
|
}
|
|
11188
11654
|
const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
|
|
@@ -18419,11 +18885,12 @@ View.defaultOptions = {
|
|
|
18419
18885
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
18420
18886
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
18421
18887
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
18422
|
-
/* harmony import */ var
|
|
18423
|
-
/* harmony import */ var
|
|
18424
|
-
/* harmony import */ var
|
|
18425
|
-
/* harmony import */ var
|
|
18426
|
-
/* harmony import */ var
|
|
18888
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
|
|
18889
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
|
|
18890
|
+
/* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73714);
|
|
18891
|
+
/* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80512);
|
|
18892
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5266);
|
|
18893
|
+
/* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60936);
|
|
18427
18894
|
/*!
|
|
18428
18895
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
18429
18896
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -18444,6 +18911,7 @@ View.defaultOptions = {
|
|
|
18444
18911
|
|
|
18445
18912
|
|
|
18446
18913
|
|
|
18914
|
+
|
|
18447
18915
|
const FOCUS_EVENTS = new Set([
|
|
18448
18916
|
'focus',
|
|
18449
18917
|
'blur',
|
|
@@ -18473,7 +18941,7 @@ const NOEDIT = {
|
|
|
18473
18941
|
* The editor's options, with the deprecated `imageAlignClasses` copied into
|
|
18474
18942
|
* `alignClasses.img` when that isn't set
|
|
18475
18943
|
*/ function makeOptions(options) {
|
|
18476
|
-
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {},
|
|
18944
|
+
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions);
|
|
18477
18945
|
if (opt.imageAlignClasses && !opt.alignClasses?.img) {
|
|
18478
18946
|
opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)({
|
|
18479
18947
|
img: opt.imageAlignClasses
|
|
@@ -18481,7 +18949,7 @@ const NOEDIT = {
|
|
|
18481
18949
|
}
|
|
18482
18950
|
return opt;
|
|
18483
18951
|
}
|
|
18484
|
-
class Jodit extends
|
|
18952
|
+
class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar {
|
|
18485
18953
|
/** @override */ className() {
|
|
18486
18954
|
return 'Jodit';
|
|
18487
18955
|
}
|
|
@@ -18524,7 +18992,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18524
18992
|
* Return a default timeout period in milliseconds for some debounce or throttle functions.
|
|
18525
18993
|
* By default, `{history.timeout}` options
|
|
18526
18994
|
*/ get defaultTimeout() {
|
|
18527
|
-
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout :
|
|
18995
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout : jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions.defaultTimeout;
|
|
18528
18996
|
}
|
|
18529
18997
|
/**
|
|
18530
18998
|
* Method wrap usual object in Object helper for prevent deep object merging in options*
|
|
@@ -18554,7 +19022,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18554
19022
|
/**
|
|
18555
19023
|
* Default settings
|
|
18556
19024
|
*/ static get defaultOptions() {
|
|
18557
|
-
return
|
|
19025
|
+
return jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions;
|
|
18558
19026
|
}
|
|
18559
19027
|
/**
|
|
18560
19028
|
* Deep-merges partial options into the global defaults without replacing
|
|
@@ -18602,7 +19070,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18602
19070
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigMerge)(Jodit.defaultOptions, options);
|
|
18603
19071
|
}
|
|
18604
19072
|
get createInside() {
|
|
18605
|
-
return new
|
|
19073
|
+
return new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Create(()=>this.ed, this.o.createAttributes);
|
|
18606
19074
|
}
|
|
18607
19075
|
__setPlaceField(field, value) {
|
|
18608
19076
|
if (!this.currentPlace) {
|
|
@@ -18802,7 +19270,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18802
19270
|
}
|
|
18803
19271
|
value = this.getNativeEditorValue().replace(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INVISIBLE_SPACE_REG_EXP(), '');
|
|
18804
19272
|
if (removeSelectionMarkers) {
|
|
18805
|
-
value =
|
|
19273
|
+
value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags)(value, 'span', 'id="jodit-selection_marker_');
|
|
18806
19274
|
}
|
|
18807
19275
|
if (value === '<br>') {
|
|
18808
19276
|
value = '';
|
|
@@ -19116,7 +19584,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19116
19584
|
return this.getMode();
|
|
19117
19585
|
}
|
|
19118
19586
|
const active = this.od.activeElement;
|
|
19119
|
-
if (active && (active === this.iframe ||
|
|
19587
|
+
if (active && (active === this.iframe || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(this.editor, active) || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(this.toolbar.container, active))) {
|
|
19120
19588
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_WYSIWYG;
|
|
19121
19589
|
}
|
|
19122
19590
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE;
|
|
@@ -19269,7 +19737,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19269
19737
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(element.attributes).forEach((attr)=>{
|
|
19270
19738
|
const name = attr.name;
|
|
19271
19739
|
let value = attr.value;
|
|
19272
|
-
if (
|
|
19740
|
+
if (jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
|
|
19273
19741
|
if ([
|
|
19274
19742
|
'readonly',
|
|
19275
19743
|
'disabled'
|
|
@@ -19306,7 +19774,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19306
19774
|
container = element;
|
|
19307
19775
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultClassesKey, element.className.toString());
|
|
19308
19776
|
buffer = container.innerHTML;
|
|
19309
|
-
|
|
19777
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.detach(container);
|
|
19310
19778
|
}
|
|
19311
19779
|
container.classList.add('jodit_inline');
|
|
19312
19780
|
container.classList.add('jodit-container');
|
|
@@ -19314,7 +19782,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19314
19782
|
// actual for inline mode
|
|
19315
19783
|
if (element !== container) {
|
|
19316
19784
|
// hide source element
|
|
19317
|
-
const display = (0,
|
|
19785
|
+
const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display');
|
|
19318
19786
|
if (display) {
|
|
19319
19787
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultStyleDisplayKey, display);
|
|
19320
19788
|
}
|
|
@@ -19326,21 +19794,21 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19326
19794
|
// the toolbar box below it when (re)attaching the toolbar container.
|
|
19327
19795
|
const aboveSlot = this.c.div(this.getFullElName(SLOT, 'above'), NOEDIT);
|
|
19328
19796
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(aboveSlot, 'data-jodit-above-toolbar', '');
|
|
19329
|
-
|
|
19797
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.appendChildFirst(container, aboveSlot);
|
|
19330
19798
|
const topSlot = this.c.div(this.getFullElName(SLOT, 'top'), NOEDIT);
|
|
19331
|
-
|
|
19799
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, topSlot);
|
|
19332
19800
|
const centerSlot = this.c.div(this.getFullElName(SLOT, 'center'), NOEDIT);
|
|
19333
19801
|
const workplace = this.c.div('jodit-workplace', NOEDIT);
|
|
19334
19802
|
const leftSlot = this.c.div(this.getFullElName(SLOT, 'left'), NOEDIT);
|
|
19335
19803
|
const rightSlot = this.c.div(this.getFullElName(SLOT, 'right'), NOEDIT);
|
|
19336
|
-
|
|
19337
|
-
|
|
19338
|
-
|
|
19339
|
-
|
|
19804
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, leftSlot);
|
|
19805
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, workplace);
|
|
19806
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, rightSlot);
|
|
19807
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, centerSlot);
|
|
19340
19808
|
const bottomPanel = this.c.div(this.getFullElName(SLOT, 'bottom'), NOEDIT);
|
|
19341
|
-
|
|
19809
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, bottomPanel);
|
|
19342
19810
|
if (element.parentNode && element !== container) {
|
|
19343
|
-
|
|
19811
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.before(element, container);
|
|
19344
19812
|
}
|
|
19345
19813
|
Object.defineProperty(element, 'component', {
|
|
19346
19814
|
enumerable: false,
|
|
@@ -19352,7 +19820,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19352
19820
|
'aria-disabled': false,
|
|
19353
19821
|
tabindex: this.o.tabIndex
|
|
19354
19822
|
});
|
|
19355
|
-
|
|
19823
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(workplace, editor);
|
|
19356
19824
|
const currentPlace = {
|
|
19357
19825
|
editor,
|
|
19358
19826
|
element,
|
|
@@ -19366,9 +19834,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19366
19834
|
left: leftSlot,
|
|
19367
19835
|
right: rightSlot
|
|
19368
19836
|
},
|
|
19369
|
-
statusbar: new
|
|
19837
|
+
statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.StatusBar(this, container),
|
|
19370
19838
|
options: this.isReady ? makeOptions(options) : this.options,
|
|
19371
|
-
history: new
|
|
19839
|
+
history: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.History(this),
|
|
19372
19840
|
editorWindow: this.ow
|
|
19373
19841
|
};
|
|
19374
19842
|
this.__elementToPlace.set(editor, currentPlace);
|
|
@@ -19400,7 +19868,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19400
19868
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(initResult, init);
|
|
19401
19869
|
}
|
|
19402
19870
|
addDisclaimer(elm) {
|
|
19403
|
-
|
|
19871
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(this.workplace, elm);
|
|
19404
19872
|
}
|
|
19405
19873
|
/**
|
|
19406
19874
|
* Set current place object
|
|
@@ -19463,7 +19931,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19463
19931
|
return;
|
|
19464
19932
|
}
|
|
19465
19933
|
if (stayDefault === false || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isPromise)(stayDefault)) {
|
|
19466
|
-
|
|
19934
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(defaultEditorArea);
|
|
19467
19935
|
}
|
|
19468
19936
|
addClassNames(this.o.editorClassName, this.editor);
|
|
19469
19937
|
if (this.o.style) {
|
|
@@ -19512,7 +19980,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19512
19980
|
// and such an element stays in the editor
|
|
19513
19981
|
if (FOCUS_EVENTS.has(type)) {
|
|
19514
19982
|
const inner = type === 'focusin' || type === 'focusout';
|
|
19515
|
-
if (inner === (event.target === editor) ||
|
|
19983
|
+
if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(editor, event.relatedTarget)) {
|
|
19516
19984
|
return;
|
|
19517
19985
|
}
|
|
19518
19986
|
if (inner) {
|
|
@@ -19549,7 +20017,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19549
20017
|
});
|
|
19550
20018
|
}
|
|
19551
20019
|
fetch(url, options) {
|
|
19552
|
-
const ajax = new
|
|
20020
|
+
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_8__.Ajax({
|
|
19553
20021
|
url,
|
|
19554
20022
|
...options
|
|
19555
20023
|
}, this.o.defaultAjaxOptions);
|
|
@@ -19570,7 +20038,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19570
20038
|
if (this.isInDestruct) {
|
|
19571
20039
|
return;
|
|
19572
20040
|
}
|
|
19573
|
-
this.setStatus(
|
|
20041
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeDestruct);
|
|
19574
20042
|
this.__elementToPlace.clear();
|
|
19575
20043
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'storage')?.clear();
|
|
19576
20044
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'buffer')?.clear();
|
|
@@ -19608,17 +20076,17 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19608
20076
|
this.e.off(container);
|
|
19609
20077
|
this.e.off(element);
|
|
19610
20078
|
this.e.off(editor);
|
|
19611
|
-
|
|
19612
|
-
|
|
20079
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(workplace);
|
|
20080
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(editor);
|
|
19613
20081
|
if (container !== element) {
|
|
19614
|
-
|
|
20082
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(container);
|
|
19615
20083
|
}
|
|
19616
20084
|
Object.defineProperty(element, 'component', {
|
|
19617
20085
|
enumerable: false,
|
|
19618
20086
|
configurable: true,
|
|
19619
20087
|
value: null
|
|
19620
20088
|
});
|
|
19621
|
-
|
|
20089
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(iframe);
|
|
19622
20090
|
// inline mode
|
|
19623
20091
|
if (container === element) {
|
|
19624
20092
|
element.innerHTML = tmpValue;
|
|
@@ -19663,7 +20131,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19663
20131
|
this.destruct();
|
|
19664
20132
|
throw e;
|
|
19665
20133
|
}
|
|
19666
|
-
this.setStatus(
|
|
20134
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeInit);
|
|
19667
20135
|
this.id = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.resolveElement)(element, this.o.shadowRoot || this.od), 'id') || new Date().getTime().toString();
|
|
19668
20136
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances[this.id] = this;
|
|
19669
20137
|
this.attachEvents(options);
|
|
@@ -19673,7 +20141,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19673
20141
|
}
|
|
19674
20142
|
});
|
|
19675
20143
|
this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
|
|
19676
|
-
this.selection = new
|
|
20144
|
+
this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Selection(this);
|
|
19677
20145
|
const beforeInitHookResult = this.beforeInitHook();
|
|
19678
20146
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(beforeInitHookResult, ()=>{
|
|
19679
20147
|
if (this.isInDestruct) {
|
|
@@ -19697,7 +20165,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19697
20165
|
this.e.fire('afterInit', this);
|
|
19698
20166
|
}
|
|
19699
20167
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(this.afterInitHook());
|
|
19700
|
-
this.setStatus(
|
|
20168
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.ready);
|
|
19701
20169
|
this.e.fire('afterConstructor', this);
|
|
19702
20170
|
};
|
|
19703
20171
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(addPlaceResult, init);
|
|
@@ -19713,7 +20181,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19713
20181
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances);
|
|
19714
20182
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.lang);
|
|
19715
20183
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
|
|
19716
|
-
Plugin:
|
|
20184
|
+
Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin
|
|
19717
20185
|
});
|
|
19718
20186
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
19719
20187
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cache
|
|
@@ -19740,7 +20208,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19740
20208
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
19741
20209
|
], Jodit.prototype, "__prepareWYSIWYGEditor", null);
|
|
19742
20210
|
Jodit = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
19743
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(
|
|
20211
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__.Dlgs)
|
|
19744
20212
|
], Jodit);
|
|
19745
20213
|
function addClassNames(className, elm) {
|
|
19746
20214
|
if (className) {
|
|
@@ -32381,7 +32849,18 @@ const KEEPS_SPACES = new Set([
|
|
|
32381
32849
|
/**
|
|
32382
32850
|
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
32383
32851
|
* line break, a block or text starting (or ending) with a plain space
|
|
32384
|
-
*/
|
|
32852
|
+
*/ // The run of spaces at the end (or the start) of the text becomes nbsp; counted, as `/ +$/` backtracks on a long run
|
|
32853
|
+
function replaceEdgeSpaces(text, atEnd) {
|
|
32854
|
+
let count = 0;
|
|
32855
|
+
while(count < text.length && text.charAt(atEnd ? text.length - 1 - count : count) === ' '){
|
|
32856
|
+
count += 1;
|
|
32857
|
+
}
|
|
32858
|
+
if (count === 0) {
|
|
32859
|
+
return text;
|
|
32860
|
+
}
|
|
32861
|
+
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);
|
|
32862
|
+
}
|
|
32863
|
+
function hidesSpace(neighbor, edge) {
|
|
32385
32864
|
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 ?? '');
|
|
32386
32865
|
}
|
|
32387
32866
|
class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
@@ -32564,10 +33043,10 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
32564
33043
|
const before = this.__findNeighbor(fake, true, block);
|
|
32565
33044
|
const after = this.__findNeighbor(fake, false, block);
|
|
32566
33045
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) && hidesSpace(after, /^ /)) {
|
|
32567
|
-
before.nodeValue = before.nodeValue
|
|
33046
|
+
before.nodeValue = replaceEdgeSpaces(before.nodeValue, true);
|
|
32568
33047
|
}
|
|
32569
33048
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(after) && hidesSpace(before, / $/)) {
|
|
32570
|
-
after.nodeValue = after.nodeValue
|
|
33049
|
+
after.nodeValue = replaceEdgeSpaces(after.nodeValue, false);
|
|
32571
33050
|
}
|
|
32572
33051
|
}
|
|
32573
33052
|
/**
|
|
@@ -35599,7 +36078,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
35599
36078
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
35600
36079
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
35601
36080
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
|
|
35602
|
-
/* harmony import */ var
|
|
36081
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
36082
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17326);
|
|
35603
36083
|
/*!
|
|
35604
36084
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35605
36085
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35614,6 +36094,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
35614
36094
|
|
|
35615
36095
|
|
|
35616
36096
|
|
|
36097
|
+
|
|
35617
36098
|
/**
|
|
35618
36099
|
* Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
|
|
35619
36100
|
* in backend of you system
|
|
@@ -35672,13 +36153,66 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
35672
36153
|
const toggleEditable = ()=>{
|
|
35673
36154
|
(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);
|
|
35674
36155
|
};
|
|
36156
|
+
// The start of the whitespace run that ends at `to`
|
|
36157
|
+
const skipBack = (text, to)=>{
|
|
36158
|
+
while(to > 0 && /\s/.test(text.charAt(to - 1))){
|
|
36159
|
+
to -= 1;
|
|
36160
|
+
}
|
|
36161
|
+
return to;
|
|
36162
|
+
};
|
|
36163
|
+
// The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
|
|
36164
|
+
const cleanBodyTag = (tag)=>{
|
|
36165
|
+
tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
|
|
36166
|
+
const skip = (from, chars)=>{
|
|
36167
|
+
while(chars.test(tag.charAt(from))){
|
|
36168
|
+
from += 1;
|
|
36169
|
+
}
|
|
36170
|
+
return from;
|
|
36171
|
+
};
|
|
36172
|
+
let index = tag.indexOf('contenteditable');
|
|
36173
|
+
while(index !== -1){
|
|
36174
|
+
let to = skip(index + 'contenteditable'.length, /["'\s]/);
|
|
36175
|
+
if (tag.charAt(to) === '=') {
|
|
36176
|
+
to = skip(to + 1, /[\s"']/);
|
|
36177
|
+
if (tag.startsWith('true', to)) {
|
|
36178
|
+
to = skip(to + 4, /["']/);
|
|
36179
|
+
let from = index;
|
|
36180
|
+
if (/["']/.test(tag.charAt(from - 1))) {
|
|
36181
|
+
from -= 1;
|
|
36182
|
+
}
|
|
36183
|
+
from = skipBack(tag, from);
|
|
36184
|
+
return tag.slice(0, from) + tag.slice(to);
|
|
36185
|
+
}
|
|
36186
|
+
}
|
|
36187
|
+
index = tag.indexOf('contenteditable', index + 1);
|
|
36188
|
+
}
|
|
36189
|
+
return tag;
|
|
36190
|
+
};
|
|
35675
36191
|
const clearMarkers = (html)=>{
|
|
35676
36192
|
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
35677
|
-
html =
|
|
35678
|
-
const
|
|
35679
|
-
|
|
35680
|
-
|
|
35681
|
-
|
|
36193
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(html, '<style', '>', '</style>', 'jodit-box');
|
|
36194
|
+
const bodyStart = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag)(html, 'body');
|
|
36195
|
+
let bodyEnd = -1;
|
|
36196
|
+
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)){
|
|
36197
|
+
bodyEnd = index;
|
|
36198
|
+
}
|
|
36199
|
+
if (bodyStart !== -1 && bodyEnd !== -1) {
|
|
36200
|
+
const afterBody = bodyEnd + '</body>'.length;
|
|
36201
|
+
const gt = html.indexOf('>', bodyStart);
|
|
36202
|
+
let body = html.slice(bodyStart, afterBody);
|
|
36203
|
+
if (gt !== -1 && gt < bodyEnd) {
|
|
36204
|
+
body = cleanBodyTag(html.slice(bodyStart, gt)) + html.slice(gt, afterBody);
|
|
36205
|
+
}
|
|
36206
|
+
for (const tag of [
|
|
36207
|
+
'style',
|
|
36208
|
+
'script',
|
|
36209
|
+
'span'
|
|
36210
|
+
]){
|
|
36211
|
+
body = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
|
|
36212
|
+
}
|
|
36213
|
+
// remove markers: the spans outside the body are the editor's own
|
|
36214
|
+
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>');
|
|
36215
|
+
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');
|
|
35682
36216
|
}
|
|
35683
36217
|
return html;
|
|
35684
36218
|
};
|
|
@@ -41179,9 +41713,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41179
41713
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
41180
41714
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
41181
41715
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
41182
|
-
/* harmony import */ var
|
|
41183
|
-
/* harmony import */ var
|
|
41184
|
-
/* harmony import */ var
|
|
41716
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
|
|
41717
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
|
|
41718
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
41719
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
|
|
41185
41720
|
/*!
|
|
41186
41721
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
41187
41722
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -41196,16 +41731,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41196
41731
|
|
|
41197
41732
|
|
|
41198
41733
|
|
|
41734
|
+
|
|
41199
41735
|
/**
|
|
41200
41736
|
* Process `video` and `audio`
|
|
41201
41737
|
*/ function media(editor) {
|
|
41202
41738
|
const keyFake = 'jodit_fake_wrapper';
|
|
41203
41739
|
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
41204
41740
|
const wrap = (element)=>{
|
|
41205
|
-
if (element.parentNode && (0,
|
|
41741
|
+
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
41206
41742
|
element = element.parentNode;
|
|
41207
41743
|
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
41208
|
-
element = (0,
|
|
41744
|
+
element = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, element) ?? (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.wrapMedia)(editor, element);
|
|
41209
41745
|
} else if (mediaInFakeBlock) {
|
|
41210
41746
|
const media = element;
|
|
41211
41747
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
@@ -41214,13 +41750,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41214
41750
|
draggable: true,
|
|
41215
41751
|
[`data-${keyFake}`]: 1
|
|
41216
41752
|
});
|
|
41217
|
-
(0,
|
|
41753
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
|
|
41218
41754
|
// The wrapper fits the media, whose size changes as its metadata loads
|
|
41219
41755
|
// and as it's resized. A percentage width is of the line, so it takes that
|
|
41220
41756
|
const fit = ()=>{
|
|
41221
|
-
(0,
|
|
41222
|
-
display: (0,
|
|
41223
|
-
width: (0,
|
|
41757
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
|
|
41758
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
|
|
41759
|
+
width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
|
|
41224
41760
|
height: ''
|
|
41225
41761
|
});
|
|
41226
41762
|
};
|
|
@@ -41257,15 +41793,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41257
41793
|
}
|
|
41258
41794
|
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
41259
41795
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
41260
|
-
|
|
41261
|
-
if (rxp.test(data.value)) {
|
|
41262
|
-
data.value = data.value.replace(rxp, '$1');
|
|
41263
|
-
}
|
|
41796
|
+
data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.unwrapMarkedTags)(data.value, mediaFakeTag, `data-${keyFake}`);
|
|
41264
41797
|
}).on('change afterInit afterSetMode changePlace', editor.async.debounce(()=>{
|
|
41265
41798
|
if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE) {
|
|
41266
|
-
(0,
|
|
41267
|
-
if (!(0,
|
|
41268
|
-
(0,
|
|
41799
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
|
|
41800
|
+
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
|
|
41801
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
|
|
41269
41802
|
wrap(elm);
|
|
41270
41803
|
}
|
|
41271
41804
|
});
|
|
@@ -42246,7 +42779,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42246
42779
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
42247
42780
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
42248
42781
|
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
|
|
42249
|
-
/* harmony import */ var
|
|
42782
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
42783
|
+
/* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
|
|
42250
42784
|
/*!
|
|
42251
42785
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
42252
42786
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -42258,11 +42792,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42258
42792
|
|
|
42259
42793
|
|
|
42260
42794
|
|
|
42795
|
+
|
|
42261
42796
|
/**
|
|
42262
42797
|
* Remove special HTML comments
|
|
42263
42798
|
* @private
|
|
42264
42799
|
*/ function removeExtraFragments(html) {
|
|
42265
|
-
html =
|
|
42800
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix)(html, [
|
|
42801
|
+
'<meta'
|
|
42802
|
+
]);
|
|
42266
42803
|
const start = html.search(/<!--StartFragment-->/i);
|
|
42267
42804
|
if (start !== -1) {
|
|
42268
42805
|
html = html.substring(start + 20);
|
|
@@ -42280,7 +42817,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42280
42817
|
* paste bold
|
|
42281
42818
|
* @private
|
|
42282
42819
|
*/ function removeGoogleDocsWrapper(html) {
|
|
42283
|
-
|
|
42820
|
+
// A plain search: the wrapper check is left to the parsed document below
|
|
42821
|
+
if (!/docs-internal-guid-/i.test(html)) {
|
|
42284
42822
|
return html;
|
|
42285
42823
|
}
|
|
42286
42824
|
// An inert document: images don't load and handlers don't run
|
|
@@ -42335,7 +42873,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42335
42873
|
return;
|
|
42336
42874
|
}
|
|
42337
42875
|
const dialog = jodit.confirm(`<div style="word-break: normal; white-space: normal">${jodit.i18n(msg)}</div>`, jodit.i18n(title));
|
|
42338
|
-
const buttons = buttonList.map(({ text, value })=>(0,
|
|
42876
|
+
const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
42339
42877
|
text,
|
|
42340
42878
|
name: text.toLowerCase(),
|
|
42341
42879
|
tabIndex: 0
|
|
@@ -42351,7 +42889,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42351
42889
|
}
|
|
42352
42890
|
jodit.e.fire('afterClosePasteDialog', dialog);
|
|
42353
42891
|
});
|
|
42354
|
-
const cancel = (0,
|
|
42892
|
+
const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
42355
42893
|
text: 'Cancel',
|
|
42356
42894
|
tabIndex: 0
|
|
42357
42895
|
}).onAction(()=>{
|
|
@@ -43859,12 +44397,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
43859
44397
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
43860
44398
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
43861
44399
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
|
|
43862
|
-
/* harmony import */ var
|
|
43863
|
-
/* harmony import */ var
|
|
43864
|
-
/* harmony import */ var
|
|
43865
|
-
/* harmony import */ var
|
|
43866
|
-
/* harmony import */ var
|
|
43867
|
-
/* harmony import */ var
|
|
44400
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
|
|
44401
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
44402
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
|
|
44403
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42259);
|
|
44404
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
|
|
44405
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(56490);
|
|
44406
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(96608);
|
|
43868
44407
|
/*!
|
|
43869
44408
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
43870
44409
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -43888,6 +44427,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
43888
44427
|
|
|
43889
44428
|
|
|
43890
44429
|
|
|
44430
|
+
|
|
43891
44431
|
const keyBInd = '__jodit-resizer_binded';
|
|
43892
44432
|
/**
|
|
43893
44433
|
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
@@ -43904,7 +44444,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
43904
44444
|
* A video with no height of its own takes it from its width and its ratio,
|
|
43905
44445
|
* so resizing it keeps the ratio without setting a height.
|
|
43906
44446
|
*/ function heightFollowsWidth(element) {
|
|
43907
|
-
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,
|
|
44447
|
+
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');
|
|
43908
44448
|
}
|
|
43909
44449
|
const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
43910
44450
|
/**
|
|
@@ -43914,7 +44454,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
43914
44454
|
*/ 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}`;
|
|
43915
44455
|
/**
|
|
43916
44456
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
43917
|
-
*/ class resizer extends
|
|
44457
|
+
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
|
|
43918
44458
|
/** @override */ afterInit(editor) {
|
|
43919
44459
|
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
43920
44460
|
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
|
|
@@ -43931,10 +44471,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
43931
44471
|
.on('keydown', this.onEditorKeyDown, {
|
|
43932
44472
|
top: true
|
|
43933
44473
|
}).on('afterGetValueFromEditor.resizer', (data)=>{
|
|
43934
|
-
|
|
43935
|
-
if (rgx.test(data.value)) {
|
|
43936
|
-
data.value = data.value.replace(rgx, '$1');
|
|
43937
|
-
}
|
|
44474
|
+
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));
|
|
43938
44475
|
});
|
|
43939
44476
|
this.addEventListeners();
|
|
43940
44477
|
this.__onChangeEditor();
|
|
@@ -43970,7 +44507,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
43970
44507
|
return;
|
|
43971
44508
|
}
|
|
43972
44509
|
const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width');
|
|
43973
|
-
if (width && !(0,
|
|
44510
|
+
if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(image, 'width')) {
|
|
43974
44511
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
|
|
43975
44512
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width', null);
|
|
43976
44513
|
}
|
|
@@ -44094,7 +44631,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44094
44631
|
__followCaret() {
|
|
44095
44632
|
const before = this.__keyDownRange;
|
|
44096
44633
|
this.__keyDownRange = null;
|
|
44097
|
-
if (!(0,
|
|
44634
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__.isMoved)(this.j, before)) {
|
|
44098
44635
|
return;
|
|
44099
44636
|
}
|
|
44100
44637
|
if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
|
|
@@ -44129,7 +44666,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44129
44666
|
if (!this.isResizeMode) {
|
|
44130
44667
|
// A click in the element's popup, or in a list it opens, works on
|
|
44131
44668
|
// the element, so it keeps its frame
|
|
44132
|
-
if (e?.target &&
|
|
44669
|
+
if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__.Popup)) {
|
|
44133
44670
|
return;
|
|
44134
44671
|
}
|
|
44135
44672
|
return this.hide();
|
|
@@ -44153,7 +44690,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44153
44690
|
if (changeAttrs) {
|
|
44154
44691
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
|
|
44155
44692
|
}
|
|
44156
|
-
if (!changeAttrs || (0,
|
|
44693
|
+
if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, key)) {
|
|
44157
44694
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
|
|
44158
44695
|
}
|
|
44159
44696
|
}
|
|
@@ -44218,7 +44755,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44218
44755
|
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
44219
44756
|
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
44220
44757
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
44221
|
-
display: (0,
|
|
44758
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
|
|
44222
44759
|
});
|
|
44223
44760
|
if (width) {
|
|
44224
44761
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
@@ -44336,7 +44873,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44336
44873
|
}
|
|
44337
44874
|
if (this.element && this.rect) {
|
|
44338
44875
|
const workplacePosition = this.getWorkplacePosition();
|
|
44339
|
-
const pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.offset)(this.element, this.j, this.j.ed), left = parseInt((0,
|
|
44876
|
+
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;
|
|
44340
44877
|
const newTop = pos.top - workplacePosition.top, newLeft = pos.left - workplacePosition.left;
|
|
44341
44878
|
if (top !== newTop || left !== newLeft || w !== this.element.offsetWidth || h !== this.element.offsetHeight) {
|
|
44342
44879
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, {
|