jodit-pro 4.2.11 → 4.2.13
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/es2015/jodit.css +115 -115
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +525 -444
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/autocomplete/autocomplete.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2015/plugins/backup/backup.css +1 -1
- package/es2015/plugins/backup/backup.js +1 -1
- package/es2015/plugins/backup/backup.min.js +1 -1
- package/es2015/plugins/button-generator/button-generator.css +1 -1
- package/es2015/plugins/button-generator/button-generator.js +1 -1
- package/es2015/plugins/button-generator/button-generator.min.js +1 -1
- package/es2015/plugins/change-case/change-case.js +1 -1
- package/es2015/plugins/change-case/change-case.min.js +1 -1
- package/es2015/plugins/color-picker/color-picker.css +1 -1
- package/es2015/plugins/color-picker/color-picker.js +1 -1
- package/es2015/plugins/color-picker/color-picker.min.js +1 -1
- package/es2015/plugins/emoji/emoji.css +1 -1
- package/es2015/plugins/emoji/emoji.js +1 -1
- package/es2015/plugins/emoji/emoji.min.js +1 -1
- package/es2015/plugins/export-docs/export-docs.js +1 -1
- package/es2015/plugins/export-docs/export-docs.min.js +1 -1
- package/es2015/plugins/finder/finder.css +1 -1
- package/es2015/plugins/finder/finder.js +1 -1
- package/es2015/plugins/finder/finder.min.js +1 -1
- package/es2015/plugins/google-maps/google-maps.css +1 -1
- package/es2015/plugins/google-maps/google-maps.js +1 -1
- package/es2015/plugins/google-maps/google-maps.min.js +1 -1
- package/es2015/plugins/google-search/google-search.js +1 -1
- package/es2015/plugins/google-search/google-search.min.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2015/plugins/keyboard/keyboard.css +1 -1
- package/es2015/plugins/keyboard/keyboard.js +1 -1
- package/es2015/plugins/keyboard/keyboard.min.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2015/plugins/page-break/page-break.js +1 -1
- package/es2015/plugins/page-break/page-break.min.js +1 -1
- package/es2015/plugins/paste-code/paste-code.css +1 -1
- package/es2015/plugins/paste-code/paste-code.js +1 -1
- package/es2015/plugins/paste-code/paste-code.min.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2015/plugins/todo-list/todo-list.css +1 -1
- package/es2015/plugins/todo-list/todo-list.js +1 -1
- package/es2015/plugins/todo-list/todo-list.min.js +1 -1
- package/es2015/plugins/translate/translate.css +1 -1
- package/es2015/plugins/translate/translate.js +1 -1
- package/es2015/plugins/translate/translate.min.js +1 -1
- package/es2015/plugins/tune-block/tune-block.css +1 -1
- package/es2015/plugins/tune-block/tune-block.js +1 -1
- package/es2015/plugins/tune-block/tune-block.min.js +1 -1
- package/es2018/jodit.css +115 -115
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +525 -444
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/autocomplete/autocomplete.js +1 -1
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.css +1 -1
- package/es2018/plugins/backup/backup.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.css +1 -1
- package/es2018/plugins/button-generator/button-generator.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/color-picker/color-picker.css +1 -1
- package/es2018/plugins/color-picker/color-picker.js +1 -1
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.css +1 -1
- package/es2018/plugins/emoji/emoji.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.css +1 -1
- package/es2018/plugins/finder/finder.js +1 -1
- package/es2018/plugins/finder/finder.min.js +1 -1
- package/es2018/plugins/google-maps/google-maps.css +1 -1
- package/es2018/plugins/google-maps/google-maps.js +1 -1
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/keyboard/keyboard.css +1 -1
- package/es2018/plugins/keyboard/keyboard.js +1 -1
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.css +1 -1
- package/es2018/plugins/paste-code/paste-code.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/todo-list/todo-list.css +1 -1
- package/es2018/plugins/todo-list/todo-list.js +1 -1
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.css +1 -1
- package/es2018/plugins/translate/translate.js +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- package/es2018/plugins/tune-block/tune-block.css +1 -1
- package/es2018/plugins/tune-block/tune-block.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021/jodit.css +115 -115
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +519 -440
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021/plugins/backup/backup.css +1 -1
- package/es2021/plugins/backup/backup.js +1 -1
- package/es2021/plugins/backup/backup.min.js +1 -1
- package/es2021/plugins/button-generator/button-generator.css +1 -1
- package/es2021/plugins/button-generator/button-generator.js +1 -1
- package/es2021/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021/plugins/change-case/change-case.js +1 -1
- package/es2021/plugins/change-case/change-case.min.js +1 -1
- package/es2021/plugins/color-picker/color-picker.css +1 -1
- package/es2021/plugins/color-picker/color-picker.js +1 -1
- package/es2021/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021/plugins/emoji/emoji.css +1 -1
- package/es2021/plugins/emoji/emoji.js +1 -1
- package/es2021/plugins/emoji/emoji.min.js +1 -1
- package/es2021/plugins/export-docs/export-docs.js +1 -1
- package/es2021/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021/plugins/finder/finder.css +1 -1
- package/es2021/plugins/finder/finder.js +1 -1
- package/es2021/plugins/finder/finder.min.js +1 -1
- package/es2021/plugins/google-maps/google-maps.css +1 -1
- package/es2021/plugins/google-maps/google-maps.js +1 -1
- package/es2021/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021/plugins/google-search/google-search.js +1 -1
- package/es2021/plugins/google-search/google-search.min.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021/plugins/keyboard/keyboard.css +1 -1
- package/es2021/plugins/keyboard/keyboard.js +1 -1
- package/es2021/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021/plugins/page-break/page-break.js +1 -1
- package/es2021/plugins/page-break/page-break.min.js +1 -1
- package/es2021/plugins/paste-code/paste-code.css +1 -1
- package/es2021/plugins/paste-code/paste-code.js +1 -1
- package/es2021/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021/plugins/todo-list/todo-list.css +1 -1
- package/es2021/plugins/todo-list/todo-list.js +1 -1
- package/es2021/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021/plugins/translate/translate.css +1 -1
- package/es2021/plugins/translate/translate.js +1 -1
- package/es2021/plugins/translate/translate.min.js +1 -1
- package/es2021/plugins/tune-block/tune-block.css +1 -1
- package/es2021/plugins/tune-block/tune-block.js +1 -1
- package/es2021/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021.en/jodit.css +115 -115
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +519 -440
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021.en/plugins/backup/backup.css +1 -1
- package/es2021.en/plugins/backup/backup.js +1 -1
- package/es2021.en/plugins/backup/backup.min.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.css +1 -1
- package/es2021.en/plugins/button-generator/button-generator.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021.en/plugins/change-case/change-case.js +1 -1
- package/es2021.en/plugins/change-case/change-case.min.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.css +1 -1
- package/es2021.en/plugins/color-picker/color-picker.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021.en/plugins/emoji/emoji.css +1 -1
- package/es2021.en/plugins/emoji/emoji.js +1 -1
- package/es2021.en/plugins/emoji/emoji.min.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021.en/plugins/finder/finder.css +1 -1
- package/es2021.en/plugins/finder/finder.js +1 -1
- package/es2021.en/plugins/finder/finder.min.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.css +1 -1
- package/es2021.en/plugins/google-maps/google-maps.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021.en/plugins/google-search/google-search.js +1 -1
- package/es2021.en/plugins/google-search/google-search.min.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.css +1 -1
- package/es2021.en/plugins/keyboard/keyboard.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021.en/plugins/page-break/page-break.js +1 -1
- package/es2021.en/plugins/page-break/page-break.min.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.css +1 -1
- package/es2021.en/plugins/paste-code/paste-code.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.css +1 -1
- package/es2021.en/plugins/todo-list/todo-list.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021.en/plugins/translate/translate.css +1 -1
- package/es2021.en/plugins/translate/translate.js +1 -1
- package/es2021.en/plugins/translate/translate.min.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.css +1 -1
- package/es2021.en/plugins/tune-block/tune-block.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/jodit.css +129 -129
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +543 -461
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/autocomplete/autocomplete.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es5/plugins/backup/backup.css +1 -1
- package/es5/plugins/backup/backup.js +1 -1
- package/es5/plugins/backup/backup.min.js +1 -1
- package/es5/plugins/button-generator/button-generator.css +1 -1
- package/es5/plugins/button-generator/button-generator.js +1 -1
- package/es5/plugins/button-generator/button-generator.min.js +1 -1
- package/es5/plugins/change-case/change-case.js +1 -1
- package/es5/plugins/change-case/change-case.min.js +1 -1
- package/es5/plugins/color-picker/color-picker.css +1 -1
- package/es5/plugins/color-picker/color-picker.js +1 -1
- package/es5/plugins/color-picker/color-picker.min.js +1 -1
- package/es5/plugins/emoji/emoji.css +1 -1
- package/es5/plugins/emoji/emoji.js +1 -1
- package/es5/plugins/emoji/emoji.min.js +1 -1
- package/es5/plugins/export-docs/export-docs.js +1 -1
- package/es5/plugins/export-docs/export-docs.min.js +1 -1
- package/es5/plugins/finder/finder.css +1 -1
- package/es5/plugins/finder/finder.js +1 -1
- package/es5/plugins/finder/finder.min.js +1 -1
- package/es5/plugins/google-maps/google-maps.css +1 -1
- package/es5/plugins/google-maps/google-maps.js +1 -1
- package/es5/plugins/google-maps/google-maps.min.js +1 -1
- package/es5/plugins/google-search/google-search.js +1 -1
- package/es5/plugins/google-search/google-search.min.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es5/plugins/keyboard/keyboard.css +1 -1
- package/es5/plugins/keyboard/keyboard.js +1 -1
- package/es5/plugins/keyboard/keyboard.min.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es5/plugins/page-break/page-break.js +1 -1
- package/es5/plugins/page-break/page-break.min.js +1 -1
- package/es5/plugins/paste-code/paste-code.css +1 -1
- package/es5/plugins/paste-code/paste-code.js +1 -1
- package/es5/plugins/paste-code/paste-code.min.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es5/plugins/todo-list/todo-list.css +1 -1
- package/es5/plugins/todo-list/todo-list.js +1 -1
- package/es5/plugins/todo-list/todo-list.min.js +1 -1
- package/es5/plugins/translate/translate.css +1 -1
- package/es5/plugins/translate/translate.js +1 -1
- package/es5/plugins/translate/translate.min.js +1 -1
- package/es5/plugins/tune-block/tune-block.css +1 -1
- package/es5/plugins/tune-block/tune-block.js +1 -1
- package/es5/plugins/tune-block/tune-block.min.js +1 -1
- package/package.json +1 -1
package/es2021/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit-pro - PRO Version of Jodit Editor
|
|
3
3
|
* Author: Chupurnov Valeriy <chupurnov@gmail.com>
|
|
4
|
-
* Version: v4.2.
|
|
4
|
+
* Version: v4.2.13
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
@@ -2444,7 +2444,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2444
2444
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
2445
2445
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
2446
2446
|
*/
|
|
2447
|
-
const APP_VERSION = "4.2.
|
|
2447
|
+
const APP_VERSION = "4.2.13";
|
|
2448
2448
|
// prettier-ignore
|
|
2449
2449
|
const ES = "es2021";
|
|
2450
2450
|
const IS_ES_MODERN = true;
|
|
@@ -10530,10 +10530,14 @@ class Response {
|
|
|
10530
10530
|
|
|
10531
10531
|
"use strict";
|
|
10532
10532
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10533
|
-
/* harmony export */
|
|
10533
|
+
/* harmony export */ Qe: function() { return /* binding */ cursorInTheEdgeOfString; },
|
|
10534
|
+
/* harmony export */ W8: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_2__.W; },
|
|
10535
|
+
/* harmony export */ dY: function() { return /* binding */ findCorrectCurrentNode; }
|
|
10534
10536
|
/* harmony export */ });
|
|
10535
|
-
/* harmony import */ var
|
|
10536
|
-
/* harmony import */ var
|
|
10537
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67259);
|
|
10538
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23545);
|
|
10539
|
+
/* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49967);
|
|
10540
|
+
/* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13088);
|
|
10537
10541
|
/*!
|
|
10538
10542
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
10539
10543
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -10546,6 +10550,54 @@ class Response {
|
|
|
10546
10550
|
|
|
10547
10551
|
|
|
10548
10552
|
|
|
10553
|
+
/**
|
|
10554
|
+
* Check if the cursor is at the edge of the string
|
|
10555
|
+
* @private
|
|
10556
|
+
*/
|
|
10557
|
+
function cursorInTheEdgeOfString(container, offset, start, end) {
|
|
10558
|
+
const text = container.nodeValue?.length ? container.nodeValue : '';
|
|
10559
|
+
if (end && text.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_END)(), '').length > offset) {
|
|
10560
|
+
return true;
|
|
10561
|
+
}
|
|
10562
|
+
const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
|
|
10563
|
+
return start && ((inv && inv[0].length < offset) || (!inv && offset > 0));
|
|
10564
|
+
}
|
|
10565
|
+
function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild, child) {
|
|
10566
|
+
node = range.startContainer.childNodes[range.startOffset];
|
|
10567
|
+
if (!node) {
|
|
10568
|
+
node = range.startContainer.childNodes[range.startOffset - 1];
|
|
10569
|
+
rightMode = true;
|
|
10570
|
+
}
|
|
10571
|
+
if (node && isCollapsed && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node)) {
|
|
10572
|
+
// test Current method - Cursor in the left of some SPAN
|
|
10573
|
+
if (!rightMode && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node.previousSibling)) {
|
|
10574
|
+
node = node.previousSibling;
|
|
10575
|
+
}
|
|
10576
|
+
else if (checkChild) {
|
|
10577
|
+
let current = child(node);
|
|
10578
|
+
while (current) {
|
|
10579
|
+
if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current)) {
|
|
10580
|
+
node = current;
|
|
10581
|
+
break;
|
|
10582
|
+
}
|
|
10583
|
+
current = child(current);
|
|
10584
|
+
}
|
|
10585
|
+
}
|
|
10586
|
+
}
|
|
10587
|
+
if (node && !isCollapsed && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node)) {
|
|
10588
|
+
let leftChild = node, rightChild = node;
|
|
10589
|
+
do {
|
|
10590
|
+
leftChild = leftChild.firstChild;
|
|
10591
|
+
rightChild = rightChild.lastChild;
|
|
10592
|
+
} while (leftChild && rightChild && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(leftChild));
|
|
10593
|
+
if (leftChild === rightChild && leftChild && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(leftChild)) {
|
|
10594
|
+
node = leftChild;
|
|
10595
|
+
}
|
|
10596
|
+
}
|
|
10597
|
+
return { node, rightMode };
|
|
10598
|
+
}
|
|
10599
|
+
|
|
10600
|
+
|
|
10549
10601
|
/***/ }),
|
|
10550
10602
|
|
|
10551
10603
|
/***/ 49967:
|
|
@@ -10667,7 +10719,7 @@ function moveTheNodeAlongTheEdgeOutward(node, start, root) {
|
|
|
10667
10719
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10668
10720
|
/* harmony export */ L: function() { return /* binding */ Selection; }
|
|
10669
10721
|
/* harmony export */ });
|
|
10670
|
-
/* harmony import */ var
|
|
10722
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31635);
|
|
10671
10723
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67259);
|
|
10672
10724
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53557);
|
|
10673
10725
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23545);
|
|
@@ -10677,6 +10729,7 @@ function moveTheNodeAlongTheEdgeOutward(node, start, root) {
|
|
|
10677
10729
|
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_5__);
|
|
10678
10730
|
/* harmony import */ var jodit_core_selection_helpers_move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13088);
|
|
10679
10731
|
/* harmony import */ var _style_commit_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(11232);
|
|
10732
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(92185);
|
|
10680
10733
|
/*!
|
|
10681
10734
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
10682
10735
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -10693,6 +10746,7 @@ function moveTheNodeAlongTheEdgeOutward(node, start, root) {
|
|
|
10693
10746
|
|
|
10694
10747
|
|
|
10695
10748
|
|
|
10749
|
+
|
|
10696
10750
|
class Selection {
|
|
10697
10751
|
constructor(jodit) {
|
|
10698
10752
|
this.jodit = jodit;
|
|
@@ -11075,63 +11129,35 @@ class Selection {
|
|
|
11075
11129
|
* Returns the current element under the cursor inside editor
|
|
11076
11130
|
*/
|
|
11077
11131
|
current(checkChild = true) {
|
|
11078
|
-
if (this.j.getRealMode()
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
}
|
|
11101
|
-
else if (checkChild) {
|
|
11102
|
-
let current = child(node);
|
|
11103
|
-
while (current) {
|
|
11104
|
-
if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(current)) {
|
|
11105
|
-
node = current;
|
|
11106
|
-
break;
|
|
11107
|
-
}
|
|
11108
|
-
current = child(current);
|
|
11109
|
-
}
|
|
11110
|
-
}
|
|
11111
|
-
}
|
|
11112
|
-
if (node && !sel.isCollapsed && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node)) {
|
|
11113
|
-
let leftChild = node, rightChild = node;
|
|
11114
|
-
do {
|
|
11115
|
-
leftChild = leftChild.firstChild;
|
|
11116
|
-
rightChild = rightChild.lastChild;
|
|
11117
|
-
} while (leftChild && rightChild && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(leftChild));
|
|
11118
|
-
if (leftChild === rightChild &&
|
|
11119
|
-
leftChild &&
|
|
11120
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(leftChild)) {
|
|
11121
|
-
node = leftChild;
|
|
11122
|
-
}
|
|
11123
|
-
}
|
|
11124
|
-
}
|
|
11125
|
-
// check - cursor inside editor
|
|
11126
|
-
if (node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.area, node)) {
|
|
11127
|
-
return node;
|
|
11128
|
-
}
|
|
11132
|
+
if (this.j.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
|
|
11133
|
+
return null;
|
|
11134
|
+
}
|
|
11135
|
+
const sel = this.sel;
|
|
11136
|
+
if (!sel || sel.rangeCount === 0) {
|
|
11137
|
+
return null;
|
|
11138
|
+
}
|
|
11139
|
+
const range = sel.getRangeAt(0);
|
|
11140
|
+
let node = range.startContainer;
|
|
11141
|
+
let rightMode = false;
|
|
11142
|
+
const child = (nd) => rightMode ? nd.lastChild : nd.firstChild;
|
|
11143
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(node, 'br') && sel.isCollapsed) {
|
|
11144
|
+
return node;
|
|
11145
|
+
}
|
|
11146
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node)) {
|
|
11147
|
+
const ret = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__/* .findCorrectCurrentNode */ .dY)(node, range, rightMode, sel.isCollapsed, checkChild, child);
|
|
11148
|
+
node = ret.node;
|
|
11149
|
+
rightMode = ret.rightMode;
|
|
11150
|
+
}
|
|
11151
|
+
// check - cursor inside editor
|
|
11152
|
+
if (node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.area, node)) {
|
|
11153
|
+
return node;
|
|
11129
11154
|
}
|
|
11130
11155
|
return null;
|
|
11131
11156
|
}
|
|
11132
11157
|
/**
|
|
11133
11158
|
* Insert element in editor
|
|
11134
11159
|
*
|
|
11160
|
+
* @param node - Node for insert
|
|
11135
11161
|
* @param insertCursorAfter - After insert, cursor will move after element
|
|
11136
11162
|
* @param fireChange - After insert, editor fire change event. You can prevent this behavior
|
|
11137
11163
|
*/
|
|
@@ -11193,6 +11219,7 @@ class Selection {
|
|
|
11193
11219
|
* Inserts in the current cursor position some HTML snippet
|
|
11194
11220
|
*
|
|
11195
11221
|
* @param html - HTML The text to be inserted into the document
|
|
11222
|
+
* @param insertCursorAfter - After insert, cursor will move after element
|
|
11196
11223
|
* @example
|
|
11197
11224
|
* ```javascript
|
|
11198
11225
|
* parent.s.insertHTML('<img src="image.png"/>');
|
|
@@ -11236,6 +11263,7 @@ class Selection {
|
|
|
11236
11263
|
*
|
|
11237
11264
|
* @param url - URL for image, or HTMLImageElement
|
|
11238
11265
|
* @param styles - If specified, it will be applied <code>$(image).css(styles)</code>
|
|
11266
|
+
* @param defaultWidth - If specified, it will be applied <code>css('width', defaultWidth)</code>
|
|
11239
11267
|
*/
|
|
11240
11268
|
insertImage(url, styles = null, defaultWidth = null) {
|
|
11241
11269
|
const image = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .Kg)(url) ? this.j.createInside.element('img') : url;
|
|
@@ -11290,74 +11318,81 @@ class Selection {
|
|
|
11290
11318
|
*/
|
|
11291
11319
|
eachSelection(callback) {
|
|
11292
11320
|
const sel = this.sel;
|
|
11293
|
-
if (sel
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11321
|
+
if (!sel || !sel.rangeCount) {
|
|
11322
|
+
return;
|
|
11323
|
+
}
|
|
11324
|
+
const range = sel.getRangeAt(0);
|
|
11325
|
+
let root = range.commonAncestorContainer;
|
|
11326
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isHTMLElement(root)) {
|
|
11327
|
+
root = root.parentElement;
|
|
11328
|
+
}
|
|
11329
|
+
const nodes = [];
|
|
11330
|
+
const startOffset = range.startOffset;
|
|
11331
|
+
const length = root.childNodes.length;
|
|
11332
|
+
const elementOffset = startOffset < length ? startOffset : length - 1;
|
|
11333
|
+
let start = range.startContainer === this.area
|
|
11334
|
+
? root.childNodes[elementOffset]
|
|
11335
|
+
: range.startContainer;
|
|
11336
|
+
let end = range.endContainer === this.area
|
|
11337
|
+
? root.childNodes[range.endOffset - 1]
|
|
11338
|
+
: range.endContainer;
|
|
11339
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(start) &&
|
|
11340
|
+
start === range.startContainer &&
|
|
11341
|
+
range.startOffset === start.nodeValue?.length &&
|
|
11342
|
+
start.nextSibling) {
|
|
11343
|
+
start = start.nextSibling;
|
|
11344
|
+
}
|
|
11345
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(end) &&
|
|
11346
|
+
end === range.endContainer &&
|
|
11347
|
+
range.endOffset === 0 &&
|
|
11348
|
+
end.previousSibling) {
|
|
11349
|
+
end = end.previousSibling;
|
|
11350
|
+
}
|
|
11351
|
+
const checkElm = (node) => {
|
|
11352
|
+
if (node &&
|
|
11353
|
+
node !== root &&
|
|
11354
|
+
!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isEmptyTextNode(node) &&
|
|
11355
|
+
!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__/* .isMarker */ .rg)(node)) {
|
|
11356
|
+
nodes.push(node);
|
|
11357
|
+
}
|
|
11358
|
+
};
|
|
11359
|
+
checkElm(start);
|
|
11360
|
+
if (start !== end && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(root, start, true)) {
|
|
11361
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.find(start, node => {
|
|
11362
|
+
checkElm(node);
|
|
11363
|
+
// checks parentElement as well because partial selections are not equal to entire element
|
|
11364
|
+
return (node === end ||
|
|
11365
|
+
(node && node.contains && node.contains(end)));
|
|
11366
|
+
}, root, true, false);
|
|
11367
|
+
}
|
|
11368
|
+
const forEvery = (current) => {
|
|
11369
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.j.editor, current, true)) {
|
|
11370
|
+
return;
|
|
11371
|
+
}
|
|
11372
|
+
if (current.nodeName.match(/^(UL|OL)$/)) {
|
|
11373
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(current.childNodes).forEach(forEvery);
|
|
11374
|
+
}
|
|
11375
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(current, 'li')) {
|
|
11376
|
+
if (current.firstChild) {
|
|
11377
|
+
current = current.firstChild;
|
|
11340
11378
|
}
|
|
11341
|
-
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
else {
|
|
11346
|
-
const currentB = this.j.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE);
|
|
11347
|
-
current.appendChild(currentB);
|
|
11348
|
-
current = currentB;
|
|
11349
|
-
}
|
|
11379
|
+
else {
|
|
11380
|
+
const currentB = this.j.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE);
|
|
11381
|
+
current.appendChild(currentB);
|
|
11382
|
+
current = currentB;
|
|
11350
11383
|
}
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11384
|
+
}
|
|
11385
|
+
callback(current);
|
|
11386
|
+
};
|
|
11387
|
+
if (nodes.length === 0) {
|
|
11388
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isEmptyTextNode(start)) {
|
|
11354
11389
|
nodes.push(start);
|
|
11355
11390
|
}
|
|
11356
|
-
if (
|
|
11391
|
+
if (start.firstChild) {
|
|
11357
11392
|
nodes.push(start.firstChild);
|
|
11358
11393
|
}
|
|
11359
|
-
nodes.forEach(forEvery);
|
|
11360
11394
|
}
|
|
11395
|
+
nodes.forEach(forEvery);
|
|
11361
11396
|
}
|
|
11362
11397
|
/**
|
|
11363
11398
|
* Checks if the cursor is at the end(start) block
|
|
@@ -11384,13 +11419,7 @@ class Selection {
|
|
|
11384
11419
|
this.j.e.fire('isInvisibleForCursor', elm) === true));
|
|
11385
11420
|
// check right offset
|
|
11386
11421
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(container)) {
|
|
11387
|
-
|
|
11388
|
-
if (end && text.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_END)(), '').length > offset) {
|
|
11389
|
-
return false;
|
|
11390
|
-
}
|
|
11391
|
-
const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
|
|
11392
|
-
if (start &&
|
|
11393
|
-
((inv && inv[0].length < offset) || (!inv && offset > 0))) {
|
|
11422
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_8__/* .cursorInTheEdgeOfString */ .Qe)(container, offset, start, end)) {
|
|
11394
11423
|
return false;
|
|
11395
11424
|
}
|
|
11396
11425
|
}
|
|
@@ -11478,6 +11507,7 @@ class Selection {
|
|
|
11478
11507
|
}
|
|
11479
11508
|
/**
|
|
11480
11509
|
* Set cursor in the node
|
|
11510
|
+
* @param node - Node element
|
|
11481
11511
|
* @param inStart - set cursor in start of element
|
|
11482
11512
|
*/
|
|
11483
11513
|
setCursorIn(node, inStart = false) {
|
|
@@ -11538,6 +11568,7 @@ class Selection {
|
|
|
11538
11568
|
}
|
|
11539
11569
|
/**
|
|
11540
11570
|
* Select node
|
|
11571
|
+
* @param node - Node element
|
|
11541
11572
|
* @param inward - select all inside
|
|
11542
11573
|
*/
|
|
11543
11574
|
select(node, inward = false) {
|
|
@@ -11811,19 +11842,19 @@ class Selection {
|
|
|
11811
11842
|
return this;
|
|
11812
11843
|
}
|
|
11813
11844
|
}
|
|
11814
|
-
(0,
|
|
11845
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11815
11846
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11816
11847
|
], Selection.prototype, "createRange", null);
|
|
11817
|
-
(0,
|
|
11848
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11818
11849
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11819
11850
|
], Selection.prototype, "focus", null);
|
|
11820
|
-
(0,
|
|
11851
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11821
11852
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11822
11853
|
], Selection.prototype, "setCursorAfter", null);
|
|
11823
|
-
(0,
|
|
11854
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11824
11855
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11825
11856
|
], Selection.prototype, "setCursorBefore", null);
|
|
11826
|
-
(0,
|
|
11857
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11827
11858
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11828
11859
|
], Selection.prototype, "setCursorIn", null);
|
|
11829
11860
|
|
|
@@ -16841,17 +16872,17 @@ View.defaultOptions = {
|
|
|
16841
16872
|
|
|
16842
16873
|
"use strict";
|
|
16843
16874
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
16844
|
-
/* harmony export */ x: function() { return /* reexport safe */
|
|
16875
|
+
/* harmony export */ x: function() { return /* reexport safe */ _jodit__WEBPACK_IMPORTED_MODULE_0__.x; }
|
|
16845
16876
|
/* harmony export */ });
|
|
16846
16877
|
/* unused harmony export CommitMode */
|
|
16847
|
-
/* harmony import */ var
|
|
16848
|
-
/* harmony import */ var
|
|
16878
|
+
/* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90268);
|
|
16879
|
+
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58588);
|
|
16849
16880
|
/* harmony import */ var _core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67259);
|
|
16850
16881
|
/* harmony import */ var _core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53557);
|
|
16851
16882
|
/* harmony import */ var _modules___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35102);
|
|
16852
16883
|
/* harmony import */ var _styles_icons___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97186);
|
|
16853
|
-
/* harmony import */ var
|
|
16854
|
-
/* harmony import */ var
|
|
16884
|
+
/* harmony import */ var _languages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(459);
|
|
16885
|
+
/* harmony import */ var jodit_plugins_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22743);
|
|
16855
16886
|
/*!
|
|
16856
16887
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
16857
16888
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -16862,6 +16893,7 @@ View.defaultOptions = {
|
|
|
16862
16893
|
* @packageDocumentation
|
|
16863
16894
|
* @module jodit
|
|
16864
16895
|
*/
|
|
16896
|
+
// eslint-disable-next-line simple-import-sort/imports
|
|
16865
16897
|
|
|
16866
16898
|
|
|
16867
16899
|
|
|
@@ -16874,7 +16906,7 @@ View.defaultOptions = {
|
|
|
16874
16906
|
|
|
16875
16907
|
// copy constants in Jodit
|
|
16876
16908
|
Object.keys(_core_constants__WEBPACK_IMPORTED_MODULE_2__).forEach((key) => {
|
|
16877
|
-
|
|
16909
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x[key] = _core_constants__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
16878
16910
|
});
|
|
16879
16911
|
const esFilter = (key) => key !== '__esModule';
|
|
16880
16912
|
// Icons
|
|
@@ -16889,32 +16921,32 @@ Object.keys(_modules___WEBPACK_IMPORTED_MODULE_4__)
|
|
|
16889
16921
|
.forEach((key) => {
|
|
16890
16922
|
// @ts-ignore
|
|
16891
16923
|
const module = _modules___WEBPACK_IMPORTED_MODULE_4__[key];
|
|
16892
|
-
const name = (0,
|
|
16924
|
+
const name = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__/* .isFunction */ .Tn)(module.prototype?.className)
|
|
16893
16925
|
? module.prototype.className()
|
|
16894
16926
|
: key;
|
|
16895
|
-
if (!(0,
|
|
16927
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .Kg)(name)) {
|
|
16896
16928
|
console.warn('Module name must be a string', key);
|
|
16897
16929
|
return;
|
|
16898
16930
|
}
|
|
16899
16931
|
// @ts-ignore
|
|
16900
|
-
|
|
16932
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x.modules[name] = module;
|
|
16901
16933
|
});
|
|
16902
16934
|
// Decorators
|
|
16903
16935
|
Object.keys(_core_decorators__WEBPACK_IMPORTED_MODULE_3__)
|
|
16904
16936
|
.filter(esFilter)
|
|
16905
16937
|
.forEach((key) => {
|
|
16906
16938
|
// @ts-ignore
|
|
16907
|
-
|
|
16939
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x.decorators[key] = _core_decorators__WEBPACK_IMPORTED_MODULE_3__[key];
|
|
16908
16940
|
});
|
|
16909
16941
|
['Confirm', 'Alert', 'Prompt'].forEach((key) => {
|
|
16910
16942
|
// @ts-ignore
|
|
16911
|
-
|
|
16943
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x[key] = _modules___WEBPACK_IMPORTED_MODULE_4__[key];
|
|
16912
16944
|
});
|
|
16913
16945
|
// Languages
|
|
16914
|
-
Object.keys(
|
|
16946
|
+
Object.keys(_languages__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)
|
|
16915
16947
|
.filter(esFilter)
|
|
16916
16948
|
.forEach((key) => {
|
|
16917
|
-
|
|
16949
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x.lang[key] = _languages__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A[key];
|
|
16918
16950
|
});
|
|
16919
16951
|
|
|
16920
16952
|
class CommitMode {
|
|
@@ -23089,6 +23121,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23089
23121
|
}
|
|
23090
23122
|
/**
|
|
23091
23123
|
* Generate formal table martix columns*rows
|
|
23124
|
+
* @param table - Working table
|
|
23092
23125
|
* @param callback - if return false cycle break
|
|
23093
23126
|
*/
|
|
23094
23127
|
formalMatrix(table, callback) {
|
|
@@ -23157,7 +23190,6 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23157
23190
|
* @param line - Insert a new line after/before this
|
|
23158
23191
|
* line contains the selected cell
|
|
23159
23192
|
* @param after - Insert a new line after line contains the selected cell
|
|
23160
|
-
* @param create - Instance of Create class
|
|
23161
23193
|
*/
|
|
23162
23194
|
appendRow(table, line, after) {
|
|
23163
23195
|
return Table.__appendRow(table, line, after, this.j.createInside);
|
|
@@ -23326,13 +23358,36 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23326
23358
|
return Table.__getSelectedBound(table, selectedCells);
|
|
23327
23359
|
}
|
|
23328
23360
|
static __normalizeTable(table) {
|
|
23329
|
-
let i, j, min, not;
|
|
23330
23361
|
const __marked = [], box = Table.__formalMatrix(table);
|
|
23331
|
-
|
|
23332
|
-
|
|
23333
|
-
|
|
23334
|
-
|
|
23335
|
-
for (
|
|
23362
|
+
Table.__removeExtraColspans(box, __marked);
|
|
23363
|
+
Table.__removeExtraRowspans(box, __marked);
|
|
23364
|
+
// remove rowspans and colspans equal 1 and empty class
|
|
23365
|
+
for (let i = 0; i < box.length; i += 1) {
|
|
23366
|
+
for (let j = 0; j < box[i].length; j += 1) {
|
|
23367
|
+
if (box[i][j] === undefined) {
|
|
23368
|
+
continue; // broken table
|
|
23369
|
+
}
|
|
23370
|
+
if (box[i][j].hasAttribute('rowspan') &&
|
|
23371
|
+
box[i][j].rowSpan === 1) {
|
|
23372
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
|
|
23373
|
+
}
|
|
23374
|
+
if (box[i][j].hasAttribute('colspan') &&
|
|
23375
|
+
box[i][j].colSpan === 1) {
|
|
23376
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
|
|
23377
|
+
}
|
|
23378
|
+
if (box[i][j].hasAttribute('class') &&
|
|
23379
|
+
!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
|
|
23380
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
|
|
23381
|
+
}
|
|
23382
|
+
}
|
|
23383
|
+
}
|
|
23384
|
+
Table.__unmark(__marked);
|
|
23385
|
+
}
|
|
23386
|
+
static __removeExtraColspans(box, __marked) {
|
|
23387
|
+
for (let j = 0; j < box[0].length; j += 1) {
|
|
23388
|
+
let min = 1000000;
|
|
23389
|
+
let not = false;
|
|
23390
|
+
for (let i = 0; i < box.length; i += 1) {
|
|
23336
23391
|
if (box[i][j] === undefined) {
|
|
23337
23392
|
continue; // broken table
|
|
23338
23393
|
}
|
|
@@ -23343,7 +23398,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23343
23398
|
min = Math.min(min, box[i][j].colSpan);
|
|
23344
23399
|
}
|
|
23345
23400
|
if (!not) {
|
|
23346
|
-
for (i = 0; i < box.length; i += 1) {
|
|
23401
|
+
for (let i = 0; i < box.length; i += 1) {
|
|
23347
23402
|
if (box[i][j] === undefined) {
|
|
23348
23403
|
continue; // broken table
|
|
23349
23404
|
}
|
|
@@ -23351,10 +23406,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23351
23406
|
}
|
|
23352
23407
|
}
|
|
23353
23408
|
}
|
|
23354
|
-
|
|
23409
|
+
}
|
|
23410
|
+
static __removeExtraRowspans(box, marked) {
|
|
23411
|
+
let i = 0;
|
|
23412
|
+
let j = 0;
|
|
23355
23413
|
for (i = 0; i < box.length; i += 1) {
|
|
23356
|
-
min = 1000000;
|
|
23357
|
-
not = false;
|
|
23414
|
+
let min = 1000000;
|
|
23415
|
+
let not = false;
|
|
23358
23416
|
for (j = 0; j < box[i].length; j += 1) {
|
|
23359
23417
|
if (box[i][j] === undefined) {
|
|
23360
23418
|
continue; // broken table
|
|
@@ -23370,31 +23428,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23370
23428
|
if (box[i][j] === undefined) {
|
|
23371
23429
|
continue; // broken table
|
|
23372
23430
|
}
|
|
23373
|
-
Table.__mark(box[i][j], 'rowspan', box[i][j].rowSpan - min + 1,
|
|
23431
|
+
Table.__mark(box[i][j], 'rowspan', box[i][j].rowSpan - min + 1, marked);
|
|
23374
23432
|
}
|
|
23375
23433
|
}
|
|
23376
23434
|
}
|
|
23377
|
-
// remove rowspans and colspans equal 1 and empty class
|
|
23378
|
-
for (i = 0; i < box.length; i += 1) {
|
|
23379
|
-
for (j = 0; j < box[i].length; j += 1) {
|
|
23380
|
-
if (box[i][j] === undefined) {
|
|
23381
|
-
continue; // broken table
|
|
23382
|
-
}
|
|
23383
|
-
if (box[i][j].hasAttribute('rowspan') &&
|
|
23384
|
-
box[i][j].rowSpan === 1) {
|
|
23385
|
-
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
|
|
23386
|
-
}
|
|
23387
|
-
if (box[i][j].hasAttribute('colspan') &&
|
|
23388
|
-
box[i][j].colSpan === 1) {
|
|
23389
|
-
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
|
|
23390
|
-
}
|
|
23391
|
-
if (box[i][j].hasAttribute('class') &&
|
|
23392
|
-
!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
|
|
23393
|
-
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
|
|
23394
|
-
}
|
|
23395
|
-
}
|
|
23396
|
-
}
|
|
23397
|
-
Table.__unmark(__marked);
|
|
23398
23435
|
}
|
|
23399
23436
|
/**
|
|
23400
23437
|
* Try recalculate all coluns and rows after change
|
|
@@ -24812,34 +24849,7 @@ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
|
|
|
24812
24849
|
}
|
|
24813
24850
|
const promises = [];
|
|
24814
24851
|
if (o.insertImageAsBase64URI) {
|
|
24815
|
-
|
|
24816
|
-
for (i = 0; i < fileList.length; i += 1) {
|
|
24817
|
-
file = fileList[i];
|
|
24818
|
-
if (file && file.type) {
|
|
24819
|
-
const mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
24820
|
-
const extension = mime[1] ? mime[1].toLowerCase() : '';
|
|
24821
|
-
if (o.imagesExtensions.includes(extension)) {
|
|
24822
|
-
const reader = new FileReader();
|
|
24823
|
-
promises.push(uploader.j.async.promise((resolve, reject) => {
|
|
24824
|
-
reader.onerror = reject;
|
|
24825
|
-
reader.onloadend = () => {
|
|
24826
|
-
const resp = {
|
|
24827
|
-
baseurl: '',
|
|
24828
|
-
files: [reader.result],
|
|
24829
|
-
isImages: [true]
|
|
24830
|
-
};
|
|
24831
|
-
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess)
|
|
24832
|
-
? handlerSuccess
|
|
24833
|
-
: o.defaultHandlerSuccess;
|
|
24834
|
-
handler.call(uploader, resp);
|
|
24835
|
-
resolve(resp);
|
|
24836
|
-
};
|
|
24837
|
-
reader.readAsDataURL(file);
|
|
24838
|
-
}));
|
|
24839
|
-
fileList[i] = null;
|
|
24840
|
-
}
|
|
24841
|
-
}
|
|
24842
|
-
}
|
|
24852
|
+
readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
|
|
24843
24853
|
}
|
|
24844
24854
|
fileList = fileList.filter(a => a);
|
|
24845
24855
|
if (fileList.length) {
|
|
@@ -24850,7 +24860,7 @@ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
|
|
|
24850
24860
|
for (let i = 0; i < fileList.length; i += 1) {
|
|
24851
24861
|
file = fileList[i];
|
|
24852
24862
|
if (file) {
|
|
24853
|
-
const hasRealExtension =
|
|
24863
|
+
const hasRealExtension = /\.\w+$/.test(file.name);
|
|
24854
24864
|
const mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
24855
24865
|
const extension = mime && mime[1] ? mime[1].toLowerCase() : '';
|
|
24856
24866
|
let newName = fileList[i].name ||
|
|
@@ -24899,6 +24909,37 @@ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
|
|
|
24899
24909
|
}
|
|
24900
24910
|
return Promise.all(promises);
|
|
24901
24911
|
}
|
|
24912
|
+
function readImagesWithReader(fileList, imagesExtensions, promises, uploader, handlerSuccess, defaultHandlerSuccess) {
|
|
24913
|
+
let file, i;
|
|
24914
|
+
for (i = 0; i < fileList.length; i += 1) {
|
|
24915
|
+
file = fileList[i];
|
|
24916
|
+
if (file && file.type) {
|
|
24917
|
+
const mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
24918
|
+
const extension = mime[1] ? mime[1].toLowerCase() : '';
|
|
24919
|
+
if (!imagesExtensions.includes(extension)) {
|
|
24920
|
+
continue;
|
|
24921
|
+
}
|
|
24922
|
+
const reader = new FileReader();
|
|
24923
|
+
promises.push(uploader.j.async.promise((resolve, reject) => {
|
|
24924
|
+
reader.onerror = reject;
|
|
24925
|
+
reader.onloadend = () => {
|
|
24926
|
+
const resp = {
|
|
24927
|
+
baseurl: '',
|
|
24928
|
+
files: [reader.result],
|
|
24929
|
+
isImages: [true]
|
|
24930
|
+
};
|
|
24931
|
+
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess)
|
|
24932
|
+
? handlerSuccess
|
|
24933
|
+
: defaultHandlerSuccess;
|
|
24934
|
+
handler.call(uploader, resp);
|
|
24935
|
+
resolve(resp);
|
|
24936
|
+
};
|
|
24937
|
+
reader.readAsDataURL(file);
|
|
24938
|
+
}));
|
|
24939
|
+
fileList[i] = null;
|
|
24940
|
+
}
|
|
24941
|
+
}
|
|
24942
|
+
}
|
|
24902
24943
|
|
|
24903
24944
|
|
|
24904
24945
|
/***/ }),
|
|
@@ -26517,7 +26558,7 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin
|
|
|
26517
26558
|
if (jodit.e.fire('backSpaceBeforeCases', backspace, fakeNode)) {
|
|
26518
26559
|
return false;
|
|
26519
26560
|
}
|
|
26520
|
-
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_4__/* .moveNodeInsideStart */ .
|
|
26561
|
+
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_4__/* .moveNodeInsideStart */ .W8)(jodit, fakeNode, backspace);
|
|
26521
26562
|
if (_cases__WEBPACK_IMPORTED_MODULE_6__/* .cases */ .C.some((func) => {
|
|
26522
26563
|
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_8__/* .isFunction */ .T)(func) &&
|
|
26523
26564
|
func(jodit, fakeNode, backspace, mode)) {
|
|
@@ -26777,19 +26818,12 @@ function checkNotCollapsed(jodit) {
|
|
|
26777
26818
|
function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
26778
26819
|
const step = backspace ? -1 : 1;
|
|
26779
26820
|
const anotherSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(fakeNode, !backspace);
|
|
26780
|
-
let sibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(fakeNode, backspace)
|
|
26781
|
-
let
|
|
26782
|
-
|
|
26783
|
-
|
|
26784
|
-
if (!nextSibling &&
|
|
26785
|
-
sibling.parentNode &&
|
|
26786
|
-
sibling.parentNode !== jodit.editor) {
|
|
26787
|
-
nextSibling = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__/* .findMostNestedNeighbor */ .s)(sibling, !backspace, jodit.editor, true);
|
|
26788
|
-
}
|
|
26789
|
-
return nextSibling;
|
|
26790
|
-
};
|
|
26821
|
+
let sibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(fakeNode, backspace);
|
|
26822
|
+
let removeNeighbor = null;
|
|
26823
|
+
let charRemoved = false;
|
|
26824
|
+
let removed;
|
|
26791
26825
|
if (!sibling) {
|
|
26792
|
-
sibling = getNextInlineSibling(fakeNode);
|
|
26826
|
+
sibling = getNextInlineSibling(fakeNode, backspace, jodit.editor);
|
|
26793
26827
|
}
|
|
26794
26828
|
while (sibling && (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(sibling) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isInlineBlock(sibling))) {
|
|
26795
26829
|
while (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isInlineBlock(sibling)) {
|
|
@@ -26799,57 +26833,17 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
26799
26833
|
break;
|
|
26800
26834
|
}
|
|
26801
26835
|
if (sibling.nodeValue?.length) {
|
|
26802
|
-
|
|
26803
|
-
let value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(sibling.nodeValue);
|
|
26804
|
-
const length = value.length;
|
|
26805
|
-
let index = backspace ? length - 1 : 0;
|
|
26806
|
-
if (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26807
|
-
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26808
|
-
index += step;
|
|
26809
|
-
}
|
|
26810
|
-
}
|
|
26811
|
-
removed = value[index];
|
|
26812
|
-
if (value[index + step] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26813
|
-
index += step;
|
|
26814
|
-
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26815
|
-
index += step;
|
|
26816
|
-
}
|
|
26817
|
-
index += backspace ? 1 : -1;
|
|
26818
|
-
}
|
|
26819
|
-
if (backspace && index < 0) {
|
|
26820
|
-
value = [];
|
|
26821
|
-
}
|
|
26822
|
-
else {
|
|
26823
|
-
value = value.slice(backspace ? 0 : index + 1, backspace ? index : length);
|
|
26824
|
-
}
|
|
26825
|
-
if (!anotherSibling ||
|
|
26826
|
-
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(anotherSibling) ||
|
|
26827
|
-
(!backspace ? / $/ : /^ /).test(anotherSibling.nodeValue ?? '') ||
|
|
26828
|
-
!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trimInv)(anotherSibling.nodeValue || '').length) {
|
|
26829
|
-
for (let i = backspace ? value.length - 1 : 0; backspace ? i >= 0 : i < value.length; i += backspace ? -1 : 1) {
|
|
26830
|
-
if (value[i] === ' ') {
|
|
26831
|
-
value[i] = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE;
|
|
26832
|
-
}
|
|
26833
|
-
else {
|
|
26834
|
-
break;
|
|
26835
|
-
}
|
|
26836
|
-
}
|
|
26837
|
-
}
|
|
26838
|
-
sibling.nodeValue = value.join('');
|
|
26836
|
+
removed = tryRemoveChar(sibling, backspace, step, anotherSibling);
|
|
26839
26837
|
}
|
|
26840
26838
|
if (!sibling.nodeValue?.length) {
|
|
26841
26839
|
removeNeighbor = sibling;
|
|
26842
26840
|
}
|
|
26843
26841
|
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isVoid)(removed) && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26842
|
+
checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed, jodit);
|
|
26844
26843
|
charRemoved = true;
|
|
26845
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.after : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.before, sibling, fakeNode);
|
|
26846
|
-
if (mode === 'sentence' ||
|
|
26847
|
-
(mode === 'word' && removed !== ' ' && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE)) {
|
|
26848
|
-
checkRemoveChar(jodit, fakeNode, backspace, mode);
|
|
26849
|
-
}
|
|
26850
26844
|
break;
|
|
26851
26845
|
}
|
|
26852
|
-
const nextSibling = getNextInlineSibling(sibling);
|
|
26846
|
+
const nextSibling = getNextInlineSibling(sibling, backspace, jodit.editor);
|
|
26853
26847
|
if (removeNeighbor) {
|
|
26854
26848
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(removeNeighbor);
|
|
26855
26849
|
removeNeighbor = null;
|
|
@@ -26871,6 +26865,13 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
26871
26865
|
}
|
|
26872
26866
|
return charRemoved;
|
|
26873
26867
|
}
|
|
26868
|
+
function getNextInlineSibling(sibling, backspace, root) {
|
|
26869
|
+
let nextSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(sibling, backspace);
|
|
26870
|
+
if (!nextSibling && sibling.parentNode && sibling.parentNode !== root) {
|
|
26871
|
+
nextSibling = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__/* .findMostNestedNeighbor */ .s)(sibling, !backspace, root, true);
|
|
26872
|
+
}
|
|
26873
|
+
return nextSibling;
|
|
26874
|
+
}
|
|
26874
26875
|
/**
|
|
26875
26876
|
* Helper removes all empty inline parents
|
|
26876
26877
|
*/
|
|
@@ -26895,6 +26896,56 @@ function addBRInsideEmptyBlock(jodit, node) {
|
|
|
26895
26896
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.after(node, jodit.createInside.element('br'));
|
|
26896
26897
|
}
|
|
26897
26898
|
}
|
|
26899
|
+
function tryRemoveChar(sibling, backspace, step, anotherSibling) {
|
|
26900
|
+
// For Unicode escapes
|
|
26901
|
+
let value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(sibling.nodeValue);
|
|
26902
|
+
const length = value.length;
|
|
26903
|
+
let index = backspace ? length - 1 : 0;
|
|
26904
|
+
if (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26905
|
+
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26906
|
+
index += step;
|
|
26907
|
+
}
|
|
26908
|
+
}
|
|
26909
|
+
const removed = value[index];
|
|
26910
|
+
if (value[index + step] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26911
|
+
index += step;
|
|
26912
|
+
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26913
|
+
index += step;
|
|
26914
|
+
}
|
|
26915
|
+
index += backspace ? 1 : -1;
|
|
26916
|
+
}
|
|
26917
|
+
if (backspace && index < 0) {
|
|
26918
|
+
value = [];
|
|
26919
|
+
}
|
|
26920
|
+
else {
|
|
26921
|
+
value = value.slice(backspace ? 0 : index + 1, backspace ? index : length);
|
|
26922
|
+
}
|
|
26923
|
+
replaceSpaceOnNBSP(anotherSibling, backspace, value);
|
|
26924
|
+
sibling.nodeValue = value.join('');
|
|
26925
|
+
return removed;
|
|
26926
|
+
}
|
|
26927
|
+
function replaceSpaceOnNBSP(anotherSibling, backspace, value) {
|
|
26928
|
+
if (!anotherSibling ||
|
|
26929
|
+
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(anotherSibling) ||
|
|
26930
|
+
(!backspace ? / $/ : /^ /).test(anotherSibling.nodeValue ?? '') ||
|
|
26931
|
+
!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trimInv)(anotherSibling.nodeValue || '').length) {
|
|
26932
|
+
for (let i = backspace ? value.length - 1 : 0; backspace ? i >= 0 : i < value.length; i += backspace ? -1 : 1) {
|
|
26933
|
+
if (value[i] === ' ') {
|
|
26934
|
+
value[i] = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE;
|
|
26935
|
+
}
|
|
26936
|
+
else {
|
|
26937
|
+
break;
|
|
26938
|
+
}
|
|
26939
|
+
}
|
|
26940
|
+
}
|
|
26941
|
+
}
|
|
26942
|
+
function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed, jodit) {
|
|
26943
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.after : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.before, sibling, fakeNode);
|
|
26944
|
+
if (mode === 'sentence' ||
|
|
26945
|
+
(mode === 'word' && removed !== ' ' && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE)) {
|
|
26946
|
+
checkRemoveChar(jodit, fakeNode, backspace, mode);
|
|
26947
|
+
}
|
|
26948
|
+
}
|
|
26898
26949
|
|
|
26899
26950
|
|
|
26900
26951
|
/***/ }),
|
|
@@ -26932,7 +26983,7 @@ function checkRemoveContentNotEditable(jodit, fakeNode, backspace) {
|
|
|
26932
26983
|
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isContentEditable(neighbor, jodit.editor)) {
|
|
26933
26984
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.before : jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after, neighbor, fakeNode);
|
|
26934
26985
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(neighbor);
|
|
26935
|
-
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__/* .moveNodeInsideStart */ .
|
|
26986
|
+
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__/* .moveNodeInsideStart */ .W8)(jodit, fakeNode, backspace);
|
|
26936
26987
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit.s.setCursorBefore : jodit.s.setCursorAfter, fakeNode);
|
|
26937
26988
|
return true;
|
|
26938
26989
|
}
|
|
@@ -29788,45 +29839,11 @@ class dragAndDrop extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plug
|
|
|
29788
29839
|
const sel = this.j.s.sel;
|
|
29789
29840
|
const range = this.bufferRange ||
|
|
29790
29841
|
(sel && sel.rangeCount ? sel.getRangeAt(0) : null);
|
|
29791
|
-
|
|
29792
|
-
if (!this.draggable && range) {
|
|
29793
|
-
fragment = this.isCopyMode
|
|
29794
|
-
? range.cloneContents()
|
|
29795
|
-
: range.extractContents();
|
|
29796
|
-
}
|
|
29797
|
-
else if (this.draggable) {
|
|
29798
|
-
if (this.isCopyMode) {
|
|
29799
|
-
const [tagName, field] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, '-is-file') === '1'
|
|
29800
|
-
? ['a', 'href']
|
|
29801
|
-
: ['img', 'src'];
|
|
29802
|
-
fragment = this.j.createInside.element(tagName);
|
|
29803
|
-
fragment.setAttribute(field, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'data-src') ||
|
|
29804
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'src') ||
|
|
29805
|
-
'');
|
|
29806
|
-
if (tagName === 'a') {
|
|
29807
|
-
fragment.textContent = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(fragment, field) || '';
|
|
29808
|
-
}
|
|
29809
|
-
}
|
|
29810
|
-
else {
|
|
29811
|
-
fragment = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.dataBind)(this.draggable, 'target');
|
|
29812
|
-
}
|
|
29813
|
-
}
|
|
29814
|
-
else if (this.getText(event)) {
|
|
29815
|
-
fragment = this.j.createInside.fromHTML(this.getText(event));
|
|
29816
|
-
}
|
|
29842
|
+
const fragment = this.__getWorkFragment(range, event);
|
|
29817
29843
|
sel && sel.removeAllRanges();
|
|
29818
29844
|
this.j.s.insertCursorAtPoint(event.clientX, event.clientY);
|
|
29819
29845
|
if (fragment) {
|
|
29820
|
-
this.
|
|
29821
|
-
if (range && fragment.firstChild && fragment.lastChild) {
|
|
29822
|
-
range.setStartBefore(fragment.firstChild);
|
|
29823
|
-
range.setEndAfter(fragment.lastChild);
|
|
29824
|
-
this.j.s.selectRange(range);
|
|
29825
|
-
this.j.e.fire('synchro');
|
|
29826
|
-
}
|
|
29827
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(fragment, 'img') && this.j.events) {
|
|
29828
|
-
this.j.e.fire('afterInsertImage', fragment);
|
|
29829
|
-
}
|
|
29846
|
+
this.__insertFragment.call(this, fragment, range);
|
|
29830
29847
|
}
|
|
29831
29848
|
event.preventDefault();
|
|
29832
29849
|
event.stopPropagation();
|
|
@@ -29834,6 +29851,47 @@ class dragAndDrop extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plug
|
|
|
29834
29851
|
this.isFragmentFromEditor = false;
|
|
29835
29852
|
this.removeDragListeners();
|
|
29836
29853
|
}
|
|
29854
|
+
__getWorkFragment(range, event) {
|
|
29855
|
+
let fragment = null;
|
|
29856
|
+
if (!this.draggable && range) {
|
|
29857
|
+
fragment = this.isCopyMode
|
|
29858
|
+
? range.cloneContents()
|
|
29859
|
+
: range.extractContents();
|
|
29860
|
+
}
|
|
29861
|
+
else if (this.draggable) {
|
|
29862
|
+
if (this.isCopyMode) {
|
|
29863
|
+
const [tagName, field] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, '-is-file') === '1'
|
|
29864
|
+
? ['a', 'href']
|
|
29865
|
+
: ['img', 'src'];
|
|
29866
|
+
fragment = this.j.createInside.element(tagName);
|
|
29867
|
+
fragment.setAttribute(field, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'data-src') ||
|
|
29868
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'src') ||
|
|
29869
|
+
'');
|
|
29870
|
+
if (tagName === 'a') {
|
|
29871
|
+
fragment.textContent = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(fragment, field) || '';
|
|
29872
|
+
}
|
|
29873
|
+
}
|
|
29874
|
+
else {
|
|
29875
|
+
fragment = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.dataBind)(this.draggable, 'target');
|
|
29876
|
+
}
|
|
29877
|
+
}
|
|
29878
|
+
else if (this.getText(event)) {
|
|
29879
|
+
fragment = this.j.createInside.fromHTML(this.getText(event));
|
|
29880
|
+
}
|
|
29881
|
+
return fragment;
|
|
29882
|
+
}
|
|
29883
|
+
__insertFragment(fragment, range) {
|
|
29884
|
+
this.j.s.insertNode(fragment, false, false);
|
|
29885
|
+
if (range && fragment.firstChild && fragment.lastChild) {
|
|
29886
|
+
range.setStartBefore(fragment.firstChild);
|
|
29887
|
+
range.setEndAfter(fragment.lastChild);
|
|
29888
|
+
this.j.s.selectRange(range);
|
|
29889
|
+
this.j.e.fire('synchro');
|
|
29890
|
+
}
|
|
29891
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(fragment, 'img') && this.j.events) {
|
|
29892
|
+
this.j.e.fire('afterInsertImage', fragment);
|
|
29893
|
+
}
|
|
29894
|
+
}
|
|
29837
29895
|
/** @override */
|
|
29838
29896
|
beforeDestruct() {
|
|
29839
29897
|
this.onDragEnd();
|
|
@@ -35544,35 +35602,7 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
35544
35602
|
if (link) {
|
|
35545
35603
|
url_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'href') || '';
|
|
35546
35604
|
if (modeClassName) {
|
|
35547
|
-
|
|
35548
|
-
case 'input':
|
|
35549
|
-
if (className_input) {
|
|
35550
|
-
className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35551
|
-
}
|
|
35552
|
-
break;
|
|
35553
|
-
case 'select':
|
|
35554
|
-
if (className_select) {
|
|
35555
|
-
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35556
|
-
const option = className_select.options.item(i);
|
|
35557
|
-
if (option) {
|
|
35558
|
-
option.selected = false;
|
|
35559
|
-
}
|
|
35560
|
-
}
|
|
35561
|
-
const classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35562
|
-
classNames.split(' ').forEach(className => {
|
|
35563
|
-
if (className) {
|
|
35564
|
-
for (let i = 0; i < className_select.options.length; i++) {
|
|
35565
|
-
const option = className_select.options.item(i);
|
|
35566
|
-
if (option?.value &&
|
|
35567
|
-
option.value === className) {
|
|
35568
|
-
option.selected = true;
|
|
35569
|
-
}
|
|
35570
|
-
}
|
|
35571
|
-
}
|
|
35572
|
-
});
|
|
35573
|
-
}
|
|
35574
|
-
break;
|
|
35575
|
-
}
|
|
35605
|
+
readClassnames(modeClassName, className_input, link, className_select);
|
|
35576
35606
|
}
|
|
35577
35607
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
35578
35608
|
target_checkbox.checked = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'target') === '_blank';
|
|
@@ -35634,42 +35664,9 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
35634
35664
|
}
|
|
35635
35665
|
links.forEach(a => {
|
|
35636
35666
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'href', url_input.value);
|
|
35637
|
-
|
|
35638
|
-
if (modeClassName === 'input') {
|
|
35639
|
-
if (className_input.value === '' &&
|
|
35640
|
-
a.hasAttribute('class')) {
|
|
35641
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35642
|
-
}
|
|
35643
|
-
if (className_input.value !== '') {
|
|
35644
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', className_input.value);
|
|
35645
|
-
}
|
|
35646
|
-
}
|
|
35647
|
-
else if (modeClassName === 'select') {
|
|
35648
|
-
if (a.hasAttribute('class')) {
|
|
35649
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35650
|
-
}
|
|
35651
|
-
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35652
|
-
const className = className_select.selectedOptions.item(i)?.value;
|
|
35653
|
-
if (className) {
|
|
35654
|
-
a.classList.add(className);
|
|
35655
|
-
}
|
|
35656
|
-
}
|
|
35657
|
-
}
|
|
35658
|
-
}
|
|
35667
|
+
writeClasses(modeClassName, className_input, className_select, a);
|
|
35659
35668
|
if (!isImageContent) {
|
|
35660
|
-
|
|
35661
|
-
if (content_input.value.trim().length) {
|
|
35662
|
-
if (textWasChanged) {
|
|
35663
|
-
newContent = content_input.value;
|
|
35664
|
-
}
|
|
35665
|
-
}
|
|
35666
|
-
else {
|
|
35667
|
-
newContent = url_input.value;
|
|
35668
|
-
}
|
|
35669
|
-
const content = a.textContent;
|
|
35670
|
-
if (newContent !== content) {
|
|
35671
|
-
a.textContent = newContent;
|
|
35672
|
-
}
|
|
35669
|
+
writeImage(a, content_input, textWasChanged, url_input);
|
|
35673
35670
|
}
|
|
35674
35671
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
35675
35672
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'target', target_checkbox.checked ? '_blank' : null);
|
|
@@ -35714,6 +35711,74 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
35714
35711
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
|
|
35715
35712
|
], link.prototype, "__generateForm", null);
|
|
35716
35713
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('link', link);
|
|
35714
|
+
function writeClasses(modeClassName, className_input, className_select, a) {
|
|
35715
|
+
if (modeClassName && (className_input ?? className_select)) {
|
|
35716
|
+
if (modeClassName === 'input') {
|
|
35717
|
+
if (className_input.value === '' && a.hasAttribute('class')) {
|
|
35718
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35719
|
+
}
|
|
35720
|
+
if (className_input.value !== '') {
|
|
35721
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', className_input.value);
|
|
35722
|
+
}
|
|
35723
|
+
}
|
|
35724
|
+
else if (modeClassName === 'select') {
|
|
35725
|
+
if (a.hasAttribute('class')) {
|
|
35726
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35727
|
+
}
|
|
35728
|
+
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35729
|
+
const className = className_select.selectedOptions.item(i)?.value;
|
|
35730
|
+
if (className) {
|
|
35731
|
+
a.classList.add(className);
|
|
35732
|
+
}
|
|
35733
|
+
}
|
|
35734
|
+
}
|
|
35735
|
+
}
|
|
35736
|
+
}
|
|
35737
|
+
function readClassnames(modeClassName, className_input, link, className_select) {
|
|
35738
|
+
switch (modeClassName) {
|
|
35739
|
+
case 'input':
|
|
35740
|
+
if (className_input) {
|
|
35741
|
+
className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35742
|
+
}
|
|
35743
|
+
break;
|
|
35744
|
+
case 'select':
|
|
35745
|
+
if (className_select) {
|
|
35746
|
+
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35747
|
+
const option = className_select.options.item(i);
|
|
35748
|
+
if (option) {
|
|
35749
|
+
option.selected = false;
|
|
35750
|
+
}
|
|
35751
|
+
}
|
|
35752
|
+
const classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35753
|
+
classNames.split(' ').forEach(className => {
|
|
35754
|
+
if (className) {
|
|
35755
|
+
for (let i = 0; i < className_select.options.length; i++) {
|
|
35756
|
+
const option = className_select.options.item(i);
|
|
35757
|
+
if (option?.value && option.value === className) {
|
|
35758
|
+
option.selected = true;
|
|
35759
|
+
}
|
|
35760
|
+
}
|
|
35761
|
+
}
|
|
35762
|
+
});
|
|
35763
|
+
}
|
|
35764
|
+
break;
|
|
35765
|
+
}
|
|
35766
|
+
}
|
|
35767
|
+
function writeImage(a, content_input, textWasChanged, url_input) {
|
|
35768
|
+
let newContent = a.textContent;
|
|
35769
|
+
if (content_input.value.trim().length) {
|
|
35770
|
+
if (textWasChanged) {
|
|
35771
|
+
newContent = content_input.value;
|
|
35772
|
+
}
|
|
35773
|
+
}
|
|
35774
|
+
else {
|
|
35775
|
+
newContent = url_input.value;
|
|
35776
|
+
}
|
|
35777
|
+
const content = a.textContent;
|
|
35778
|
+
if (newContent !== content) {
|
|
35779
|
+
a.textContent = newContent;
|
|
35780
|
+
}
|
|
35781
|
+
}
|
|
35717
35782
|
|
|
35718
35783
|
|
|
35719
35784
|
/***/ }),
|
|
@@ -38556,7 +38621,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
|
|
|
38556
38621
|
/* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
|
|
38557
38622
|
/* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
|
|
38558
38623
|
/* harmony export */ });
|
|
38559
|
-
/* unused harmony export isSelectionWrapper */
|
|
38560
38624
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
|
|
38561
38625
|
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52989);
|
|
38562
38626
|
/*!
|
|
@@ -38578,60 +38642,14 @@ function highlightTextRanges(jodit, rng, restRanges, ci, root) {
|
|
|
38578
38642
|
rng.endContainer.nodeValue == null) {
|
|
38579
38643
|
return;
|
|
38580
38644
|
}
|
|
38581
|
-
if (jodit
|
|
38582
|
-
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38583
|
-
typeof window.Highlight !== 'undefined') {
|
|
38584
|
-
const ranges = [rng, ...restRanges].map(rng => {
|
|
38585
|
-
const range = jodit.selection.createRange();
|
|
38586
|
-
range.setStart(rng.startContainer, rng.startOffset);
|
|
38587
|
-
range.setEnd(rng.endContainer, rng.endOffset);
|
|
38588
|
-
return range;
|
|
38589
|
-
});
|
|
38590
|
-
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38591
|
-
const searchHighlight = new Highlight(...ranges);
|
|
38592
|
-
// @ts-ignore
|
|
38593
|
-
CSS.highlights.clear();
|
|
38594
|
-
// @ts-ignore
|
|
38595
|
-
CSS.highlights.set('jodit-search-result', searchHighlight);
|
|
38596
|
-
restRanges.length = 0;
|
|
38645
|
+
if (checkNativeSelectionMethod(jodit, rng, restRanges)) {
|
|
38597
38646
|
return;
|
|
38598
38647
|
}
|
|
38599
38648
|
const span = ci.element('span', {
|
|
38600
38649
|
[TMP_ATTR]: true
|
|
38601
38650
|
});
|
|
38602
38651
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.markTemporary(span);
|
|
38603
|
-
|
|
38604
|
-
let diff = 0;
|
|
38605
|
-
if (rng.startOffset !== 0) {
|
|
38606
|
-
const text = ci.text(startText.substring(0, rng.startOffset));
|
|
38607
|
-
rng.startContainer.nodeValue = startText.substring(rng.startOffset);
|
|
38608
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.before(rng.startContainer, text);
|
|
38609
|
-
if (rng.startContainer === rng.endContainer) {
|
|
38610
|
-
diff = rng.startOffset;
|
|
38611
|
-
rng.endOffset -= diff;
|
|
38612
|
-
}
|
|
38613
|
-
rng.startOffset = 0;
|
|
38614
|
-
}
|
|
38615
|
-
const endText = rng.endContainer.nodeValue;
|
|
38616
|
-
if (rng.endOffset !== endText.length) {
|
|
38617
|
-
const text = ci.text(endText.substring(rng.endOffset));
|
|
38618
|
-
rng.endContainer.nodeValue = endText.substring(0, rng.endOffset);
|
|
38619
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(rng.endContainer, text);
|
|
38620
|
-
for (const range of restRanges) {
|
|
38621
|
-
if (range.startContainer === rng.endContainer) {
|
|
38622
|
-
range.startContainer = text;
|
|
38623
|
-
range.startOffset = range.startOffset - rng.endOffset - diff;
|
|
38624
|
-
if (range.endContainer === rng.endContainer) {
|
|
38625
|
-
range.endContainer = text;
|
|
38626
|
-
range.endOffset = range.endOffset - rng.endOffset - diff;
|
|
38627
|
-
}
|
|
38628
|
-
}
|
|
38629
|
-
else {
|
|
38630
|
-
break;
|
|
38631
|
-
}
|
|
38632
|
-
}
|
|
38633
|
-
rng.endOffset = rng.endContainer.nodeValue.length;
|
|
38634
|
-
}
|
|
38652
|
+
normalizeRanges(rng, restRanges, ci);
|
|
38635
38653
|
let next = rng.startContainer;
|
|
38636
38654
|
do {
|
|
38637
38655
|
if (!next) {
|
|
@@ -38677,6 +38695,61 @@ function clearSelectionWrappersFromHTML(root) {
|
|
|
38677
38695
|
function isSelectionWrapper(node) {
|
|
38678
38696
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isElement(node) && node.hasAttribute(TMP_ATTR);
|
|
38679
38697
|
}
|
|
38698
|
+
function checkNativeSelectionMethod(jodit, rng, restRanges) {
|
|
38699
|
+
if (jodit.o.search.useCustomHighlightAPI &&
|
|
38700
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38701
|
+
typeof window.Highlight !== 'undefined') {
|
|
38702
|
+
const ranges = [rng, ...restRanges].map(rng => {
|
|
38703
|
+
const range = jodit.selection.createRange();
|
|
38704
|
+
range.setStart(rng.startContainer, rng.startOffset);
|
|
38705
|
+
range.setEnd(rng.endContainer, rng.endOffset);
|
|
38706
|
+
return range;
|
|
38707
|
+
});
|
|
38708
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38709
|
+
const searchHighlight = new Highlight(...ranges);
|
|
38710
|
+
// @ts-ignore
|
|
38711
|
+
CSS.highlights.clear();
|
|
38712
|
+
// @ts-ignore
|
|
38713
|
+
CSS.highlights.set('jodit-search-result', searchHighlight);
|
|
38714
|
+
restRanges.length = 0;
|
|
38715
|
+
return true;
|
|
38716
|
+
}
|
|
38717
|
+
return false;
|
|
38718
|
+
}
|
|
38719
|
+
function normalizeRanges(rng, restRanges, ci) {
|
|
38720
|
+
const startText = rng.startContainer.nodeValue;
|
|
38721
|
+
let diff = 0;
|
|
38722
|
+
if (rng.startOffset !== 0) {
|
|
38723
|
+
const text = ci.text(startText.substring(0, rng.startOffset));
|
|
38724
|
+
rng.startContainer.nodeValue = startText.substring(rng.startOffset);
|
|
38725
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.before(rng.startContainer, text);
|
|
38726
|
+
if (rng.startContainer === rng.endContainer) {
|
|
38727
|
+
diff = rng.startOffset;
|
|
38728
|
+
rng.endOffset -= diff;
|
|
38729
|
+
}
|
|
38730
|
+
rng.startOffset = 0;
|
|
38731
|
+
}
|
|
38732
|
+
const endText = rng.endContainer.nodeValue;
|
|
38733
|
+
if (rng.endOffset !== endText.length) {
|
|
38734
|
+
const text = ci.text(endText.substring(rng.endOffset));
|
|
38735
|
+
rng.endContainer.nodeValue = endText.substring(0, rng.endOffset);
|
|
38736
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(rng.endContainer, text);
|
|
38737
|
+
for (const range of restRanges) {
|
|
38738
|
+
if (range.startContainer === rng.endContainer) {
|
|
38739
|
+
range.startContainer = text;
|
|
38740
|
+
range.startOffset = range.startOffset - rng.endOffset - diff;
|
|
38741
|
+
if (range.endContainer === rng.endContainer) {
|
|
38742
|
+
range.endContainer = text;
|
|
38743
|
+
range.endOffset = range.endOffset - rng.endOffset - diff;
|
|
38744
|
+
}
|
|
38745
|
+
}
|
|
38746
|
+
else {
|
|
38747
|
+
break;
|
|
38748
|
+
}
|
|
38749
|
+
}
|
|
38750
|
+
rng.endOffset = rng.endContainer.nodeValue.length;
|
|
38751
|
+
}
|
|
38752
|
+
}
|
|
38680
38753
|
|
|
38681
38754
|
|
|
38682
38755
|
/***/ }),
|
|
@@ -42852,38 +42925,10 @@ function tableKeyboardNavigation(editor) {
|
|
|
42852
42925
|
.off('.tableKeyboardNavigation')
|
|
42853
42926
|
.on('keydown.tableKeyboardNavigation', (event) => {
|
|
42854
42927
|
const { key } = event;
|
|
42855
|
-
|
|
42856
|
-
return;
|
|
42857
|
-
}
|
|
42858
|
-
const current = editor.s.current();
|
|
42859
|
-
if (!current) {
|
|
42860
|
-
return;
|
|
42861
|
-
}
|
|
42862
|
-
const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.up(current, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isCell, editor.editor);
|
|
42928
|
+
const cell = findCell(editor, key);
|
|
42863
42929
|
if (!cell) {
|
|
42864
42930
|
return;
|
|
42865
42931
|
}
|
|
42866
|
-
const { range } = editor.s;
|
|
42867
|
-
if (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && current !== cell) {
|
|
42868
|
-
const isNextDirection = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN;
|
|
42869
|
-
const hasNext = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.call)(!isNextDirection ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.next, current, elm => key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
|
|
42870
|
-
? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(elm, 'br')
|
|
42871
|
-
: Boolean(elm), cell);
|
|
42872
|
-
if ((!isNextDirection &&
|
|
42873
|
-
(hasNext ||
|
|
42874
|
-
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP &&
|
|
42875
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
42876
|
-
range.startOffset !== 0))) ||
|
|
42877
|
-
(isNextDirection &&
|
|
42878
|
-
(hasNext ||
|
|
42879
|
-
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN &&
|
|
42880
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
42881
|
-
current.nodeValue &&
|
|
42882
|
-
range.startOffset !==
|
|
42883
|
-
current.nodeValue.length)))) {
|
|
42884
|
-
return;
|
|
42885
|
-
}
|
|
42886
|
-
}
|
|
42887
42932
|
const tableModule = editor.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_4__/* .Table */ .X, editor.o);
|
|
42888
42933
|
const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(cell, 'table', editor.editor);
|
|
42889
42934
|
let next = null;
|
|
@@ -42941,6 +42986,40 @@ function tableKeyboardNavigation(editor) {
|
|
|
42941
42986
|
});
|
|
42942
42987
|
}
|
|
42943
42988
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('tableKeyboardNavigation', tableKeyboardNavigation);
|
|
42989
|
+
function findCell(editor, key) {
|
|
42990
|
+
if (!WORK_KEYS.has(key)) {
|
|
42991
|
+
return;
|
|
42992
|
+
}
|
|
42993
|
+
const current = editor.s.current();
|
|
42994
|
+
if (!current) {
|
|
42995
|
+
return;
|
|
42996
|
+
}
|
|
42997
|
+
const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.up(current, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isCell, editor.editor);
|
|
42998
|
+
if (!cell) {
|
|
42999
|
+
return;
|
|
43000
|
+
}
|
|
43001
|
+
const { range } = editor.s;
|
|
43002
|
+
if (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && current !== cell) {
|
|
43003
|
+
const isNextDirection = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN;
|
|
43004
|
+
const hasNext = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.call)(!isNextDirection ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.next, current, elm => key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
|
|
43005
|
+
? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(elm, 'br')
|
|
43006
|
+
: Boolean(elm), cell);
|
|
43007
|
+
if ((!isNextDirection &&
|
|
43008
|
+
(hasNext ||
|
|
43009
|
+
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP &&
|
|
43010
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
43011
|
+
range.startOffset !== 0))) ||
|
|
43012
|
+
(isNextDirection &&
|
|
43013
|
+
(hasNext ||
|
|
43014
|
+
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN &&
|
|
43015
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
43016
|
+
current.nodeValue &&
|
|
43017
|
+
range.startOffset !== current.nodeValue.length)))) {
|
|
43018
|
+
return;
|
|
43019
|
+
}
|
|
43020
|
+
}
|
|
43021
|
+
return cell;
|
|
43022
|
+
}
|
|
42944
43023
|
|
|
42945
43024
|
|
|
42946
43025
|
/***/ }),
|