jodit 4.19.10 → 4.19.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +150 -131
- package/es2015/jodit.css +33 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +10 -10
- package/es2015/jodit.js +781 -195
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +10 -10
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +10 -10
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +10 -10
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +33 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +15 -15
- package/es2021/jodit.js +780 -193
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +15 -15
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +33 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +22 -22
- package/es2021.en/jodit.js +780 -193
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +22 -22
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +34 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +827 -200
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.js +2 -2
- package/esm/core/helpers/checker/is-html-from-word.d.ts +4 -3
- package/esm/core/helpers/checker/is-html-from-word.js +94 -14
- package/esm/core/helpers/checker/is-html.d.ts +4 -0
- package/esm/core/helpers/checker/is-html.js +54 -2
- package/esm/core/helpers/html/apply-styles.js +20 -11
- package/esm/core/helpers/html/clean-from-word.js +2 -3
- package/esm/core/helpers/html/index.d.ts +1 -0
- package/esm/core/helpers/html/index.js +1 -0
- package/esm/core/helpers/html/tag-scan.d.ts +36 -0
- package/esm/core/helpers/html/tag-scan.js +257 -0
- package/esm/core/helpers/string/trim.d.ts +4 -0
- package/esm/core/helpers/string/trim.js +29 -10
- package/esm/core/selection/helpers/index.js +3 -2
- package/esm/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/esm/core/ui/button/tooltip/tooltip.js +14 -3
- package/esm/core/view/view-with-toolbar.js +6 -1
- package/esm/jodit.js +2 -1
- package/esm/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/esm/plugins/add-new-line/add-new-line.js +20 -3
- package/esm/plugins/delete/delete.d.ts +7 -0
- package/esm/plugins/delete/delete.js +38 -2
- package/esm/plugins/hr/hr.js +5 -0
- package/esm/plugins/iframe/iframe.js +59 -12
- package/esm/plugins/media/media.js +10 -9
- package/esm/plugins/paste/helpers.js +4 -2
- package/esm/plugins/resizer/resizer.js +6 -5
- package/esm/plugins/select-cells/select-cells.d.ts +1 -0
- package/esm/plugins/select-cells/select-cells.js +12 -18
- package/package.json +1 -1
- package/types/core/helpers/checker/is-html-from-word.d.ts +4 -3
- package/types/core/helpers/checker/is-html.d.ts +4 -0
- package/types/core/helpers/html/index.d.ts +1 -0
- package/types/core/helpers/html/tag-scan.d.ts +36 -0
- package/types/core/helpers/string/trim.d.ts +4 -0
- package/types/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/types/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/types/plugins/delete/delete.d.ts +7 -0
- package/types/plugins/select-cells/select-cells.d.ts +1 -0
package/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.12
|
|
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.12";
|
|
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);
|
|
@@ -15557,6 +16023,18 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
|
|
|
15557
16023
|
render() {
|
|
15558
16024
|
return '<div><div class="&__content"></div></div>';
|
|
15559
16025
|
}
|
|
16026
|
+
get __isEnabled() {
|
|
16027
|
+
const { o } = this.j;
|
|
16028
|
+
return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
|
|
16029
|
+
}
|
|
16030
|
+
/**
|
|
16031
|
+
* Show tooltips for the buttons in an element outside the editor's
|
|
16032
|
+
* container, such as a toolbar placed by the `toolbar` option
|
|
16033
|
+
*/ attach(container) {
|
|
16034
|
+
if (this.__isEnabled) {
|
|
16035
|
+
this.__onAttach(container);
|
|
16036
|
+
}
|
|
16037
|
+
}
|
|
15560
16038
|
__onAttach(container) {
|
|
15561
16039
|
// TODO Move it inside __show method. Now it is here because testcase failed with capturing
|
|
15562
16040
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(this.j, UITooltip), this.container);
|
|
@@ -15691,7 +16169,7 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
|
|
|
15691
16169
|
}
|
|
15692
16170
|
constructor(view){
|
|
15693
16171
|
super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isOpened", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__attachedContainers", new Set()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__listenClose", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__currentTarget", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__delayShowTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hideTimeout", 0);
|
|
15694
|
-
if (
|
|
16172
|
+
if (this.__isEnabled) {
|
|
15695
16173
|
this.j.e.on('getContainer', (box)=>{
|
|
15696
16174
|
this.__onAttach(box);
|
|
15697
16175
|
});
|
|
@@ -18010,7 +18488,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
|
|
|
18010
18488
|
return;
|
|
18011
18489
|
}
|
|
18012
18490
|
const buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__.splitArray)(this.o.buttons) : [];
|
|
18013
|
-
|
|
18491
|
+
const container = this.toolbarContainer;
|
|
18492
|
+
this.toolbar?.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(container);
|
|
18493
|
+
// The toolbar's own element, as editors can share the one it is placed in
|
|
18494
|
+
if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isOrContains(this.container, container)) {
|
|
18495
|
+
this.__tooltip.attach(this.toolbar.container);
|
|
18496
|
+
}
|
|
18014
18497
|
}
|
|
18015
18498
|
getRegisteredButtonGroups() {
|
|
18016
18499
|
return this.groupToButtons;
|
|
@@ -18419,11 +18902,12 @@ View.defaultOptions = {
|
|
|
18419
18902
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
18420
18903
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
18421
18904
|
/* 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
|
|
18905
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81910);
|
|
18906
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
|
|
18907
|
+
/* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73714);
|
|
18908
|
+
/* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80512);
|
|
18909
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5266);
|
|
18910
|
+
/* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60936);
|
|
18427
18911
|
/*!
|
|
18428
18912
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
18429
18913
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -18444,6 +18928,7 @@ View.defaultOptions = {
|
|
|
18444
18928
|
|
|
18445
18929
|
|
|
18446
18930
|
|
|
18931
|
+
|
|
18447
18932
|
const FOCUS_EVENTS = new Set([
|
|
18448
18933
|
'focus',
|
|
18449
18934
|
'blur',
|
|
@@ -18473,7 +18958,7 @@ const NOEDIT = {
|
|
|
18473
18958
|
* The editor's options, with the deprecated `imageAlignClasses` copied into
|
|
18474
18959
|
* `alignClasses.img` when that isn't set
|
|
18475
18960
|
*/ function makeOptions(options) {
|
|
18476
|
-
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {},
|
|
18961
|
+
const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions);
|
|
18477
18962
|
if (opt.imageAlignClasses && !opt.alignClasses?.img) {
|
|
18478
18963
|
opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)({
|
|
18479
18964
|
img: opt.imageAlignClasses
|
|
@@ -18481,7 +18966,7 @@ const NOEDIT = {
|
|
|
18481
18966
|
}
|
|
18482
18967
|
return opt;
|
|
18483
18968
|
}
|
|
18484
|
-
class Jodit extends
|
|
18969
|
+
class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar {
|
|
18485
18970
|
/** @override */ className() {
|
|
18486
18971
|
return 'Jodit';
|
|
18487
18972
|
}
|
|
@@ -18524,7 +19009,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18524
19009
|
* Return a default timeout period in milliseconds for some debounce or throttle functions.
|
|
18525
19010
|
* By default, `{history.timeout}` options
|
|
18526
19011
|
*/ get defaultTimeout() {
|
|
18527
|
-
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isNumber)(this.o.defaultTimeout) ? this.o.defaultTimeout :
|
|
19012
|
+
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
19013
|
}
|
|
18529
19014
|
/**
|
|
18530
19015
|
* Method wrap usual object in Object helper for prevent deep object merging in options*
|
|
@@ -18554,7 +19039,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18554
19039
|
/**
|
|
18555
19040
|
* Default settings
|
|
18556
19041
|
*/ static get defaultOptions() {
|
|
18557
|
-
return
|
|
19042
|
+
return jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions;
|
|
18558
19043
|
}
|
|
18559
19044
|
/**
|
|
18560
19045
|
* Deep-merges partial options into the global defaults without replacing
|
|
@@ -18602,7 +19087,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18602
19087
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigMerge)(Jodit.defaultOptions, options);
|
|
18603
19088
|
}
|
|
18604
19089
|
get createInside() {
|
|
18605
|
-
return new
|
|
19090
|
+
return new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Create(()=>this.ed, this.o.createAttributes);
|
|
18606
19091
|
}
|
|
18607
19092
|
__setPlaceField(field, value) {
|
|
18608
19093
|
if (!this.currentPlace) {
|
|
@@ -18802,7 +19287,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
18802
19287
|
}
|
|
18803
19288
|
value = this.getNativeEditorValue().replace(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INVISIBLE_SPACE_REG_EXP(), '');
|
|
18804
19289
|
if (removeSelectionMarkers) {
|
|
18805
|
-
value =
|
|
19290
|
+
value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_6__.removeEmptyMarkedTags)(value, 'span', 'id="jodit-selection_marker_');
|
|
18806
19291
|
}
|
|
18807
19292
|
if (value === '<br>') {
|
|
18808
19293
|
value = '';
|
|
@@ -19116,7 +19601,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19116
19601
|
return this.getMode();
|
|
19117
19602
|
}
|
|
19118
19603
|
const active = this.od.activeElement;
|
|
19119
|
-
if (active && (active === this.iframe ||
|
|
19604
|
+
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
19605
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_WYSIWYG;
|
|
19121
19606
|
}
|
|
19122
19607
|
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE;
|
|
@@ -19269,7 +19754,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19269
19754
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(element.attributes).forEach((attr)=>{
|
|
19270
19755
|
const name = attr.name;
|
|
19271
19756
|
let value = attr.value;
|
|
19272
|
-
if (
|
|
19757
|
+
if (jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.defaultOptions[name] !== undefined && (!options || options[name] === undefined)) {
|
|
19273
19758
|
if ([
|
|
19274
19759
|
'readonly',
|
|
19275
19760
|
'disabled'
|
|
@@ -19306,7 +19791,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19306
19791
|
container = element;
|
|
19307
19792
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultClassesKey, element.className.toString());
|
|
19308
19793
|
buffer = container.innerHTML;
|
|
19309
|
-
|
|
19794
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.detach(container);
|
|
19310
19795
|
}
|
|
19311
19796
|
container.classList.add('jodit_inline');
|
|
19312
19797
|
container.classList.add('jodit-container');
|
|
@@ -19314,7 +19799,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19314
19799
|
// actual for inline mode
|
|
19315
19800
|
if (element !== container) {
|
|
19316
19801
|
// hide source element
|
|
19317
|
-
const display = (0,
|
|
19802
|
+
const display = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display');
|
|
19318
19803
|
if (display) {
|
|
19319
19804
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(element, __defaultStyleDisplayKey, display);
|
|
19320
19805
|
}
|
|
@@ -19326,21 +19811,21 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19326
19811
|
// the toolbar box below it when (re)attaching the toolbar container.
|
|
19327
19812
|
const aboveSlot = this.c.div(this.getFullElName(SLOT, 'above'), NOEDIT);
|
|
19328
19813
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(aboveSlot, 'data-jodit-above-toolbar', '');
|
|
19329
|
-
|
|
19814
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.appendChildFirst(container, aboveSlot);
|
|
19330
19815
|
const topSlot = this.c.div(this.getFullElName(SLOT, 'top'), NOEDIT);
|
|
19331
|
-
|
|
19816
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, topSlot);
|
|
19332
19817
|
const centerSlot = this.c.div(this.getFullElName(SLOT, 'center'), NOEDIT);
|
|
19333
19818
|
const workplace = this.c.div('jodit-workplace', NOEDIT);
|
|
19334
19819
|
const leftSlot = this.c.div(this.getFullElName(SLOT, 'left'), NOEDIT);
|
|
19335
19820
|
const rightSlot = this.c.div(this.getFullElName(SLOT, 'right'), NOEDIT);
|
|
19336
|
-
|
|
19337
|
-
|
|
19338
|
-
|
|
19339
|
-
|
|
19821
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, leftSlot);
|
|
19822
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, workplace);
|
|
19823
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(centerSlot, rightSlot);
|
|
19824
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, centerSlot);
|
|
19340
19825
|
const bottomPanel = this.c.div(this.getFullElName(SLOT, 'bottom'), NOEDIT);
|
|
19341
|
-
|
|
19826
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(container, bottomPanel);
|
|
19342
19827
|
if (element.parentNode && element !== container) {
|
|
19343
|
-
|
|
19828
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.before(element, container);
|
|
19344
19829
|
}
|
|
19345
19830
|
Object.defineProperty(element, 'component', {
|
|
19346
19831
|
enumerable: false,
|
|
@@ -19352,7 +19837,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19352
19837
|
'aria-disabled': false,
|
|
19353
19838
|
tabindex: this.o.tabIndex
|
|
19354
19839
|
});
|
|
19355
|
-
|
|
19840
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(workplace, editor);
|
|
19356
19841
|
const currentPlace = {
|
|
19357
19842
|
editor,
|
|
19358
19843
|
element,
|
|
@@ -19366,9 +19851,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19366
19851
|
left: leftSlot,
|
|
19367
19852
|
right: rightSlot
|
|
19368
19853
|
},
|
|
19369
|
-
statusbar: new
|
|
19854
|
+
statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.StatusBar(this, container),
|
|
19370
19855
|
options: this.isReady ? makeOptions(options) : this.options,
|
|
19371
|
-
history: new
|
|
19856
|
+
history: new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.History(this),
|
|
19372
19857
|
editorWindow: this.ow
|
|
19373
19858
|
};
|
|
19374
19859
|
this.__elementToPlace.set(editor, currentPlace);
|
|
@@ -19400,7 +19885,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19400
19885
|
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(initResult, init);
|
|
19401
19886
|
}
|
|
19402
19887
|
addDisclaimer(elm) {
|
|
19403
|
-
|
|
19888
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(this.workplace, elm);
|
|
19404
19889
|
}
|
|
19405
19890
|
/**
|
|
19406
19891
|
* Set current place object
|
|
@@ -19463,7 +19948,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19463
19948
|
return;
|
|
19464
19949
|
}
|
|
19465
19950
|
if (stayDefault === false || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isPromise)(stayDefault)) {
|
|
19466
|
-
|
|
19951
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(defaultEditorArea);
|
|
19467
19952
|
}
|
|
19468
19953
|
addClassNames(this.o.editorClassName, this.editor);
|
|
19469
19954
|
if (this.o.style) {
|
|
@@ -19512,7 +19997,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19512
19997
|
// and such an element stays in the editor
|
|
19513
19998
|
if (FOCUS_EVENTS.has(type)) {
|
|
19514
19999
|
const inner = type === 'focusin' || type === 'focusout';
|
|
19515
|
-
if (inner === (event.target === editor) ||
|
|
20000
|
+
if (inner === (event.target === editor) || jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(editor, event.relatedTarget)) {
|
|
19516
20001
|
return;
|
|
19517
20002
|
}
|
|
19518
20003
|
if (inner) {
|
|
@@ -19549,7 +20034,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19549
20034
|
});
|
|
19550
20035
|
}
|
|
19551
20036
|
fetch(url, options) {
|
|
19552
|
-
const ajax = new
|
|
20037
|
+
const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_8__.Ajax({
|
|
19553
20038
|
url,
|
|
19554
20039
|
...options
|
|
19555
20040
|
}, this.o.defaultAjaxOptions);
|
|
@@ -19570,7 +20055,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19570
20055
|
if (this.isInDestruct) {
|
|
19571
20056
|
return;
|
|
19572
20057
|
}
|
|
19573
|
-
this.setStatus(
|
|
20058
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeDestruct);
|
|
19574
20059
|
this.__elementToPlace.clear();
|
|
19575
20060
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'storage')?.clear();
|
|
19576
20061
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(this, 'buffer')?.clear();
|
|
@@ -19608,17 +20093,17 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19608
20093
|
this.e.off(container);
|
|
19609
20094
|
this.e.off(element);
|
|
19610
20095
|
this.e.off(editor);
|
|
19611
|
-
|
|
19612
|
-
|
|
20096
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(workplace);
|
|
20097
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(editor);
|
|
19613
20098
|
if (container !== element) {
|
|
19614
|
-
|
|
20099
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(container);
|
|
19615
20100
|
}
|
|
19616
20101
|
Object.defineProperty(element, 'component', {
|
|
19617
20102
|
enumerable: false,
|
|
19618
20103
|
configurable: true,
|
|
19619
20104
|
value: null
|
|
19620
20105
|
});
|
|
19621
|
-
|
|
20106
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(iframe);
|
|
19622
20107
|
// inline mode
|
|
19623
20108
|
if (container === element) {
|
|
19624
20109
|
element.innerHTML = tmpValue;
|
|
@@ -19663,7 +20148,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19663
20148
|
this.destruct();
|
|
19664
20149
|
throw e;
|
|
19665
20150
|
}
|
|
19666
|
-
this.setStatus(
|
|
20151
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.beforeInit);
|
|
19667
20152
|
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
20153
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances[this.id] = this;
|
|
19669
20154
|
this.attachEvents(options);
|
|
@@ -19673,7 +20158,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19673
20158
|
}
|
|
19674
20159
|
});
|
|
19675
20160
|
this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
|
|
19676
|
-
this.selection = new
|
|
20161
|
+
this.selection = new jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Selection(this);
|
|
19677
20162
|
const beforeInitHookResult = this.beforeInitHook();
|
|
19678
20163
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(beforeInitHookResult, ()=>{
|
|
19679
20164
|
if (this.isInDestruct) {
|
|
@@ -19697,7 +20182,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19697
20182
|
this.e.fire('afterInit', this);
|
|
19698
20183
|
}
|
|
19699
20184
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(this.afterInitHook());
|
|
19700
|
-
this.setStatus(
|
|
20185
|
+
this.setStatus(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.STATUSES.ready);
|
|
19701
20186
|
this.e.fire('afterConstructor', this);
|
|
19702
20187
|
};
|
|
19703
20188
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.callPromise)(addPlaceResult, init);
|
|
@@ -19713,7 +20198,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19713
20198
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances);
|
|
19714
20199
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.lang);
|
|
19715
20200
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
|
|
19716
|
-
Plugin:
|
|
20201
|
+
Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin
|
|
19717
20202
|
});
|
|
19718
20203
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
19719
20204
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cache
|
|
@@ -19740,7 +20225,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
|
|
|
19740
20225
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
19741
20226
|
], Jodit.prototype, "__prepareWYSIWYGEditor", null);
|
|
19742
20227
|
Jodit = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
19743
|
-
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(
|
|
20228
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_9__.Dlgs)
|
|
19744
20229
|
], Jodit);
|
|
19745
20230
|
function addClassNames(className, elm) {
|
|
19746
20231
|
if (className) {
|
|
@@ -27946,6 +28431,17 @@ const ns = 'addnewline';
|
|
|
27946
28431
|
editor.editor
|
|
27947
28432
|
], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
|
|
27948
28433
|
}
|
|
28434
|
+
/**
|
|
28435
|
+
* An empty line with a `<br>`, as Enter makes, so it keeps its height
|
|
28436
|
+
* without clean-html's fillEmptyParagraph (#1807)
|
|
28437
|
+
*/ __newLine() {
|
|
28438
|
+
const { j } = this;
|
|
28439
|
+
const line = j.createInside.element(j.o.enter);
|
|
28440
|
+
if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(line, 'br')) {
|
|
28441
|
+
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(line, j.createInside.element('br'));
|
|
28442
|
+
}
|
|
28443
|
+
return line;
|
|
28444
|
+
}
|
|
27949
28445
|
/**
|
|
27950
28446
|
* A paragraph holding only an embed has no place for the caret, so the
|
|
27951
28447
|
* arrow keys can't get past one that ends the content, or before one that
|
|
@@ -27958,6 +28454,11 @@ const ns = 'addnewline';
|
|
|
27958
28454
|
return;
|
|
27959
28455
|
}
|
|
27960
28456
|
const { startContainer, startOffset } = editor.s.range;
|
|
28457
|
+
// A caret in the editor itself, as beside a horizontal line, is in no
|
|
28458
|
+
// paragraph, and the browsers can leave it there with text beyond (#1803)
|
|
28459
|
+
if (startContainer === editor.editor) {
|
|
28460
|
+
return;
|
|
28461
|
+
}
|
|
27961
28462
|
// Once the browser has moved the caret, if it could. With a 0 timeout
|
|
27962
28463
|
// Jodit would run this at once, before the browser moves it
|
|
27963
28464
|
editor.async.setTimeout(()=>{
|
|
@@ -27966,7 +28467,7 @@ const ns = 'addnewline';
|
|
|
27966
28467
|
if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
|
|
27967
28468
|
return;
|
|
27968
28469
|
}
|
|
27969
|
-
const p =
|
|
28470
|
+
const p = this.__newLine();
|
|
27970
28471
|
forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
27971
28472
|
editor.s.setCursorIn(p);
|
|
27972
28473
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
|
|
@@ -27978,7 +28479,7 @@ const ns = 'addnewline';
|
|
|
27978
28479
|
if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
|
|
27979
28480
|
const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
|
|
27980
28481
|
const top = e.pageY - editor.ew.scrollX;
|
|
27981
|
-
const p =
|
|
28482
|
+
const p = this.__newLine();
|
|
27982
28483
|
if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
|
|
27983
28484
|
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
27984
28485
|
} else {
|
|
@@ -28062,7 +28563,7 @@ const ns = 'addnewline';
|
|
|
28062
28563
|
return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
|
|
28063
28564
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
|
|
28064
28565
|
const editor = this.j;
|
|
28065
|
-
const p =
|
|
28566
|
+
const p = this.__newLine();
|
|
28066
28567
|
if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
|
|
28067
28568
|
if (this.__current === editor.editor) {
|
|
28068
28569
|
jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
|
|
@@ -32381,7 +32882,18 @@ const KEEPS_SPACES = new Set([
|
|
|
32381
32882
|
/**
|
|
32382
32883
|
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
32383
32884
|
* line break, a block or text starting (or ending) with a plain space
|
|
32384
|
-
*/
|
|
32885
|
+
*/ // The run of spaces at the end (or the start) of the text becomes nbsp; counted, as `/ +$/` backtracks on a long run
|
|
32886
|
+
function replaceEdgeSpaces(text, atEnd) {
|
|
32887
|
+
let count = 0;
|
|
32888
|
+
while(count < text.length && text.charAt(atEnd ? text.length - 1 - count : count) === ' '){
|
|
32889
|
+
count += 1;
|
|
32890
|
+
}
|
|
32891
|
+
if (count === 0) {
|
|
32892
|
+
return text;
|
|
32893
|
+
}
|
|
32894
|
+
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);
|
|
32895
|
+
}
|
|
32896
|
+
function hidesSpace(neighbor, edge) {
|
|
32385
32897
|
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
32898
|
}
|
|
32387
32899
|
class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
@@ -32421,6 +32933,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
32421
32933
|
}
|
|
32422
32934
|
jodit.s.expandSelection();
|
|
32423
32935
|
const range = jodit.s.range;
|
|
32936
|
+
this.__moveEdgesIntoCells(range);
|
|
32424
32937
|
const caret = this.__clearSelectedCells(range);
|
|
32425
32938
|
if (caret && range.collapsed) {
|
|
32426
32939
|
jodit.s.selectRange(caret);
|
|
@@ -32442,6 +32955,22 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
32442
32955
|
jodit.s.selectRange(caret ?? range);
|
|
32443
32956
|
return false;
|
|
32444
32957
|
}
|
|
32958
|
+
/**
|
|
32959
|
+
* Firefox selects cells whole from their row, as after a drag into or out
|
|
32960
|
+
* of a table nested in a cell, and `deleteContents` would remove them. The
|
|
32961
|
+
* edges move into the cells, so their content is cleared instead, as in
|
|
32962
|
+
* Firefox's own delete
|
|
32963
|
+
*/ __moveEdgesIntoCells(range) {
|
|
32964
|
+
const { startContainer, startOffset, endContainer, endOffset } = range;
|
|
32965
|
+
const first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
|
|
32966
|
+
const last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
|
|
32967
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(first)) {
|
|
32968
|
+
range.setStart(first, 0);
|
|
32969
|
+
}
|
|
32970
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(last)) {
|
|
32971
|
+
range.setEnd(last, last.childNodes.length);
|
|
32972
|
+
}
|
|
32973
|
+
}
|
|
32445
32974
|
/**
|
|
32446
32975
|
* A selection that starts or ends in a table cell clears the selected part
|
|
32447
32976
|
* of each cell it covers and keeps the cells, as the browsers do.
|
|
@@ -32564,10 +33093,10 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
|
|
|
32564
33093
|
const before = this.__findNeighbor(fake, true, block);
|
|
32565
33094
|
const after = this.__findNeighbor(fake, false, block);
|
|
32566
33095
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(before) && hidesSpace(after, /^ /)) {
|
|
32567
|
-
before.nodeValue = before.nodeValue
|
|
33096
|
+
before.nodeValue = replaceEdgeSpaces(before.nodeValue, true);
|
|
32568
33097
|
}
|
|
32569
33098
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(after) && hidesSpace(before, / $/)) {
|
|
32570
|
-
after.nodeValue = after.nodeValue
|
|
33099
|
+
after.nodeValue = replaceEdgeSpaces(after.nodeValue, false);
|
|
32571
33100
|
}
|
|
32572
33101
|
}
|
|
32573
33102
|
/**
|
|
@@ -35557,6 +36086,11 @@ function hr(editor) {
|
|
|
35557
36086
|
return false;
|
|
35558
36087
|
}
|
|
35559
36088
|
const p = editor.createInside.element(editor.o.enter);
|
|
36089
|
+
// As Enter's new line has, so it keeps its height without clean-html's
|
|
36090
|
+
// fillEmptyParagraph (#1807)
|
|
36091
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
|
|
36092
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
|
|
36093
|
+
}
|
|
35560
36094
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
|
|
35561
36095
|
editor.s.setCursorIn(p);
|
|
35562
36096
|
return false;
|
|
@@ -35599,7 +36133,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
35599
36133
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
35600
36134
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
|
|
35601
36135
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
|
|
35602
|
-
/* harmony import */ var
|
|
36136
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
36137
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17326);
|
|
35603
36138
|
/*!
|
|
35604
36139
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35605
36140
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35614,6 +36149,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
35614
36149
|
|
|
35615
36150
|
|
|
35616
36151
|
|
|
36152
|
+
|
|
35617
36153
|
/**
|
|
35618
36154
|
* Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
|
|
35619
36155
|
* in backend of you system
|
|
@@ -35672,13 +36208,66 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
|
35672
36208
|
const toggleEditable = ()=>{
|
|
35673
36209
|
(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
36210
|
};
|
|
36211
|
+
// The start of the whitespace run that ends at `to`
|
|
36212
|
+
const skipBack = (text, to)=>{
|
|
36213
|
+
while(to > 0 && /\s/.test(text.charAt(to - 1))){
|
|
36214
|
+
to -= 1;
|
|
36215
|
+
}
|
|
36216
|
+
return to;
|
|
36217
|
+
};
|
|
36218
|
+
// The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
|
|
36219
|
+
const cleanBodyTag = (tag)=>{
|
|
36220
|
+
tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
|
|
36221
|
+
const skip = (from, chars)=>{
|
|
36222
|
+
while(chars.test(tag.charAt(from))){
|
|
36223
|
+
from += 1;
|
|
36224
|
+
}
|
|
36225
|
+
return from;
|
|
36226
|
+
};
|
|
36227
|
+
let index = tag.indexOf('contenteditable');
|
|
36228
|
+
while(index !== -1){
|
|
36229
|
+
let to = skip(index + 'contenteditable'.length, /["'\s]/);
|
|
36230
|
+
if (tag.charAt(to) === '=') {
|
|
36231
|
+
to = skip(to + 1, /[\s"']/);
|
|
36232
|
+
if (tag.startsWith('true', to)) {
|
|
36233
|
+
to = skip(to + 4, /["']/);
|
|
36234
|
+
let from = index;
|
|
36235
|
+
if (/["']/.test(tag.charAt(from - 1))) {
|
|
36236
|
+
from -= 1;
|
|
36237
|
+
}
|
|
36238
|
+
from = skipBack(tag, from);
|
|
36239
|
+
return tag.slice(0, from) + tag.slice(to);
|
|
36240
|
+
}
|
|
36241
|
+
}
|
|
36242
|
+
index = tag.indexOf('contenteditable', index + 1);
|
|
36243
|
+
}
|
|
36244
|
+
return tag;
|
|
36245
|
+
};
|
|
35675
36246
|
const clearMarkers = (html)=>{
|
|
35676
36247
|
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
35677
|
-
html =
|
|
35678
|
-
const
|
|
35679
|
-
|
|
35680
|
-
|
|
35681
|
-
|
|
36248
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(html, '<style', '>', '</style>', 'jodit-box');
|
|
36249
|
+
const bodyStart = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.indexOfOpenTag)(html, 'body');
|
|
36250
|
+
let bodyEnd = -1;
|
|
36251
|
+
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)){
|
|
36252
|
+
bodyEnd = index;
|
|
36253
|
+
}
|
|
36254
|
+
if (bodyStart !== -1 && bodyEnd !== -1) {
|
|
36255
|
+
const afterBody = bodyEnd + '</body>'.length;
|
|
36256
|
+
const gt = html.indexOf('>', bodyStart);
|
|
36257
|
+
let body = html.slice(bodyStart, afterBody);
|
|
36258
|
+
if (gt !== -1 && gt < bodyEnd) {
|
|
36259
|
+
body = cleanBodyTag(html.slice(bodyStart, gt)) + html.slice(gt, afterBody);
|
|
36260
|
+
}
|
|
36261
|
+
for (const tag of [
|
|
36262
|
+
'style',
|
|
36263
|
+
'script',
|
|
36264
|
+
'span'
|
|
36265
|
+
]){
|
|
36266
|
+
body = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeBetween)(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
|
|
36267
|
+
}
|
|
36268
|
+
// remove markers: the spans outside the body are the editor's own
|
|
36269
|
+
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>');
|
|
36270
|
+
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
36271
|
}
|
|
35683
36272
|
return html;
|
|
35684
36273
|
};
|
|
@@ -41179,9 +41768,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41179
41768
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
41180
41769
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
41181
41770
|
/* 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
|
|
41771
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81910);
|
|
41772
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
|
|
41773
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
|
|
41774
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
|
|
41185
41775
|
/*!
|
|
41186
41776
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
41187
41777
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -41196,16 +41786,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41196
41786
|
|
|
41197
41787
|
|
|
41198
41788
|
|
|
41789
|
+
|
|
41199
41790
|
/**
|
|
41200
41791
|
* Process `video` and `audio`
|
|
41201
41792
|
*/ function media(editor) {
|
|
41202
41793
|
const keyFake = 'jodit_fake_wrapper';
|
|
41203
41794
|
const { mediaFakeTag, mediaBlocks, mediaInFakeBlock, mediaWrappers } = editor.options;
|
|
41204
41795
|
const wrap = (element)=>{
|
|
41205
|
-
if (element.parentNode && (0,
|
|
41796
|
+
if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
|
|
41206
41797
|
element = element.parentNode;
|
|
41207
41798
|
} else if (mediaWrappers[element.nodeName.toLowerCase()]) {
|
|
41208
|
-
element = (0,
|
|
41799
|
+
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
41800
|
} else if (mediaInFakeBlock) {
|
|
41210
41801
|
const media = element;
|
|
41211
41802
|
const wrapper = editor.createInside.element(mediaFakeTag, {
|
|
@@ -41214,13 +41805,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41214
41805
|
draggable: true,
|
|
41215
41806
|
[`data-${keyFake}`]: 1
|
|
41216
41807
|
});
|
|
41217
|
-
(0,
|
|
41808
|
+
(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
41809
|
// The wrapper fits the media, whose size changes as its metadata loads
|
|
41219
|
-
// and as it's resized.
|
|
41810
|
+
// and as it's resized. It's inline, as the media is by default, so the
|
|
41811
|
+
// line's text-align still places it, or a block when the media is one.
|
|
41812
|
+
// A percentage width is of the line, so the wrapper is a block that
|
|
41813
|
+
// takes the line, and the media in it follows the text-align it inherits
|
|
41220
41814
|
const fit = ()=>{
|
|
41221
|
-
(0,
|
|
41222
|
-
|
|
41223
|
-
|
|
41815
|
+
const ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%');
|
|
41816
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
|
|
41817
|
+
display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(media, 'display').toString()) ? 'inline-block' : 'block',
|
|
41818
|
+
width: ofLine ? '' : 'fit-content',
|
|
41224
41819
|
height: ''
|
|
41225
41820
|
});
|
|
41226
41821
|
};
|
|
@@ -41257,15 +41852,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
|
|
|
41257
41852
|
}
|
|
41258
41853
|
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
41259
41854
|
editor.e.on('afterGetValueFromEditor', (data)=>{
|
|
41260
|
-
|
|
41261
|
-
if (rxp.test(data.value)) {
|
|
41262
|
-
data.value = data.value.replace(rxp, '$1');
|
|
41263
|
-
}
|
|
41855
|
+
data.value = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_3__.unwrapMarkedTags)(data.value, mediaFakeTag, `data-${keyFake}`);
|
|
41264
41856
|
}).on('change afterInit afterSetMode changePlace', editor.async.debounce(()=>{
|
|
41265
41857
|
if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE) {
|
|
41266
|
-
(0,
|
|
41267
|
-
if (!(0,
|
|
41268
|
-
(0,
|
|
41858
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach((elm)=>{
|
|
41859
|
+
if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
|
|
41860
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
|
|
41269
41861
|
wrap(elm);
|
|
41270
41862
|
}
|
|
41271
41863
|
});
|
|
@@ -42246,7 +42838,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42246
42838
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
|
|
42247
42839
|
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
|
|
42248
42840
|
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
|
|
42249
|
-
/* harmony import */ var
|
|
42841
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81910);
|
|
42842
|
+
/* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
|
|
42250
42843
|
/*!
|
|
42251
42844
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
42252
42845
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -42258,11 +42851,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42258
42851
|
|
|
42259
42852
|
|
|
42260
42853
|
|
|
42854
|
+
|
|
42261
42855
|
/**
|
|
42262
42856
|
* Remove special HTML comments
|
|
42263
42857
|
* @private
|
|
42264
42858
|
*/ function removeExtraFragments(html) {
|
|
42265
|
-
html =
|
|
42859
|
+
html = (0,jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_4__.removeTagsByPrefix)(html, [
|
|
42860
|
+
'<meta'
|
|
42861
|
+
]);
|
|
42266
42862
|
const start = html.search(/<!--StartFragment-->/i);
|
|
42267
42863
|
if (start !== -1) {
|
|
42268
42864
|
html = html.substring(start + 20);
|
|
@@ -42280,7 +42876,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42280
42876
|
* paste bold
|
|
42281
42877
|
* @private
|
|
42282
42878
|
*/ function removeGoogleDocsWrapper(html) {
|
|
42283
|
-
|
|
42879
|
+
// A plain search: the wrapper check is left to the parsed document below
|
|
42880
|
+
if (!/docs-internal-guid-/i.test(html)) {
|
|
42284
42881
|
return html;
|
|
42285
42882
|
}
|
|
42286
42883
|
// An inert document: images don't load and handlers don't run
|
|
@@ -42335,7 +42932,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42335
42932
|
return;
|
|
42336
42933
|
}
|
|
42337
42934
|
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,
|
|
42935
|
+
const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
42339
42936
|
text,
|
|
42340
42937
|
name: text.toLowerCase(),
|
|
42341
42938
|
tabIndex: 0
|
|
@@ -42351,7 +42948,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
|
|
|
42351
42948
|
}
|
|
42352
42949
|
jodit.e.fire('afterClosePasteDialog', dialog);
|
|
42353
42950
|
});
|
|
42354
|
-
const cancel = (0,
|
|
42951
|
+
const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
|
|
42355
42952
|
text: 'Cancel',
|
|
42356
42953
|
tabIndex: 0
|
|
42357
42954
|
}).onAction(()=>{
|
|
@@ -43859,12 +44456,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
43859
44456
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
|
|
43860
44457
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
|
|
43861
44458
|
/* 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
|
|
44459
|
+
/* harmony import */ var jodit_core_helpers_html_tag_scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81910);
|
|
44460
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
44461
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(18855);
|
|
44462
|
+
/* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42259);
|
|
44463
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
|
|
44464
|
+
/* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(56490);
|
|
44465
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(96608);
|
|
43868
44466
|
/*!
|
|
43869
44467
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
43870
44468
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -43888,6 +44486,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
43888
44486
|
|
|
43889
44487
|
|
|
43890
44488
|
|
|
44489
|
+
|
|
43891
44490
|
const keyBInd = '__jodit-resizer_binded';
|
|
43892
44491
|
/**
|
|
43893
44492
|
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
@@ -43904,7 +44503,7 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
43904
44503
|
* A video with no height of its own takes it from its width and its ratio,
|
|
43905
44504
|
* so resizing it keeps the ratio without setting a height.
|
|
43906
44505
|
*/ 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,
|
|
44506
|
+
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
44507
|
}
|
|
43909
44508
|
const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
43910
44509
|
/**
|
|
@@ -43914,7 +44513,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
43914
44513
|
*/ 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
44514
|
/**
|
|
43916
44515
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
43917
|
-
*/ class resizer extends
|
|
44516
|
+
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_9__.Plugin {
|
|
43918
44517
|
/** @override */ afterInit(editor) {
|
|
43919
44518
|
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
43920
44519
|
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
|
|
@@ -43931,10 +44530,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
43931
44530
|
.on('keydown', this.onEditorKeyDown, {
|
|
43932
44531
|
top: true
|
|
43933
44532
|
}).on('afterGetValueFromEditor.resizer', (data)=>{
|
|
43934
|
-
|
|
43935
|
-
if (rgx.test(data.value)) {
|
|
43936
|
-
data.value = data.value.replace(rgx, '$1');
|
|
43937
|
-
}
|
|
44533
|
+
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
44534
|
});
|
|
43939
44535
|
this.addEventListeners();
|
|
43940
44536
|
this.__onChangeEditor();
|
|
@@ -43970,7 +44566,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
43970
44566
|
return;
|
|
43971
44567
|
}
|
|
43972
44568
|
const width = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width');
|
|
43973
|
-
if (width && !(0,
|
|
44569
|
+
if (width && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(image, 'width')) {
|
|
43974
44570
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(image, 'width', width);
|
|
43975
44571
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(image, 'width', null);
|
|
43976
44572
|
}
|
|
@@ -44094,7 +44690,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44094
44690
|
__followCaret() {
|
|
44095
44691
|
const before = this.__keyDownRange;
|
|
44096
44692
|
this.__keyDownRange = null;
|
|
44097
|
-
if (!(0,
|
|
44693
|
+
if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_10__.isMoved)(this.j, before)) {
|
|
44098
44694
|
return;
|
|
44099
44695
|
}
|
|
44100
44696
|
if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
|
|
@@ -44129,7 +44725,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44129
44725
|
if (!this.isResizeMode) {
|
|
44130
44726
|
// A click in the element's popup, or in a list it opens, works on
|
|
44131
44727
|
// the element, so it keeps its frame
|
|
44132
|
-
if (e?.target &&
|
|
44728
|
+
if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_12__.Popup)) {
|
|
44133
44729
|
return;
|
|
44134
44730
|
}
|
|
44135
44731
|
return this.hide();
|
|
@@ -44153,7 +44749,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44153
44749
|
if (changeAttrs) {
|
|
44154
44750
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key, value);
|
|
44155
44751
|
}
|
|
44156
|
-
if (!changeAttrs || (0,
|
|
44752
|
+
if (!changeAttrs || (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, key)) {
|
|
44157
44753
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
|
|
44158
44754
|
}
|
|
44159
44755
|
}
|
|
@@ -44217,8 +44813,11 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44217
44813
|
// is nothing measurable at all, let the wrapper size itself.
|
|
44218
44814
|
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
44219
44815
|
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
44816
|
+
// The wrapper takes the iframe's place in its line: inline, as an
|
|
44817
|
+
// iframe is by default, so the line's text-align still places it,
|
|
44818
|
+
// or a block when the iframe is one
|
|
44220
44819
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
44221
|
-
display: (0,
|
|
44820
|
+
display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
|
|
44222
44821
|
});
|
|
44223
44822
|
if (width) {
|
|
44224
44823
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
@@ -44336,7 +44935,7 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
44336
44935
|
}
|
|
44337
44936
|
if (this.element && this.rect) {
|
|
44338
44937
|
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,
|
|
44938
|
+
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
44939
|
const newTop = pos.top - workplacePosition.top, newLeft = pos.left - workplacePosition.left;
|
|
44341
44940
|
if (top !== newTop || left !== newLeft || w !== this.element.offsetWidth || h !== this.element.offsetHeight) {
|
|
44342
44941
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, {
|
|
@@ -45528,13 +46127,7 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
45528
46127
|
if (this.j.isLockedNotBy(key)) {
|
|
45529
46128
|
return;
|
|
45530
46129
|
}
|
|
45531
|
-
|
|
45532
|
-
// host, so the lookup must start from the shadow root
|
|
45533
|
-
const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
45534
|
-
const cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
|
|
45535
|
-
'td',
|
|
45536
|
-
'th'
|
|
45537
|
-
], table);
|
|
46130
|
+
const cell = this.__cellUnder(e, table);
|
|
45538
46131
|
if (!cell || !this.__selectedCell) {
|
|
45539
46132
|
return;
|
|
45540
46133
|
}
|
|
@@ -45577,6 +46170,13 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
45577
46170
|
this.__isSelectionMode = false;
|
|
45578
46171
|
this.__selectedCell = null;
|
|
45579
46172
|
}
|
|
46173
|
+
// The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
|
|
46174
|
+
__cellUnder(e, table) {
|
|
46175
|
+
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
46176
|
+
// host, so the lookup must start from the shadow root
|
|
46177
|
+
const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
46178
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(elm, 'table', table), table);
|
|
46179
|
+
}
|
|
45580
46180
|
/**
|
|
45581
46181
|
* Stop a selection process
|
|
45582
46182
|
*/ __onStopSelection(table, e) {
|
|
@@ -45585,23 +46185,10 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
|
|
|
45585
46185
|
}
|
|
45586
46186
|
this.__isSelectionMode = false;
|
|
45587
46187
|
this.j.unlock();
|
|
45588
|
-
|
|
45589
|
-
// host, so the lookup must start from the shadow root
|
|
45590
|
-
const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
45591
|
-
if (!node) {
|
|
45592
|
-
return;
|
|
45593
|
-
}
|
|
45594
|
-
const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
|
|
45595
|
-
'td',
|
|
45596
|
-
'th'
|
|
45597
|
-
], table);
|
|
46188
|
+
const cell = this.__cellUnder(e, table);
|
|
45598
46189
|
if (!cell) {
|
|
45599
46190
|
return;
|
|
45600
46191
|
}
|
|
45601
|
-
const ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', table);
|
|
45602
|
-
if (ownTable && ownTable !== table) {
|
|
45603
|
-
return; // Nested tables
|
|
45604
|
-
}
|
|
45605
46192
|
this.__showCellsPopup(table, [
|
|
45606
46193
|
cell,
|
|
45607
46194
|
this.__selectedCell
|