jodit-pro 4.2.12 → 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/es2015/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
|
*/
|
|
@@ -2443,7 +2443,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2443
2443
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
2444
2444
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
2445
2445
|
*/
|
|
2446
|
-
const APP_VERSION = "4.2.
|
|
2446
|
+
const APP_VERSION = "4.2.13";
|
|
2447
2447
|
// prettier-ignore
|
|
2448
2448
|
const ES = "es2015";
|
|
2449
2449
|
const IS_ES_MODERN = true;
|
|
@@ -10567,10 +10567,14 @@ class Response {
|
|
|
10567
10567
|
|
|
10568
10568
|
"use strict";
|
|
10569
10569
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10570
|
-
/* harmony export */
|
|
10570
|
+
/* harmony export */ Qe: function() { return /* binding */ cursorInTheEdgeOfString; },
|
|
10571
|
+
/* harmony export */ W8: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_2__.W; },
|
|
10572
|
+
/* harmony export */ dY: function() { return /* binding */ findCorrectCurrentNode; }
|
|
10571
10573
|
/* harmony export */ });
|
|
10572
|
-
/* harmony import */ var
|
|
10573
|
-
/* harmony import */ var
|
|
10574
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67259);
|
|
10575
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23545);
|
|
10576
|
+
/* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49967);
|
|
10577
|
+
/* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13088);
|
|
10574
10578
|
/*!
|
|
10575
10579
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
10576
10580
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -10583,6 +10587,55 @@ class Response {
|
|
|
10583
10587
|
|
|
10584
10588
|
|
|
10585
10589
|
|
|
10590
|
+
/**
|
|
10591
|
+
* Check if the cursor is at the edge of the string
|
|
10592
|
+
* @private
|
|
10593
|
+
*/
|
|
10594
|
+
function cursorInTheEdgeOfString(container, offset, start, end) {
|
|
10595
|
+
var _a;
|
|
10596
|
+
const text = ((_a = container.nodeValue) === null || _a === void 0 ? void 0 : _a.length) ? container.nodeValue : '';
|
|
10597
|
+
if (end && text.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_END)(), '').length > offset) {
|
|
10598
|
+
return true;
|
|
10599
|
+
}
|
|
10600
|
+
const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
|
|
10601
|
+
return start && ((inv && inv[0].length < offset) || (!inv && offset > 0));
|
|
10602
|
+
}
|
|
10603
|
+
function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild, child) {
|
|
10604
|
+
node = range.startContainer.childNodes[range.startOffset];
|
|
10605
|
+
if (!node) {
|
|
10606
|
+
node = range.startContainer.childNodes[range.startOffset - 1];
|
|
10607
|
+
rightMode = true;
|
|
10608
|
+
}
|
|
10609
|
+
if (node && isCollapsed && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node)) {
|
|
10610
|
+
// test Current method - Cursor in the left of some SPAN
|
|
10611
|
+
if (!rightMode && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node.previousSibling)) {
|
|
10612
|
+
node = node.previousSibling;
|
|
10613
|
+
}
|
|
10614
|
+
else if (checkChild) {
|
|
10615
|
+
let current = child(node);
|
|
10616
|
+
while (current) {
|
|
10617
|
+
if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current)) {
|
|
10618
|
+
node = current;
|
|
10619
|
+
break;
|
|
10620
|
+
}
|
|
10621
|
+
current = child(current);
|
|
10622
|
+
}
|
|
10623
|
+
}
|
|
10624
|
+
}
|
|
10625
|
+
if (node && !isCollapsed && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node)) {
|
|
10626
|
+
let leftChild = node, rightChild = node;
|
|
10627
|
+
do {
|
|
10628
|
+
leftChild = leftChild.firstChild;
|
|
10629
|
+
rightChild = rightChild.lastChild;
|
|
10630
|
+
} while (leftChild && rightChild && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(leftChild));
|
|
10631
|
+
if (leftChild === rightChild && leftChild && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(leftChild)) {
|
|
10632
|
+
node = leftChild;
|
|
10633
|
+
}
|
|
10634
|
+
}
|
|
10635
|
+
return { node, rightMode };
|
|
10636
|
+
}
|
|
10637
|
+
|
|
10638
|
+
|
|
10586
10639
|
/***/ }),
|
|
10587
10640
|
|
|
10588
10641
|
/***/ 49967:
|
|
@@ -10704,7 +10757,7 @@ function moveTheNodeAlongTheEdgeOutward(node, start, root) {
|
|
|
10704
10757
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10705
10758
|
/* harmony export */ L: function() { return /* binding */ Selection; }
|
|
10706
10759
|
/* harmony export */ });
|
|
10707
|
-
/* harmony import */ var
|
|
10760
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31635);
|
|
10708
10761
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67259);
|
|
10709
10762
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53557);
|
|
10710
10763
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23545);
|
|
@@ -10714,6 +10767,7 @@ function moveTheNodeAlongTheEdgeOutward(node, start, root) {
|
|
|
10714
10767
|
/* 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__);
|
|
10715
10768
|
/* harmony import */ var jodit_core_selection_helpers_move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13088);
|
|
10716
10769
|
/* harmony import */ var _style_commit_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(11232);
|
|
10770
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(92185);
|
|
10717
10771
|
/*!
|
|
10718
10772
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
10719
10773
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -10730,6 +10784,7 @@ function moveTheNodeAlongTheEdgeOutward(node, start, root) {
|
|
|
10730
10784
|
|
|
10731
10785
|
|
|
10732
10786
|
|
|
10787
|
+
|
|
10733
10788
|
class Selection {
|
|
10734
10789
|
constructor(jodit) {
|
|
10735
10790
|
this.jodit = jodit;
|
|
@@ -11115,63 +11170,35 @@ class Selection {
|
|
|
11115
11170
|
* Returns the current element under the cursor inside editor
|
|
11116
11171
|
*/
|
|
11117
11172
|
current(checkChild = true) {
|
|
11118
|
-
if (this.j.getRealMode()
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
}
|
|
11141
|
-
else if (checkChild) {
|
|
11142
|
-
let current = child(node);
|
|
11143
|
-
while (current) {
|
|
11144
|
-
if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(current)) {
|
|
11145
|
-
node = current;
|
|
11146
|
-
break;
|
|
11147
|
-
}
|
|
11148
|
-
current = child(current);
|
|
11149
|
-
}
|
|
11150
|
-
}
|
|
11151
|
-
}
|
|
11152
|
-
if (node && !sel.isCollapsed && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node)) {
|
|
11153
|
-
let leftChild = node, rightChild = node;
|
|
11154
|
-
do {
|
|
11155
|
-
leftChild = leftChild.firstChild;
|
|
11156
|
-
rightChild = rightChild.lastChild;
|
|
11157
|
-
} while (leftChild && rightChild && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(leftChild));
|
|
11158
|
-
if (leftChild === rightChild &&
|
|
11159
|
-
leftChild &&
|
|
11160
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(leftChild)) {
|
|
11161
|
-
node = leftChild;
|
|
11162
|
-
}
|
|
11163
|
-
}
|
|
11164
|
-
}
|
|
11165
|
-
// check - cursor inside editor
|
|
11166
|
-
if (node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.area, node)) {
|
|
11167
|
-
return node;
|
|
11168
|
-
}
|
|
11173
|
+
if (this.j.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_WYSIWYG) {
|
|
11174
|
+
return null;
|
|
11175
|
+
}
|
|
11176
|
+
const sel = this.sel;
|
|
11177
|
+
if (!sel || sel.rangeCount === 0) {
|
|
11178
|
+
return null;
|
|
11179
|
+
}
|
|
11180
|
+
const range = sel.getRangeAt(0);
|
|
11181
|
+
let node = range.startContainer;
|
|
11182
|
+
let rightMode = false;
|
|
11183
|
+
const child = (nd) => rightMode ? nd.lastChild : nd.firstChild;
|
|
11184
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(node, 'br') && sel.isCollapsed) {
|
|
11185
|
+
return node;
|
|
11186
|
+
}
|
|
11187
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node)) {
|
|
11188
|
+
const ret = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__/* .findCorrectCurrentNode */ .dY)(node, range, rightMode, sel.isCollapsed, checkChild, child);
|
|
11189
|
+
node = ret.node;
|
|
11190
|
+
rightMode = ret.rightMode;
|
|
11191
|
+
}
|
|
11192
|
+
// check - cursor inside editor
|
|
11193
|
+
if (node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.area, node)) {
|
|
11194
|
+
return node;
|
|
11169
11195
|
}
|
|
11170
11196
|
return null;
|
|
11171
11197
|
}
|
|
11172
11198
|
/**
|
|
11173
11199
|
* Insert element in editor
|
|
11174
11200
|
*
|
|
11201
|
+
* @param node - Node for insert
|
|
11175
11202
|
* @param insertCursorAfter - After insert, cursor will move after element
|
|
11176
11203
|
* @param fireChange - After insert, editor fire change event. You can prevent this behavior
|
|
11177
11204
|
*/
|
|
@@ -11233,6 +11260,7 @@ class Selection {
|
|
|
11233
11260
|
* Inserts in the current cursor position some HTML snippet
|
|
11234
11261
|
*
|
|
11235
11262
|
* @param html - HTML The text to be inserted into the document
|
|
11263
|
+
* @param insertCursorAfter - After insert, cursor will move after element
|
|
11236
11264
|
* @example
|
|
11237
11265
|
* ```javascript
|
|
11238
11266
|
* parent.s.insertHTML('<img src="image.png"/>');
|
|
@@ -11276,6 +11304,7 @@ class Selection {
|
|
|
11276
11304
|
*
|
|
11277
11305
|
* @param url - URL for image, or HTMLImageElement
|
|
11278
11306
|
* @param styles - If specified, it will be applied <code>$(image).css(styles)</code>
|
|
11307
|
+
* @param defaultWidth - If specified, it will be applied <code>css('width', defaultWidth)</code>
|
|
11279
11308
|
*/
|
|
11280
11309
|
insertImage(url, styles = null, defaultWidth = null) {
|
|
11281
11310
|
const image = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__/* .isString */ .Kg)(url) ? this.j.createInside.element('img') : url;
|
|
@@ -11331,74 +11360,81 @@ class Selection {
|
|
|
11331
11360
|
eachSelection(callback) {
|
|
11332
11361
|
var _a;
|
|
11333
11362
|
const sel = this.sel;
|
|
11334
|
-
if (sel
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
|
|
11341
|
-
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11363
|
+
if (!sel || !sel.rangeCount) {
|
|
11364
|
+
return;
|
|
11365
|
+
}
|
|
11366
|
+
const range = sel.getRangeAt(0);
|
|
11367
|
+
let root = range.commonAncestorContainer;
|
|
11368
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isHTMLElement(root)) {
|
|
11369
|
+
root = root.parentElement;
|
|
11370
|
+
}
|
|
11371
|
+
const nodes = [];
|
|
11372
|
+
const startOffset = range.startOffset;
|
|
11373
|
+
const length = root.childNodes.length;
|
|
11374
|
+
const elementOffset = startOffset < length ? startOffset : length - 1;
|
|
11375
|
+
let start = range.startContainer === this.area
|
|
11376
|
+
? root.childNodes[elementOffset]
|
|
11377
|
+
: range.startContainer;
|
|
11378
|
+
let end = range.endContainer === this.area
|
|
11379
|
+
? root.childNodes[range.endOffset - 1]
|
|
11380
|
+
: range.endContainer;
|
|
11381
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(start) &&
|
|
11382
|
+
start === range.startContainer &&
|
|
11383
|
+
range.startOffset === ((_a = start.nodeValue) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
11384
|
+
start.nextSibling) {
|
|
11385
|
+
start = start.nextSibling;
|
|
11386
|
+
}
|
|
11387
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(end) &&
|
|
11388
|
+
end === range.endContainer &&
|
|
11389
|
+
range.endOffset === 0 &&
|
|
11390
|
+
end.previousSibling) {
|
|
11391
|
+
end = end.previousSibling;
|
|
11392
|
+
}
|
|
11393
|
+
const checkElm = (node) => {
|
|
11394
|
+
if (node &&
|
|
11395
|
+
node !== root &&
|
|
11396
|
+
!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isEmptyTextNode(node) &&
|
|
11397
|
+
!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__/* .isMarker */ .rg)(node)) {
|
|
11398
|
+
nodes.push(node);
|
|
11399
|
+
}
|
|
11400
|
+
};
|
|
11401
|
+
checkElm(start);
|
|
11402
|
+
if (start !== end && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(root, start, true)) {
|
|
11403
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.find(start, node => {
|
|
11404
|
+
checkElm(node);
|
|
11405
|
+
// checks parentElement as well because partial selections are not equal to entire element
|
|
11406
|
+
return (node === end ||
|
|
11407
|
+
(node && node.contains && node.contains(end)));
|
|
11408
|
+
}, root, true, false);
|
|
11409
|
+
}
|
|
11410
|
+
const forEvery = (current) => {
|
|
11411
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(this.j.editor, current, true)) {
|
|
11412
|
+
return;
|
|
11413
|
+
}
|
|
11414
|
+
if (current.nodeName.match(/^(UL|OL)$/)) {
|
|
11415
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(current.childNodes).forEach(forEvery);
|
|
11416
|
+
}
|
|
11417
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(current, 'li')) {
|
|
11418
|
+
if (current.firstChild) {
|
|
11419
|
+
current = current.firstChild;
|
|
11381
11420
|
}
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
else {
|
|
11387
|
-
const currentB = this.j.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE);
|
|
11388
|
-
current.appendChild(currentB);
|
|
11389
|
-
current = currentB;
|
|
11390
|
-
}
|
|
11421
|
+
else {
|
|
11422
|
+
const currentB = this.j.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE);
|
|
11423
|
+
current.appendChild(currentB);
|
|
11424
|
+
current = currentB;
|
|
11391
11425
|
}
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11426
|
+
}
|
|
11427
|
+
callback(current);
|
|
11428
|
+
};
|
|
11429
|
+
if (nodes.length === 0) {
|
|
11430
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isEmptyTextNode(start)) {
|
|
11395
11431
|
nodes.push(start);
|
|
11396
11432
|
}
|
|
11397
|
-
if (
|
|
11433
|
+
if (start.firstChild) {
|
|
11398
11434
|
nodes.push(start.firstChild);
|
|
11399
11435
|
}
|
|
11400
|
-
nodes.forEach(forEvery);
|
|
11401
11436
|
}
|
|
11437
|
+
nodes.forEach(forEvery);
|
|
11402
11438
|
}
|
|
11403
11439
|
/**
|
|
11404
11440
|
* Checks if the cursor is at the end(start) block
|
|
@@ -11410,7 +11446,7 @@ class Selection {
|
|
|
11410
11446
|
* @returns true - the cursor is at the end(start) block, null - cursor somewhere outside
|
|
11411
11447
|
*/
|
|
11412
11448
|
cursorInTheEdge(start, parentBlock, fake = null) {
|
|
11413
|
-
var _a
|
|
11449
|
+
var _a;
|
|
11414
11450
|
const end = !start, range = (_a = this.sel) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
|
|
11415
11451
|
fake !== null && fake !== void 0 ? fake : (fake = this.current(false));
|
|
11416
11452
|
if (!range || !fake || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(parentBlock, fake, true)) {
|
|
@@ -11426,13 +11462,7 @@ class Selection {
|
|
|
11426
11462
|
this.j.e.fire('isInvisibleForCursor', elm) === true));
|
|
11427
11463
|
// check right offset
|
|
11428
11464
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(container)) {
|
|
11429
|
-
|
|
11430
|
-
if (end && text.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_END)(), '').length > offset) {
|
|
11431
|
-
return false;
|
|
11432
|
-
}
|
|
11433
|
-
const inv = (0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP_START)().exec(text);
|
|
11434
|
-
if (start &&
|
|
11435
|
-
((inv && inv[0].length < offset) || (!inv && offset > 0))) {
|
|
11465
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_8__/* .cursorInTheEdgeOfString */ .Qe)(container, offset, start, end)) {
|
|
11436
11466
|
return false;
|
|
11437
11467
|
}
|
|
11438
11468
|
}
|
|
@@ -11521,6 +11551,7 @@ class Selection {
|
|
|
11521
11551
|
}
|
|
11522
11552
|
/**
|
|
11523
11553
|
* Set cursor in the node
|
|
11554
|
+
* @param node - Node element
|
|
11524
11555
|
* @param inStart - set cursor in start of element
|
|
11525
11556
|
*/
|
|
11526
11557
|
setCursorIn(node, inStart = false) {
|
|
@@ -11581,6 +11612,7 @@ class Selection {
|
|
|
11581
11612
|
}
|
|
11582
11613
|
/**
|
|
11583
11614
|
* Select node
|
|
11615
|
+
* @param node - Node element
|
|
11584
11616
|
* @param inward - select all inside
|
|
11585
11617
|
*/
|
|
11586
11618
|
select(node, inward = false) {
|
|
@@ -11855,19 +11887,19 @@ class Selection {
|
|
|
11855
11887
|
return this;
|
|
11856
11888
|
}
|
|
11857
11889
|
}
|
|
11858
|
-
(0,
|
|
11890
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11859
11891
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11860
11892
|
], Selection.prototype, "createRange", null);
|
|
11861
|
-
(0,
|
|
11893
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11862
11894
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11863
11895
|
], Selection.prototype, "focus", null);
|
|
11864
|
-
(0,
|
|
11896
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11865
11897
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11866
11898
|
], Selection.prototype, "setCursorAfter", null);
|
|
11867
|
-
(0,
|
|
11899
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11868
11900
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11869
11901
|
], Selection.prototype, "setCursorBefore", null);
|
|
11870
|
-
(0,
|
|
11902
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
11871
11903
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
11872
11904
|
], Selection.prototype, "setCursorIn", null);
|
|
11873
11905
|
|
|
@@ -16837,17 +16869,17 @@ View.defaultOptions = {
|
|
|
16837
16869
|
|
|
16838
16870
|
"use strict";
|
|
16839
16871
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
16840
|
-
/* harmony export */ x: function() { return /* reexport safe */
|
|
16872
|
+
/* harmony export */ x: function() { return /* reexport safe */ _jodit__WEBPACK_IMPORTED_MODULE_0__.x; }
|
|
16841
16873
|
/* harmony export */ });
|
|
16842
16874
|
/* unused harmony export CommitMode */
|
|
16843
|
-
/* harmony import */ var
|
|
16844
|
-
/* harmony import */ var
|
|
16875
|
+
/* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90268);
|
|
16876
|
+
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58588);
|
|
16845
16877
|
/* harmony import */ var _core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67259);
|
|
16846
16878
|
/* harmony import */ var _core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53557);
|
|
16847
16879
|
/* harmony import */ var _modules___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35102);
|
|
16848
16880
|
/* harmony import */ var _styles_icons___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97186);
|
|
16849
|
-
/* harmony import */ var
|
|
16850
|
-
/* harmony import */ var
|
|
16881
|
+
/* harmony import */ var _languages__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(459);
|
|
16882
|
+
/* harmony import */ var jodit_plugins_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22743);
|
|
16851
16883
|
/*!
|
|
16852
16884
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
16853
16885
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -16858,6 +16890,7 @@ View.defaultOptions = {
|
|
|
16858
16890
|
* @packageDocumentation
|
|
16859
16891
|
* @module jodit
|
|
16860
16892
|
*/
|
|
16893
|
+
// eslint-disable-next-line simple-import-sort/imports
|
|
16861
16894
|
|
|
16862
16895
|
|
|
16863
16896
|
|
|
@@ -16870,7 +16903,7 @@ View.defaultOptions = {
|
|
|
16870
16903
|
|
|
16871
16904
|
// copy constants in Jodit
|
|
16872
16905
|
Object.keys(_core_constants__WEBPACK_IMPORTED_MODULE_2__).forEach((key) => {
|
|
16873
|
-
|
|
16906
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x[key] = _core_constants__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
16874
16907
|
});
|
|
16875
16908
|
const esFilter = (key) => key !== '__esModule';
|
|
16876
16909
|
// Icons
|
|
@@ -16886,32 +16919,32 @@ Object.keys(_modules___WEBPACK_IMPORTED_MODULE_4__)
|
|
|
16886
16919
|
var _a;
|
|
16887
16920
|
// @ts-ignore
|
|
16888
16921
|
const module = _modules___WEBPACK_IMPORTED_MODULE_4__[key];
|
|
16889
|
-
const name = (0,
|
|
16922
|
+
const name = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__/* .isFunction */ .Tn)((_a = module.prototype) === null || _a === void 0 ? void 0 : _a.className)
|
|
16890
16923
|
? module.prototype.className()
|
|
16891
16924
|
: key;
|
|
16892
|
-
if (!(0,
|
|
16925
|
+
if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .Kg)(name)) {
|
|
16893
16926
|
console.warn('Module name must be a string', key);
|
|
16894
16927
|
return;
|
|
16895
16928
|
}
|
|
16896
16929
|
// @ts-ignore
|
|
16897
|
-
|
|
16930
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x.modules[name] = module;
|
|
16898
16931
|
});
|
|
16899
16932
|
// Decorators
|
|
16900
16933
|
Object.keys(_core_decorators__WEBPACK_IMPORTED_MODULE_3__)
|
|
16901
16934
|
.filter(esFilter)
|
|
16902
16935
|
.forEach((key) => {
|
|
16903
16936
|
// @ts-ignore
|
|
16904
|
-
|
|
16937
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x.decorators[key] = _core_decorators__WEBPACK_IMPORTED_MODULE_3__[key];
|
|
16905
16938
|
});
|
|
16906
16939
|
['Confirm', 'Alert', 'Prompt'].forEach((key) => {
|
|
16907
16940
|
// @ts-ignore
|
|
16908
|
-
|
|
16941
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x[key] = _modules___WEBPACK_IMPORTED_MODULE_4__[key];
|
|
16909
16942
|
});
|
|
16910
16943
|
// Languages
|
|
16911
|
-
Object.keys(
|
|
16944
|
+
Object.keys(_languages__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)
|
|
16912
16945
|
.filter(esFilter)
|
|
16913
16946
|
.forEach((key) => {
|
|
16914
|
-
|
|
16947
|
+
_jodit__WEBPACK_IMPORTED_MODULE_0__/* .Jodit */ .x.lang[key] = _languages__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A[key];
|
|
16915
16948
|
});
|
|
16916
16949
|
|
|
16917
16950
|
class CommitMode {
|
|
@@ -23090,6 +23123,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23090
23123
|
}
|
|
23091
23124
|
/**
|
|
23092
23125
|
* Generate formal table martix columns*rows
|
|
23126
|
+
* @param table - Working table
|
|
23093
23127
|
* @param callback - if return false cycle break
|
|
23094
23128
|
*/
|
|
23095
23129
|
formalMatrix(table, callback) {
|
|
@@ -23159,7 +23193,6 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23159
23193
|
* @param line - Insert a new line after/before this
|
|
23160
23194
|
* line contains the selected cell
|
|
23161
23195
|
* @param after - Insert a new line after line contains the selected cell
|
|
23162
|
-
* @param create - Instance of Create class
|
|
23163
23196
|
*/
|
|
23164
23197
|
appendRow(table, line, after) {
|
|
23165
23198
|
return Table.__appendRow(table, line, after, this.j.createInside);
|
|
@@ -23328,13 +23361,36 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23328
23361
|
return Table.__getSelectedBound(table, selectedCells);
|
|
23329
23362
|
}
|
|
23330
23363
|
static __normalizeTable(table) {
|
|
23331
|
-
let i, j, min, not;
|
|
23332
23364
|
const __marked = [], box = Table.__formalMatrix(table);
|
|
23333
|
-
|
|
23334
|
-
|
|
23335
|
-
|
|
23336
|
-
|
|
23337
|
-
for (
|
|
23365
|
+
Table.__removeExtraColspans(box, __marked);
|
|
23366
|
+
Table.__removeExtraRowspans(box, __marked);
|
|
23367
|
+
// remove rowspans and colspans equal 1 and empty class
|
|
23368
|
+
for (let i = 0; i < box.length; i += 1) {
|
|
23369
|
+
for (let j = 0; j < box[i].length; j += 1) {
|
|
23370
|
+
if (box[i][j] === undefined) {
|
|
23371
|
+
continue; // broken table
|
|
23372
|
+
}
|
|
23373
|
+
if (box[i][j].hasAttribute('rowspan') &&
|
|
23374
|
+
box[i][j].rowSpan === 1) {
|
|
23375
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
|
|
23376
|
+
}
|
|
23377
|
+
if (box[i][j].hasAttribute('colspan') &&
|
|
23378
|
+
box[i][j].colSpan === 1) {
|
|
23379
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
|
|
23380
|
+
}
|
|
23381
|
+
if (box[i][j].hasAttribute('class') &&
|
|
23382
|
+
!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
|
|
23383
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
|
|
23384
|
+
}
|
|
23385
|
+
}
|
|
23386
|
+
}
|
|
23387
|
+
Table.__unmark(__marked);
|
|
23388
|
+
}
|
|
23389
|
+
static __removeExtraColspans(box, __marked) {
|
|
23390
|
+
for (let j = 0; j < box[0].length; j += 1) {
|
|
23391
|
+
let min = 1000000;
|
|
23392
|
+
let not = false;
|
|
23393
|
+
for (let i = 0; i < box.length; i += 1) {
|
|
23338
23394
|
if (box[i][j] === undefined) {
|
|
23339
23395
|
continue; // broken table
|
|
23340
23396
|
}
|
|
@@ -23345,7 +23401,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23345
23401
|
min = Math.min(min, box[i][j].colSpan);
|
|
23346
23402
|
}
|
|
23347
23403
|
if (!not) {
|
|
23348
|
-
for (i = 0; i < box.length; i += 1) {
|
|
23404
|
+
for (let i = 0; i < box.length; i += 1) {
|
|
23349
23405
|
if (box[i][j] === undefined) {
|
|
23350
23406
|
continue; // broken table
|
|
23351
23407
|
}
|
|
@@ -23353,10 +23409,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23353
23409
|
}
|
|
23354
23410
|
}
|
|
23355
23411
|
}
|
|
23356
|
-
|
|
23412
|
+
}
|
|
23413
|
+
static __removeExtraRowspans(box, marked) {
|
|
23414
|
+
let i = 0;
|
|
23415
|
+
let j = 0;
|
|
23357
23416
|
for (i = 0; i < box.length; i += 1) {
|
|
23358
|
-
min = 1000000;
|
|
23359
|
-
not = false;
|
|
23417
|
+
let min = 1000000;
|
|
23418
|
+
let not = false;
|
|
23360
23419
|
for (j = 0; j < box[i].length; j += 1) {
|
|
23361
23420
|
if (box[i][j] === undefined) {
|
|
23362
23421
|
continue; // broken table
|
|
@@ -23372,31 +23431,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCom
|
|
|
23372
23431
|
if (box[i][j] === undefined) {
|
|
23373
23432
|
continue; // broken table
|
|
23374
23433
|
}
|
|
23375
|
-
Table.__mark(box[i][j], 'rowspan', box[i][j].rowSpan - min + 1,
|
|
23376
|
-
}
|
|
23377
|
-
}
|
|
23378
|
-
}
|
|
23379
|
-
// remove rowspans and colspans equal 1 and empty class
|
|
23380
|
-
for (i = 0; i < box.length; i += 1) {
|
|
23381
|
-
for (j = 0; j < box[i].length; j += 1) {
|
|
23382
|
-
if (box[i][j] === undefined) {
|
|
23383
|
-
continue; // broken table
|
|
23384
|
-
}
|
|
23385
|
-
if (box[i][j].hasAttribute('rowspan') &&
|
|
23386
|
-
box[i][j].rowSpan === 1) {
|
|
23387
|
-
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
|
|
23388
|
-
}
|
|
23389
|
-
if (box[i][j].hasAttribute('colspan') &&
|
|
23390
|
-
box[i][j].colSpan === 1) {
|
|
23391
|
-
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
|
|
23392
|
-
}
|
|
23393
|
-
if (box[i][j].hasAttribute('class') &&
|
|
23394
|
-
!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
|
|
23395
|
-
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
|
|
23434
|
+
Table.__mark(box[i][j], 'rowspan', box[i][j].rowSpan - min + 1, marked);
|
|
23396
23435
|
}
|
|
23397
23436
|
}
|
|
23398
23437
|
}
|
|
23399
|
-
Table.__unmark(__marked);
|
|
23400
23438
|
}
|
|
23401
23439
|
/**
|
|
23402
23440
|
* Try recalculate all coluns and rows after change
|
|
@@ -24813,34 +24851,7 @@ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
|
|
|
24813
24851
|
}
|
|
24814
24852
|
const promises = [];
|
|
24815
24853
|
if (o.insertImageAsBase64URI) {
|
|
24816
|
-
|
|
24817
|
-
for (i = 0; i < fileList.length; i += 1) {
|
|
24818
|
-
file = fileList[i];
|
|
24819
|
-
if (file && file.type) {
|
|
24820
|
-
const mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
24821
|
-
const extension = mime[1] ? mime[1].toLowerCase() : '';
|
|
24822
|
-
if (o.imagesExtensions.includes(extension)) {
|
|
24823
|
-
const reader = new FileReader();
|
|
24824
|
-
promises.push(uploader.j.async.promise((resolve, reject) => {
|
|
24825
|
-
reader.onerror = reject;
|
|
24826
|
-
reader.onloadend = () => {
|
|
24827
|
-
const resp = {
|
|
24828
|
-
baseurl: '',
|
|
24829
|
-
files: [reader.result],
|
|
24830
|
-
isImages: [true]
|
|
24831
|
-
};
|
|
24832
|
-
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess)
|
|
24833
|
-
? handlerSuccess
|
|
24834
|
-
: o.defaultHandlerSuccess;
|
|
24835
|
-
handler.call(uploader, resp);
|
|
24836
|
-
resolve(resp);
|
|
24837
|
-
};
|
|
24838
|
-
reader.readAsDataURL(file);
|
|
24839
|
-
}));
|
|
24840
|
-
fileList[i] = null;
|
|
24841
|
-
}
|
|
24842
|
-
}
|
|
24843
|
-
}
|
|
24854
|
+
readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
|
|
24844
24855
|
}
|
|
24845
24856
|
fileList = fileList.filter(a => a);
|
|
24846
24857
|
if (fileList.length) {
|
|
@@ -24851,7 +24862,7 @@ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
|
|
|
24851
24862
|
for (let i = 0; i < fileList.length; i += 1) {
|
|
24852
24863
|
file = fileList[i];
|
|
24853
24864
|
if (file) {
|
|
24854
|
-
const hasRealExtension =
|
|
24865
|
+
const hasRealExtension = /\.\w+$/.test(file.name);
|
|
24855
24866
|
const mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
24856
24867
|
const extension = mime && mime[1] ? mime[1].toLowerCase() : '';
|
|
24857
24868
|
let newName = fileList[i].name ||
|
|
@@ -24900,6 +24911,37 @@ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
|
|
|
24900
24911
|
}
|
|
24901
24912
|
return Promise.all(promises);
|
|
24902
24913
|
}
|
|
24914
|
+
function readImagesWithReader(fileList, imagesExtensions, promises, uploader, handlerSuccess, defaultHandlerSuccess) {
|
|
24915
|
+
let file, i;
|
|
24916
|
+
for (i = 0; i < fileList.length; i += 1) {
|
|
24917
|
+
file = fileList[i];
|
|
24918
|
+
if (file && file.type) {
|
|
24919
|
+
const mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
24920
|
+
const extension = mime[1] ? mime[1].toLowerCase() : '';
|
|
24921
|
+
if (!imagesExtensions.includes(extension)) {
|
|
24922
|
+
continue;
|
|
24923
|
+
}
|
|
24924
|
+
const reader = new FileReader();
|
|
24925
|
+
promises.push(uploader.j.async.promise((resolve, reject) => {
|
|
24926
|
+
reader.onerror = reject;
|
|
24927
|
+
reader.onloadend = () => {
|
|
24928
|
+
const resp = {
|
|
24929
|
+
baseurl: '',
|
|
24930
|
+
files: [reader.result],
|
|
24931
|
+
isImages: [true]
|
|
24932
|
+
};
|
|
24933
|
+
const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess)
|
|
24934
|
+
? handlerSuccess
|
|
24935
|
+
: defaultHandlerSuccess;
|
|
24936
|
+
handler.call(uploader, resp);
|
|
24937
|
+
resolve(resp);
|
|
24938
|
+
};
|
|
24939
|
+
reader.readAsDataURL(file);
|
|
24940
|
+
}));
|
|
24941
|
+
fileList[i] = null;
|
|
24942
|
+
}
|
|
24943
|
+
}
|
|
24944
|
+
}
|
|
24903
24945
|
|
|
24904
24946
|
|
|
24905
24947
|
/***/ }),
|
|
@@ -26519,7 +26561,7 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin
|
|
|
26519
26561
|
if (jodit.e.fire('backSpaceBeforeCases', backspace, fakeNode)) {
|
|
26520
26562
|
return false;
|
|
26521
26563
|
}
|
|
26522
|
-
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_4__/* .moveNodeInsideStart */ .
|
|
26564
|
+
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_4__/* .moveNodeInsideStart */ .W8)(jodit, fakeNode, backspace);
|
|
26523
26565
|
if (_cases__WEBPACK_IMPORTED_MODULE_6__/* .cases */ .C.some((func) => {
|
|
26524
26566
|
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_8__/* .isFunction */ .T)(func) &&
|
|
26525
26567
|
func(jodit, fakeNode, backspace, mode)) {
|
|
@@ -26778,22 +26820,15 @@ function checkNotCollapsed(jodit) {
|
|
|
26778
26820
|
* @private
|
|
26779
26821
|
*/
|
|
26780
26822
|
function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
26781
|
-
var _a, _b
|
|
26823
|
+
var _a, _b;
|
|
26782
26824
|
const step = backspace ? -1 : 1;
|
|
26783
26825
|
const anotherSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(fakeNode, !backspace);
|
|
26784
|
-
let sibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(fakeNode, backspace)
|
|
26785
|
-
let
|
|
26786
|
-
|
|
26787
|
-
|
|
26788
|
-
if (!nextSibling &&
|
|
26789
|
-
sibling.parentNode &&
|
|
26790
|
-
sibling.parentNode !== jodit.editor) {
|
|
26791
|
-
nextSibling = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__/* .findMostNestedNeighbor */ .s)(sibling, !backspace, jodit.editor, true);
|
|
26792
|
-
}
|
|
26793
|
-
return nextSibling;
|
|
26794
|
-
};
|
|
26826
|
+
let sibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(fakeNode, backspace);
|
|
26827
|
+
let removeNeighbor = null;
|
|
26828
|
+
let charRemoved = false;
|
|
26829
|
+
let removed;
|
|
26795
26830
|
if (!sibling) {
|
|
26796
|
-
sibling = getNextInlineSibling(fakeNode);
|
|
26831
|
+
sibling = getNextInlineSibling(fakeNode, backspace, jodit.editor);
|
|
26797
26832
|
}
|
|
26798
26833
|
while (sibling && (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(sibling) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isInlineBlock(sibling))) {
|
|
26799
26834
|
while (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isInlineBlock(sibling)) {
|
|
@@ -26803,57 +26838,17 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
26803
26838
|
break;
|
|
26804
26839
|
}
|
|
26805
26840
|
if ((_a = sibling.nodeValue) === null || _a === void 0 ? void 0 : _a.length) {
|
|
26806
|
-
|
|
26807
|
-
let value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(sibling.nodeValue);
|
|
26808
|
-
const length = value.length;
|
|
26809
|
-
let index = backspace ? length - 1 : 0;
|
|
26810
|
-
if (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26811
|
-
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26812
|
-
index += step;
|
|
26813
|
-
}
|
|
26814
|
-
}
|
|
26815
|
-
removed = value[index];
|
|
26816
|
-
if (value[index + step] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26817
|
-
index += step;
|
|
26818
|
-
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26819
|
-
index += step;
|
|
26820
|
-
}
|
|
26821
|
-
index += backspace ? 1 : -1;
|
|
26822
|
-
}
|
|
26823
|
-
if (backspace && index < 0) {
|
|
26824
|
-
value = [];
|
|
26825
|
-
}
|
|
26826
|
-
else {
|
|
26827
|
-
value = value.slice(backspace ? 0 : index + 1, backspace ? index : length);
|
|
26828
|
-
}
|
|
26829
|
-
if (!anotherSibling ||
|
|
26830
|
-
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(anotherSibling) ||
|
|
26831
|
-
(!backspace ? / $/ : /^ /).test((_b = anotherSibling.nodeValue) !== null && _b !== void 0 ? _b : '') ||
|
|
26832
|
-
!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trimInv)(anotherSibling.nodeValue || '').length) {
|
|
26833
|
-
for (let i = backspace ? value.length - 1 : 0; backspace ? i >= 0 : i < value.length; i += backspace ? -1 : 1) {
|
|
26834
|
-
if (value[i] === ' ') {
|
|
26835
|
-
value[i] = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE;
|
|
26836
|
-
}
|
|
26837
|
-
else {
|
|
26838
|
-
break;
|
|
26839
|
-
}
|
|
26840
|
-
}
|
|
26841
|
-
}
|
|
26842
|
-
sibling.nodeValue = value.join('');
|
|
26841
|
+
removed = tryRemoveChar(sibling, backspace, step, anotherSibling);
|
|
26843
26842
|
}
|
|
26844
|
-
if (!((
|
|
26843
|
+
if (!((_b = sibling.nodeValue) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
26845
26844
|
removeNeighbor = sibling;
|
|
26846
26845
|
}
|
|
26847
26846
|
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isVoid)(removed) && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26847
|
+
checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed, jodit);
|
|
26848
26848
|
charRemoved = true;
|
|
26849
|
-
(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);
|
|
26850
|
-
if (mode === 'sentence' ||
|
|
26851
|
-
(mode === 'word' && removed !== ' ' && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE)) {
|
|
26852
|
-
checkRemoveChar(jodit, fakeNode, backspace, mode);
|
|
26853
|
-
}
|
|
26854
26849
|
break;
|
|
26855
26850
|
}
|
|
26856
|
-
const nextSibling = getNextInlineSibling(sibling);
|
|
26851
|
+
const nextSibling = getNextInlineSibling(sibling, backspace, jodit.editor);
|
|
26857
26852
|
if (removeNeighbor) {
|
|
26858
26853
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(removeNeighbor);
|
|
26859
26854
|
removeNeighbor = null;
|
|
@@ -26875,6 +26870,13 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
|
|
|
26875
26870
|
}
|
|
26876
26871
|
return charRemoved;
|
|
26877
26872
|
}
|
|
26873
|
+
function getNextInlineSibling(sibling, backspace, root) {
|
|
26874
|
+
let nextSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.sibling(sibling, backspace);
|
|
26875
|
+
if (!nextSibling && sibling.parentNode && sibling.parentNode !== root) {
|
|
26876
|
+
nextSibling = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__/* .findMostNestedNeighbor */ .s)(sibling, !backspace, root, true);
|
|
26877
|
+
}
|
|
26878
|
+
return nextSibling;
|
|
26879
|
+
}
|
|
26878
26880
|
/**
|
|
26879
26881
|
* Helper removes all empty inline parents
|
|
26880
26882
|
*/
|
|
@@ -26899,6 +26901,57 @@ function addBRInsideEmptyBlock(jodit, node) {
|
|
|
26899
26901
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.after(node, jodit.createInside.element('br'));
|
|
26900
26902
|
}
|
|
26901
26903
|
}
|
|
26904
|
+
function tryRemoveChar(sibling, backspace, step, anotherSibling) {
|
|
26905
|
+
// For Unicode escapes
|
|
26906
|
+
let value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(sibling.nodeValue);
|
|
26907
|
+
const length = value.length;
|
|
26908
|
+
let index = backspace ? length - 1 : 0;
|
|
26909
|
+
if (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26910
|
+
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26911
|
+
index += step;
|
|
26912
|
+
}
|
|
26913
|
+
}
|
|
26914
|
+
const removed = value[index];
|
|
26915
|
+
if (value[index + step] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26916
|
+
index += step;
|
|
26917
|
+
while (value[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE) {
|
|
26918
|
+
index += step;
|
|
26919
|
+
}
|
|
26920
|
+
index += backspace ? 1 : -1;
|
|
26921
|
+
}
|
|
26922
|
+
if (backspace && index < 0) {
|
|
26923
|
+
value = [];
|
|
26924
|
+
}
|
|
26925
|
+
else {
|
|
26926
|
+
value = value.slice(backspace ? 0 : index + 1, backspace ? index : length);
|
|
26927
|
+
}
|
|
26928
|
+
replaceSpaceOnNBSP(anotherSibling, backspace, value);
|
|
26929
|
+
sibling.nodeValue = value.join('');
|
|
26930
|
+
return removed;
|
|
26931
|
+
}
|
|
26932
|
+
function replaceSpaceOnNBSP(anotherSibling, backspace, value) {
|
|
26933
|
+
var _a;
|
|
26934
|
+
if (!anotherSibling ||
|
|
26935
|
+
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(anotherSibling) ||
|
|
26936
|
+
(!backspace ? / $/ : /^ /).test((_a = anotherSibling.nodeValue) !== null && _a !== void 0 ? _a : '') ||
|
|
26937
|
+
!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.trimInv)(anotherSibling.nodeValue || '').length) {
|
|
26938
|
+
for (let i = backspace ? value.length - 1 : 0; backspace ? i >= 0 : i < value.length; i += backspace ? -1 : 1) {
|
|
26939
|
+
if (value[i] === ' ') {
|
|
26940
|
+
value[i] = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE;
|
|
26941
|
+
}
|
|
26942
|
+
else {
|
|
26943
|
+
break;
|
|
26944
|
+
}
|
|
26945
|
+
}
|
|
26946
|
+
}
|
|
26947
|
+
}
|
|
26948
|
+
function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed, jodit) {
|
|
26949
|
+
(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);
|
|
26950
|
+
if (mode === 'sentence' ||
|
|
26951
|
+
(mode === 'word' && removed !== ' ' && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE)) {
|
|
26952
|
+
checkRemoveChar(jodit, fakeNode, backspace, mode);
|
|
26953
|
+
}
|
|
26954
|
+
}
|
|
26902
26955
|
|
|
26903
26956
|
|
|
26904
26957
|
/***/ }),
|
|
@@ -26936,7 +26989,7 @@ function checkRemoveContentNotEditable(jodit, fakeNode, backspace) {
|
|
|
26936
26989
|
!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isContentEditable(neighbor, jodit.editor)) {
|
|
26937
26990
|
(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);
|
|
26938
26991
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.safeRemove(neighbor);
|
|
26939
|
-
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__/* .moveNodeInsideStart */ .
|
|
26992
|
+
(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__/* .moveNodeInsideStart */ .W8)(jodit, fakeNode, backspace);
|
|
26940
26993
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit.s.setCursorBefore : jodit.s.setCursorAfter, fakeNode);
|
|
26941
26994
|
return true;
|
|
26942
26995
|
}
|
|
@@ -29796,45 +29849,11 @@ class dragAndDrop extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plug
|
|
|
29796
29849
|
const sel = this.j.s.sel;
|
|
29797
29850
|
const range = this.bufferRange ||
|
|
29798
29851
|
(sel && sel.rangeCount ? sel.getRangeAt(0) : null);
|
|
29799
|
-
|
|
29800
|
-
if (!this.draggable && range) {
|
|
29801
|
-
fragment = this.isCopyMode
|
|
29802
|
-
? range.cloneContents()
|
|
29803
|
-
: range.extractContents();
|
|
29804
|
-
}
|
|
29805
|
-
else if (this.draggable) {
|
|
29806
|
-
if (this.isCopyMode) {
|
|
29807
|
-
const [tagName, field] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, '-is-file') === '1'
|
|
29808
|
-
? ['a', 'href']
|
|
29809
|
-
: ['img', 'src'];
|
|
29810
|
-
fragment = this.j.createInside.element(tagName);
|
|
29811
|
-
fragment.setAttribute(field, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'data-src') ||
|
|
29812
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'src') ||
|
|
29813
|
-
'');
|
|
29814
|
-
if (tagName === 'a') {
|
|
29815
|
-
fragment.textContent = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(fragment, field) || '';
|
|
29816
|
-
}
|
|
29817
|
-
}
|
|
29818
|
-
else {
|
|
29819
|
-
fragment = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.dataBind)(this.draggable, 'target');
|
|
29820
|
-
}
|
|
29821
|
-
}
|
|
29822
|
-
else if (this.getText(event)) {
|
|
29823
|
-
fragment = this.j.createInside.fromHTML(this.getText(event));
|
|
29824
|
-
}
|
|
29852
|
+
const fragment = this.__getWorkFragment(range, event);
|
|
29825
29853
|
sel && sel.removeAllRanges();
|
|
29826
29854
|
this.j.s.insertCursorAtPoint(event.clientX, event.clientY);
|
|
29827
29855
|
if (fragment) {
|
|
29828
|
-
this.
|
|
29829
|
-
if (range && fragment.firstChild && fragment.lastChild) {
|
|
29830
|
-
range.setStartBefore(fragment.firstChild);
|
|
29831
|
-
range.setEndAfter(fragment.lastChild);
|
|
29832
|
-
this.j.s.selectRange(range);
|
|
29833
|
-
this.j.e.fire('synchro');
|
|
29834
|
-
}
|
|
29835
|
-
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(fragment, 'img') && this.j.events) {
|
|
29836
|
-
this.j.e.fire('afterInsertImage', fragment);
|
|
29837
|
-
}
|
|
29856
|
+
this.__insertFragment.call(this, fragment, range);
|
|
29838
29857
|
}
|
|
29839
29858
|
event.preventDefault();
|
|
29840
29859
|
event.stopPropagation();
|
|
@@ -29842,6 +29861,47 @@ class dragAndDrop extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plug
|
|
|
29842
29861
|
this.isFragmentFromEditor = false;
|
|
29843
29862
|
this.removeDragListeners();
|
|
29844
29863
|
}
|
|
29864
|
+
__getWorkFragment(range, event) {
|
|
29865
|
+
let fragment = null;
|
|
29866
|
+
if (!this.draggable && range) {
|
|
29867
|
+
fragment = this.isCopyMode
|
|
29868
|
+
? range.cloneContents()
|
|
29869
|
+
: range.extractContents();
|
|
29870
|
+
}
|
|
29871
|
+
else if (this.draggable) {
|
|
29872
|
+
if (this.isCopyMode) {
|
|
29873
|
+
const [tagName, field] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, '-is-file') === '1'
|
|
29874
|
+
? ['a', 'href']
|
|
29875
|
+
: ['img', 'src'];
|
|
29876
|
+
fragment = this.j.createInside.element(tagName);
|
|
29877
|
+
fragment.setAttribute(field, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'data-src') ||
|
|
29878
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.draggable, 'src') ||
|
|
29879
|
+
'');
|
|
29880
|
+
if (tagName === 'a') {
|
|
29881
|
+
fragment.textContent = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(fragment, field) || '';
|
|
29882
|
+
}
|
|
29883
|
+
}
|
|
29884
|
+
else {
|
|
29885
|
+
fragment = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.dataBind)(this.draggable, 'target');
|
|
29886
|
+
}
|
|
29887
|
+
}
|
|
29888
|
+
else if (this.getText(event)) {
|
|
29889
|
+
fragment = this.j.createInside.fromHTML(this.getText(event));
|
|
29890
|
+
}
|
|
29891
|
+
return fragment;
|
|
29892
|
+
}
|
|
29893
|
+
__insertFragment(fragment, range) {
|
|
29894
|
+
this.j.s.insertNode(fragment, false, false);
|
|
29895
|
+
if (range && fragment.firstChild && fragment.lastChild) {
|
|
29896
|
+
range.setStartBefore(fragment.firstChild);
|
|
29897
|
+
range.setEndAfter(fragment.lastChild);
|
|
29898
|
+
this.j.s.selectRange(range);
|
|
29899
|
+
this.j.e.fire('synchro');
|
|
29900
|
+
}
|
|
29901
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isTag(fragment, 'img') && this.j.events) {
|
|
29902
|
+
this.j.e.fire('afterInsertImage', fragment);
|
|
29903
|
+
}
|
|
29904
|
+
}
|
|
29845
29905
|
/** @override */
|
|
29846
29906
|
beforeDestruct() {
|
|
29847
29907
|
this.onDragEnd();
|
|
@@ -35574,35 +35634,7 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
35574
35634
|
if (link) {
|
|
35575
35635
|
url_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'href') || '';
|
|
35576
35636
|
if (modeClassName) {
|
|
35577
|
-
|
|
35578
|
-
case 'input':
|
|
35579
|
-
if (className_input) {
|
|
35580
|
-
className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35581
|
-
}
|
|
35582
|
-
break;
|
|
35583
|
-
case 'select':
|
|
35584
|
-
if (className_select) {
|
|
35585
|
-
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35586
|
-
const option = className_select.options.item(i);
|
|
35587
|
-
if (option) {
|
|
35588
|
-
option.selected = false;
|
|
35589
|
-
}
|
|
35590
|
-
}
|
|
35591
|
-
const classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35592
|
-
classNames.split(' ').forEach(className => {
|
|
35593
|
-
if (className) {
|
|
35594
|
-
for (let i = 0; i < className_select.options.length; i++) {
|
|
35595
|
-
const option = className_select.options.item(i);
|
|
35596
|
-
if ((option === null || option === void 0 ? void 0 : option.value) &&
|
|
35597
|
-
option.value === className) {
|
|
35598
|
-
option.selected = true;
|
|
35599
|
-
}
|
|
35600
|
-
}
|
|
35601
|
-
}
|
|
35602
|
-
});
|
|
35603
|
-
}
|
|
35604
|
-
break;
|
|
35605
|
-
}
|
|
35637
|
+
readClassnames(modeClassName, className_input, link, className_select);
|
|
35606
35638
|
}
|
|
35607
35639
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
35608
35640
|
target_checkbox.checked = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'target') === '_blank';
|
|
@@ -35663,44 +35695,10 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
35663
35695
|
links = [link];
|
|
35664
35696
|
}
|
|
35665
35697
|
links.forEach(a => {
|
|
35666
|
-
var _a;
|
|
35667
35698
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'href', url_input.value);
|
|
35668
|
-
|
|
35669
|
-
if (modeClassName === 'input') {
|
|
35670
|
-
if (className_input.value === '' &&
|
|
35671
|
-
a.hasAttribute('class')) {
|
|
35672
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35673
|
-
}
|
|
35674
|
-
if (className_input.value !== '') {
|
|
35675
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', className_input.value);
|
|
35676
|
-
}
|
|
35677
|
-
}
|
|
35678
|
-
else if (modeClassName === 'select') {
|
|
35679
|
-
if (a.hasAttribute('class')) {
|
|
35680
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35681
|
-
}
|
|
35682
|
-
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35683
|
-
const className = (_a = className_select.selectedOptions.item(i)) === null || _a === void 0 ? void 0 : _a.value;
|
|
35684
|
-
if (className) {
|
|
35685
|
-
a.classList.add(className);
|
|
35686
|
-
}
|
|
35687
|
-
}
|
|
35688
|
-
}
|
|
35689
|
-
}
|
|
35699
|
+
writeClasses(modeClassName, className_input, className_select, a);
|
|
35690
35700
|
if (!isImageContent) {
|
|
35691
|
-
|
|
35692
|
-
if (content_input.value.trim().length) {
|
|
35693
|
-
if (textWasChanged) {
|
|
35694
|
-
newContent = content_input.value;
|
|
35695
|
-
}
|
|
35696
|
-
}
|
|
35697
|
-
else {
|
|
35698
|
-
newContent = url_input.value;
|
|
35699
|
-
}
|
|
35700
|
-
const content = a.textContent;
|
|
35701
|
-
if (newContent !== content) {
|
|
35702
|
-
a.textContent = newContent;
|
|
35703
|
-
}
|
|
35701
|
+
writeImage(a, content_input, textWasChanged, url_input);
|
|
35704
35702
|
}
|
|
35705
35703
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
35706
35704
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'target', target_checkbox.checked ? '_blank' : null);
|
|
@@ -35745,6 +35743,75 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
35745
35743
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
|
|
35746
35744
|
], link.prototype, "__generateForm", null);
|
|
35747
35745
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('link', link);
|
|
35746
|
+
function writeClasses(modeClassName, className_input, className_select, a) {
|
|
35747
|
+
var _a;
|
|
35748
|
+
if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
|
|
35749
|
+
if (modeClassName === 'input') {
|
|
35750
|
+
if (className_input.value === '' && a.hasAttribute('class')) {
|
|
35751
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35752
|
+
}
|
|
35753
|
+
if (className_input.value !== '') {
|
|
35754
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', className_input.value);
|
|
35755
|
+
}
|
|
35756
|
+
}
|
|
35757
|
+
else if (modeClassName === 'select') {
|
|
35758
|
+
if (a.hasAttribute('class')) {
|
|
35759
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(a, 'class', null);
|
|
35760
|
+
}
|
|
35761
|
+
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35762
|
+
const className = (_a = className_select.selectedOptions.item(i)) === null || _a === void 0 ? void 0 : _a.value;
|
|
35763
|
+
if (className) {
|
|
35764
|
+
a.classList.add(className);
|
|
35765
|
+
}
|
|
35766
|
+
}
|
|
35767
|
+
}
|
|
35768
|
+
}
|
|
35769
|
+
}
|
|
35770
|
+
function readClassnames(modeClassName, className_input, link, className_select) {
|
|
35771
|
+
switch (modeClassName) {
|
|
35772
|
+
case 'input':
|
|
35773
|
+
if (className_input) {
|
|
35774
|
+
className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35775
|
+
}
|
|
35776
|
+
break;
|
|
35777
|
+
case 'select':
|
|
35778
|
+
if (className_select) {
|
|
35779
|
+
for (let i = 0; i < className_select.selectedOptions.length; i++) {
|
|
35780
|
+
const option = className_select.options.item(i);
|
|
35781
|
+
if (option) {
|
|
35782
|
+
option.selected = false;
|
|
35783
|
+
}
|
|
35784
|
+
}
|
|
35785
|
+
const classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'class') || '';
|
|
35786
|
+
classNames.split(' ').forEach(className => {
|
|
35787
|
+
if (className) {
|
|
35788
|
+
for (let i = 0; i < className_select.options.length; i++) {
|
|
35789
|
+
const option = className_select.options.item(i);
|
|
35790
|
+
if ((option === null || option === void 0 ? void 0 : option.value) && option.value === className) {
|
|
35791
|
+
option.selected = true;
|
|
35792
|
+
}
|
|
35793
|
+
}
|
|
35794
|
+
}
|
|
35795
|
+
});
|
|
35796
|
+
}
|
|
35797
|
+
break;
|
|
35798
|
+
}
|
|
35799
|
+
}
|
|
35800
|
+
function writeImage(a, content_input, textWasChanged, url_input) {
|
|
35801
|
+
let newContent = a.textContent;
|
|
35802
|
+
if (content_input.value.trim().length) {
|
|
35803
|
+
if (textWasChanged) {
|
|
35804
|
+
newContent = content_input.value;
|
|
35805
|
+
}
|
|
35806
|
+
}
|
|
35807
|
+
else {
|
|
35808
|
+
newContent = url_input.value;
|
|
35809
|
+
}
|
|
35810
|
+
const content = a.textContent;
|
|
35811
|
+
if (newContent !== content) {
|
|
35812
|
+
a.textContent = newContent;
|
|
35813
|
+
}
|
|
35814
|
+
}
|
|
35748
35815
|
|
|
35749
35816
|
|
|
35750
35817
|
/***/ }),
|
|
@@ -38593,7 +38660,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.fin
|
|
|
38593
38660
|
/* harmony export */ _B: function() { return /* binding */ highlightTextRanges; },
|
|
38594
38661
|
/* harmony export */ zy: function() { return /* binding */ getSelectionWrappers; }
|
|
38595
38662
|
/* harmony export */ });
|
|
38596
|
-
/* unused harmony export isSelectionWrapper */
|
|
38597
38663
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23545);
|
|
38598
38664
|
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52989);
|
|
38599
38665
|
/*!
|
|
@@ -38615,60 +38681,14 @@ function highlightTextRanges(jodit, rng, restRanges, ci, root) {
|
|
|
38615
38681
|
rng.endContainer.nodeValue == null) {
|
|
38616
38682
|
return;
|
|
38617
38683
|
}
|
|
38618
|
-
if (jodit
|
|
38619
|
-
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38620
|
-
typeof window.Highlight !== 'undefined') {
|
|
38621
|
-
const ranges = [rng, ...restRanges].map(rng => {
|
|
38622
|
-
const range = jodit.selection.createRange();
|
|
38623
|
-
range.setStart(rng.startContainer, rng.startOffset);
|
|
38624
|
-
range.setEnd(rng.endContainer, rng.endOffset);
|
|
38625
|
-
return range;
|
|
38626
|
-
});
|
|
38627
|
-
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38628
|
-
const searchHighlight = new Highlight(...ranges);
|
|
38629
|
-
// @ts-ignore
|
|
38630
|
-
CSS.highlights.clear();
|
|
38631
|
-
// @ts-ignore
|
|
38632
|
-
CSS.highlights.set('jodit-search-result', searchHighlight);
|
|
38633
|
-
restRanges.length = 0;
|
|
38684
|
+
if (checkNativeSelectionMethod(jodit, rng, restRanges)) {
|
|
38634
38685
|
return;
|
|
38635
38686
|
}
|
|
38636
38687
|
const span = ci.element('span', {
|
|
38637
38688
|
[TMP_ATTR]: true
|
|
38638
38689
|
});
|
|
38639
38690
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.markTemporary(span);
|
|
38640
|
-
|
|
38641
|
-
let diff = 0;
|
|
38642
|
-
if (rng.startOffset !== 0) {
|
|
38643
|
-
const text = ci.text(startText.substring(0, rng.startOffset));
|
|
38644
|
-
rng.startContainer.nodeValue = startText.substring(rng.startOffset);
|
|
38645
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.before(rng.startContainer, text);
|
|
38646
|
-
if (rng.startContainer === rng.endContainer) {
|
|
38647
|
-
diff = rng.startOffset;
|
|
38648
|
-
rng.endOffset -= diff;
|
|
38649
|
-
}
|
|
38650
|
-
rng.startOffset = 0;
|
|
38651
|
-
}
|
|
38652
|
-
const endText = rng.endContainer.nodeValue;
|
|
38653
|
-
if (rng.endOffset !== endText.length) {
|
|
38654
|
-
const text = ci.text(endText.substring(rng.endOffset));
|
|
38655
|
-
rng.endContainer.nodeValue = endText.substring(0, rng.endOffset);
|
|
38656
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(rng.endContainer, text);
|
|
38657
|
-
for (const range of restRanges) {
|
|
38658
|
-
if (range.startContainer === rng.endContainer) {
|
|
38659
|
-
range.startContainer = text;
|
|
38660
|
-
range.startOffset = range.startOffset - rng.endOffset - diff;
|
|
38661
|
-
if (range.endContainer === rng.endContainer) {
|
|
38662
|
-
range.endContainer = text;
|
|
38663
|
-
range.endOffset = range.endOffset - rng.endOffset - diff;
|
|
38664
|
-
}
|
|
38665
|
-
}
|
|
38666
|
-
else {
|
|
38667
|
-
break;
|
|
38668
|
-
}
|
|
38669
|
-
}
|
|
38670
|
-
rng.endOffset = rng.endContainer.nodeValue.length;
|
|
38671
|
-
}
|
|
38691
|
+
normalizeRanges(rng, restRanges, ci);
|
|
38672
38692
|
let next = rng.startContainer;
|
|
38673
38693
|
do {
|
|
38674
38694
|
if (!next) {
|
|
@@ -38714,6 +38734,61 @@ function clearSelectionWrappersFromHTML(root) {
|
|
|
38714
38734
|
function isSelectionWrapper(node) {
|
|
38715
38735
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isElement(node) && node.hasAttribute(TMP_ATTR);
|
|
38716
38736
|
}
|
|
38737
|
+
function checkNativeSelectionMethod(jodit, rng, restRanges) {
|
|
38738
|
+
if (jodit.o.search.useCustomHighlightAPI &&
|
|
38739
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38740
|
+
typeof window.Highlight !== 'undefined') {
|
|
38741
|
+
const ranges = [rng, ...restRanges].map(rng => {
|
|
38742
|
+
const range = jodit.selection.createRange();
|
|
38743
|
+
range.setStart(rng.startContainer, rng.startOffset);
|
|
38744
|
+
range.setEnd(rng.endContainer, rng.endOffset);
|
|
38745
|
+
return range;
|
|
38746
|
+
});
|
|
38747
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
38748
|
+
const searchHighlight = new Highlight(...ranges);
|
|
38749
|
+
// @ts-ignore
|
|
38750
|
+
CSS.highlights.clear();
|
|
38751
|
+
// @ts-ignore
|
|
38752
|
+
CSS.highlights.set('jodit-search-result', searchHighlight);
|
|
38753
|
+
restRanges.length = 0;
|
|
38754
|
+
return true;
|
|
38755
|
+
}
|
|
38756
|
+
return false;
|
|
38757
|
+
}
|
|
38758
|
+
function normalizeRanges(rng, restRanges, ci) {
|
|
38759
|
+
const startText = rng.startContainer.nodeValue;
|
|
38760
|
+
let diff = 0;
|
|
38761
|
+
if (rng.startOffset !== 0) {
|
|
38762
|
+
const text = ci.text(startText.substring(0, rng.startOffset));
|
|
38763
|
+
rng.startContainer.nodeValue = startText.substring(rng.startOffset);
|
|
38764
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.before(rng.startContainer, text);
|
|
38765
|
+
if (rng.startContainer === rng.endContainer) {
|
|
38766
|
+
diff = rng.startOffset;
|
|
38767
|
+
rng.endOffset -= diff;
|
|
38768
|
+
}
|
|
38769
|
+
rng.startOffset = 0;
|
|
38770
|
+
}
|
|
38771
|
+
const endText = rng.endContainer.nodeValue;
|
|
38772
|
+
if (rng.endOffset !== endText.length) {
|
|
38773
|
+
const text = ci.text(endText.substring(rng.endOffset));
|
|
38774
|
+
rng.endContainer.nodeValue = endText.substring(0, rng.endOffset);
|
|
38775
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.after(rng.endContainer, text);
|
|
38776
|
+
for (const range of restRanges) {
|
|
38777
|
+
if (range.startContainer === rng.endContainer) {
|
|
38778
|
+
range.startContainer = text;
|
|
38779
|
+
range.startOffset = range.startOffset - rng.endOffset - diff;
|
|
38780
|
+
if (range.endContainer === rng.endContainer) {
|
|
38781
|
+
range.endContainer = text;
|
|
38782
|
+
range.endOffset = range.endOffset - rng.endOffset - diff;
|
|
38783
|
+
}
|
|
38784
|
+
}
|
|
38785
|
+
else {
|
|
38786
|
+
break;
|
|
38787
|
+
}
|
|
38788
|
+
}
|
|
38789
|
+
rng.endOffset = rng.endContainer.nodeValue.length;
|
|
38790
|
+
}
|
|
38791
|
+
}
|
|
38717
38792
|
|
|
38718
38793
|
|
|
38719
38794
|
/***/ }),
|
|
@@ -42929,38 +43004,10 @@ function tableKeyboardNavigation(editor) {
|
|
|
42929
43004
|
.off('.tableKeyboardNavigation')
|
|
42930
43005
|
.on('keydown.tableKeyboardNavigation', (event) => {
|
|
42931
43006
|
const { key } = event;
|
|
42932
|
-
|
|
42933
|
-
return;
|
|
42934
|
-
}
|
|
42935
|
-
const current = editor.s.current();
|
|
42936
|
-
if (!current) {
|
|
42937
|
-
return;
|
|
42938
|
-
}
|
|
42939
|
-
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);
|
|
43007
|
+
const cell = findCell(editor, key);
|
|
42940
43008
|
if (!cell) {
|
|
42941
43009
|
return;
|
|
42942
43010
|
}
|
|
42943
|
-
const { range } = editor.s;
|
|
42944
|
-
if (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && current !== cell) {
|
|
42945
|
-
const isNextDirection = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN;
|
|
42946
|
-
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
|
|
42947
|
-
? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(elm, 'br')
|
|
42948
|
-
: Boolean(elm), cell);
|
|
42949
|
-
if ((!isNextDirection &&
|
|
42950
|
-
(hasNext ||
|
|
42951
|
-
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP &&
|
|
42952
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
42953
|
-
range.startOffset !== 0))) ||
|
|
42954
|
-
(isNextDirection &&
|
|
42955
|
-
(hasNext ||
|
|
42956
|
-
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN &&
|
|
42957
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
42958
|
-
current.nodeValue &&
|
|
42959
|
-
range.startOffset !==
|
|
42960
|
-
current.nodeValue.length)))) {
|
|
42961
|
-
return;
|
|
42962
|
-
}
|
|
42963
|
-
}
|
|
42964
43011
|
const tableModule = editor.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_4__/* .Table */ .X, editor.o);
|
|
42965
43012
|
const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.closest(cell, 'table', editor.editor);
|
|
42966
43013
|
let next = null;
|
|
@@ -43018,6 +43065,40 @@ function tableKeyboardNavigation(editor) {
|
|
|
43018
43065
|
});
|
|
43019
43066
|
}
|
|
43020
43067
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('tableKeyboardNavigation', tableKeyboardNavigation);
|
|
43068
|
+
function findCell(editor, key) {
|
|
43069
|
+
if (!WORK_KEYS.has(key)) {
|
|
43070
|
+
return;
|
|
43071
|
+
}
|
|
43072
|
+
const current = editor.s.current();
|
|
43073
|
+
if (!current) {
|
|
43074
|
+
return;
|
|
43075
|
+
}
|
|
43076
|
+
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);
|
|
43077
|
+
if (!cell) {
|
|
43078
|
+
return;
|
|
43079
|
+
}
|
|
43080
|
+
const { range } = editor.s;
|
|
43081
|
+
if (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && current !== cell) {
|
|
43082
|
+
const isNextDirection = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN;
|
|
43083
|
+
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
|
|
43084
|
+
? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(elm, 'br')
|
|
43085
|
+
: Boolean(elm), cell);
|
|
43086
|
+
if ((!isNextDirection &&
|
|
43087
|
+
(hasNext ||
|
|
43088
|
+
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP &&
|
|
43089
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
43090
|
+
range.startOffset !== 0))) ||
|
|
43091
|
+
(isNextDirection &&
|
|
43092
|
+
(hasNext ||
|
|
43093
|
+
(key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN &&
|
|
43094
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(current) &&
|
|
43095
|
+
current.nodeValue &&
|
|
43096
|
+
range.startOffset !== current.nodeValue.length)))) {
|
|
43097
|
+
return;
|
|
43098
|
+
}
|
|
43099
|
+
}
|
|
43100
|
+
return cell;
|
|
43101
|
+
}
|
|
43021
43102
|
|
|
43022
43103
|
|
|
43023
43104
|
/***/ }),
|