jodit 4.19.6 → 4.19.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +10 -10
- package/es2015/jodit.js +787 -200
- package/es2015/jodit.min.js +10 -10
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +10 -10
- package/es2018/jodit.min.js +10 -10
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +12 -12
- package/es2021/jodit.js +709 -143
- package/es2021/jodit.min.js +12 -12
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +18 -18
- package/es2021.en/jodit.js +709 -143
- package/es2021.en/jodit.min.js +18 -18
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +947 -208
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.d.ts +1 -0
- package/esm/core/constants.js +3 -1
- package/esm/core/helpers/utils/error/error.d.ts +1 -0
- package/esm/core/helpers/utils/error/error.js +4 -1
- package/esm/core/helpers/utils/error/errors/answer-error.d.ts +13 -0
- package/esm/core/helpers/utils/error/errors/answer-error.js +17 -0
- package/esm/core/helpers/utils/error/errors/index.d.ts +1 -0
- package/esm/core/helpers/utils/error/errors/index.js +1 -0
- package/esm/core/request/ajax.d.ts +1 -0
- package/esm/core/request/ajax.js +20 -1
- package/esm/core/selection/style/apply-style.js +31 -2
- package/esm/jodit.js +14 -2
- package/esm/modules/file-browser/data-provider.js +5 -3
- package/esm/modules/uploader/config.js +4 -0
- package/esm/modules/uploader/helpers/send-files.d.ts +2 -2
- package/esm/modules/uploader/helpers/send-files.js +76 -9
- package/esm/modules/uploader/helpers/upload-error.d.ts +15 -0
- package/esm/modules/uploader/helpers/upload-error.js +16 -0
- package/esm/modules/uploader/uploader.js +15 -3
- package/esm/plugins/backspace/cases/check-join-neighbors.js +36 -7
- package/esm/plugins/backspace/cases/check-remove-empty-parent.js +3 -1
- package/esm/plugins/bold/bold.js +4 -1
- package/esm/plugins/delete/delete.d.ts +12 -0
- package/esm/plugins/delete/delete.js +50 -1
- package/esm/plugins/resize-cells/resize-cells.d.ts +25 -1
- package/esm/plugins/resize-cells/resize-cells.js +84 -15
- package/esm/plugins/select/select.d.ts +35 -0
- package/esm/plugins/select/select.js +153 -1
- package/esm/plugins/select-cells/select-cells.d.ts +24 -0
- package/esm/plugins/select-cells/select-cells.js +81 -18
- package/esm/types/style.d.ts +5 -0
- package/esm/types/uploader.d.ts +117 -11
- package/package.json +2 -2
- package/types/core/constants.d.ts +1 -0
- package/types/core/helpers/utils/error/error.d.ts +1 -0
- package/types/core/helpers/utils/error/errors/answer-error.d.ts +13 -0
- package/types/core/helpers/utils/error/errors/index.d.ts +1 -0
- package/types/core/request/ajax.d.ts +1 -0
- package/types/modules/uploader/helpers/send-files.d.ts +2 -2
- package/types/modules/uploader/helpers/upload-error.d.ts +15 -0
- package/types/plugins/delete/delete.d.ts +12 -0
- package/types/plugins/resize-cells/resize-cells.d.ts +25 -1
- package/types/plugins/select/select.d.ts +35 -0
- package/types/plugins/select-cells/select-cells.d.ts +24 -0
- package/types/types/style.d.ts +5 -0
- package/types/types/uploader.d.ts +117 -11
package/es5/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.19.
|
|
4
|
+
* Version: v4.19.8
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -2078,6 +2078,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2078
2078
|
/* harmony export */ CLIPBOARD_ID: function() { return /* binding */ CLIPBOARD_ID; },
|
|
2079
2079
|
/* harmony export */ COMMAND_KEYS: function() { return /* binding */ COMMAND_KEYS; },
|
|
2080
2080
|
/* harmony export */ EMULATE_DBLCLICK_TIMEOUT: function() { return /* binding */ EMULATE_DBLCLICK_TIMEOUT; },
|
|
2081
|
+
/* harmony export */ ERROR_CODE_CONFLICT: function() { return /* binding */ ERROR_CODE_CONFLICT; },
|
|
2081
2082
|
/* harmony export */ ES: function() { return /* binding */ ES; },
|
|
2082
2083
|
/* harmony export */ FAT_MODE: function() { return /* binding */ FAT_MODE; },
|
|
2083
2084
|
/* harmony export */ HOMEPAGE: function() { return /* binding */ HOMEPAGE; },
|
|
@@ -2154,7 +2155,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2154
2155
|
* @packageDocumentation
|
|
2155
2156
|
* @module constants
|
|
2156
2157
|
*/
|
|
2157
|
-
var APP_VERSION = "4.19.
|
|
2158
|
+
var APP_VERSION = "4.19.8";
|
|
2158
2159
|
// prettier-ignore
|
|
2159
2160
|
var ES = "es5";
|
|
2160
2161
|
var IS_ES_MODERN = false;
|
|
@@ -2306,6 +2307,8 @@ var EMULATE_DBLCLICK_TIMEOUT = 300;
|
|
|
2306
2307
|
* ```
|
|
2307
2308
|
*/ var INSERT_ONLY_TEXT = 'insert_only_text';
|
|
2308
2309
|
var SAFE_COUNT_CHANGE_CALL = 10;
|
|
2310
|
+
// Connector answer code for a file name that is already taken (same as the HTTP status)
|
|
2311
|
+
var ERROR_CODE_CONFLICT = 409;
|
|
2309
2312
|
var IS_MAC = typeof globalWindow !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(globalWindow.navigator.platform);
|
|
2310
2313
|
var KEY_ALIASES = {
|
|
2311
2314
|
add: '+',
|
|
@@ -9808,6 +9811,7 @@ var dataBind = function dataBind(elm, key, value) {
|
|
|
9808
9811
|
|
|
9809
9812
|
"use strict";
|
|
9810
9813
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9814
|
+
/* harmony export */ answer: function() { return /* binding */ answer; },
|
|
9811
9815
|
/* harmony export */ connection: function() { return /* binding */ connection; },
|
|
9812
9816
|
/* harmony export */ error: function() { return /* binding */ error; },
|
|
9813
9817
|
/* harmony export */ options: function() { return /* binding */ options; }
|
|
@@ -9831,6 +9835,9 @@ function connection(message) {
|
|
|
9831
9835
|
function options(message) {
|
|
9832
9836
|
return new _errors__WEBPACK_IMPORTED_MODULE_0__.OptionsError(message);
|
|
9833
9837
|
}
|
|
9838
|
+
function answer(message, resp, code) {
|
|
9839
|
+
return new _errors__WEBPACK_IMPORTED_MODULE_0__.AnswerError(message, resp, code);
|
|
9840
|
+
}
|
|
9834
9841
|
|
|
9835
9842
|
|
|
9836
9843
|
/***/ }),
|
|
@@ -9857,6 +9864,48 @@ function options(message) {
|
|
|
9857
9864
|
}
|
|
9858
9865
|
|
|
9859
9866
|
|
|
9867
|
+
/***/ }),
|
|
9868
|
+
|
|
9869
|
+
/***/ 45052:
|
|
9870
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9871
|
+
|
|
9872
|
+
"use strict";
|
|
9873
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9874
|
+
/* harmony export */ AnswerError: function() { return /* binding */ AnswerError; }
|
|
9875
|
+
/* harmony export */ });
|
|
9876
|
+
/* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69262);
|
|
9877
|
+
/* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73104);
|
|
9878
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25045);
|
|
9879
|
+
/* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34918);
|
|
9880
|
+
/* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38574);
|
|
9881
|
+
|
|
9882
|
+
|
|
9883
|
+
|
|
9884
|
+
|
|
9885
|
+
|
|
9886
|
+
/*!
|
|
9887
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
9888
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
9889
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
9890
|
+
*/ /**
|
|
9891
|
+
* @module helpers/utils
|
|
9892
|
+
*/ // A connector refused the request: the answer and its `data.code` stay reachable for the handler
|
|
9893
|
+
var AnswerError = /*#__PURE__*/ function(Error1) {
|
|
9894
|
+
"use strict";
|
|
9895
|
+
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__._)(AnswerError, Error1);
|
|
9896
|
+
function AnswerError(message, answer, code) {
|
|
9897
|
+
(0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, AnswerError);
|
|
9898
|
+
var _this;
|
|
9899
|
+
_this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, AnswerError, [
|
|
9900
|
+
message
|
|
9901
|
+
]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(_this, "answer", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(_this, "code", void 0), _this.answer = answer, _this.code = code;
|
|
9902
|
+
Object.setPrototypeOf(_this, AnswerError.prototype);
|
|
9903
|
+
return _this;
|
|
9904
|
+
}
|
|
9905
|
+
return AnswerError;
|
|
9906
|
+
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_4__._)(Error));
|
|
9907
|
+
|
|
9908
|
+
|
|
9860
9909
|
/***/ }),
|
|
9861
9910
|
|
|
9862
9911
|
/***/ 58250:
|
|
@@ -9903,13 +9952,15 @@ function options(message) {
|
|
|
9903
9952
|
|
|
9904
9953
|
"use strict";
|
|
9905
9954
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9906
|
-
/* harmony export */
|
|
9907
|
-
/* harmony export */
|
|
9955
|
+
/* harmony export */ AnswerError: function() { return /* reexport safe */ _answer_error__WEBPACK_IMPORTED_MODULE_1__.AnswerError; },
|
|
9956
|
+
/* harmony export */ ConnectionError: function() { return /* reexport safe */ _connection_error__WEBPACK_IMPORTED_MODULE_2__.ConnectionError; },
|
|
9957
|
+
/* harmony export */ OptionsError: function() { return /* reexport safe */ _options_error__WEBPACK_IMPORTED_MODULE_3__.OptionsError; },
|
|
9908
9958
|
/* harmony export */ abort: function() { return /* reexport safe */ _abort_error__WEBPACK_IMPORTED_MODULE_0__.abort; }
|
|
9909
9959
|
/* harmony export */ });
|
|
9910
9960
|
/* harmony import */ var _abort_error__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14228);
|
|
9911
|
-
/* harmony import */ var
|
|
9912
|
-
/* harmony import */ var
|
|
9961
|
+
/* harmony import */ var _answer_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45052);
|
|
9962
|
+
/* harmony import */ var _connection_error__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58250);
|
|
9963
|
+
/* harmony import */ var _options_error__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11080);
|
|
9913
9964
|
/*!
|
|
9914
9965
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
9915
9966
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -9921,6 +9972,7 @@ function options(message) {
|
|
|
9921
9972
|
|
|
9922
9973
|
|
|
9923
9974
|
|
|
9975
|
+
|
|
9924
9976
|
/***/ }),
|
|
9925
9977
|
|
|
9926
9978
|
/***/ 11080:
|
|
@@ -9967,9 +10019,11 @@ function options(message) {
|
|
|
9967
10019
|
|
|
9968
10020
|
"use strict";
|
|
9969
10021
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10022
|
+
/* harmony export */ AnswerError: function() { return /* reexport safe */ _errors___WEBPACK_IMPORTED_MODULE_1__.AnswerError; },
|
|
9970
10023
|
/* harmony export */ ConnectionError: function() { return /* reexport safe */ _errors___WEBPACK_IMPORTED_MODULE_1__.ConnectionError; },
|
|
9971
10024
|
/* harmony export */ OptionsError: function() { return /* reexport safe */ _errors___WEBPACK_IMPORTED_MODULE_1__.OptionsError; },
|
|
9972
10025
|
/* harmony export */ abort: function() { return /* reexport safe */ _errors___WEBPACK_IMPORTED_MODULE_1__.abort; },
|
|
10026
|
+
/* harmony export */ answer: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_0__.answer; },
|
|
9973
10027
|
/* harmony export */ connection: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_0__.connection; },
|
|
9974
10028
|
/* harmony export */ error: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_0__.error; },
|
|
9975
10029
|
/* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_0__.options; }
|
|
@@ -10234,6 +10288,7 @@ var isPart = function isPart(node, part) {
|
|
|
10234
10288
|
__webpack_require__.r(__webpack_exports__);
|
|
10235
10289
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10236
10290
|
/* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_27__.$$; },
|
|
10291
|
+
/* harmony export */ AnswerError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.AnswerError; },
|
|
10237
10292
|
/* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
|
|
10238
10293
|
/* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
|
|
10239
10294
|
/* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
|
|
@@ -10245,6 +10300,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10245
10300
|
/* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
|
|
10246
10301
|
/* harmony export */ alignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.alignElement; },
|
|
10247
10302
|
/* harmony export */ alreadyLoadedList: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.alreadyLoadedList; },
|
|
10303
|
+
/* harmony export */ answer: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.answer; },
|
|
10248
10304
|
/* harmony export */ appendScriptAsync: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.appendScriptAsync; },
|
|
10249
10305
|
/* harmony export */ appendStyleAsync: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.appendStyleAsync; },
|
|
10250
10306
|
/* harmony export */ attr: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attr; },
|
|
@@ -12034,6 +12090,26 @@ var Ajax = /*#__PURE__*/ function() {
|
|
|
12034
12090
|
return this;
|
|
12035
12091
|
}
|
|
12036
12092
|
},
|
|
12093
|
+
{
|
|
12094
|
+
key: "__hasAnswerEnvelope",
|
|
12095
|
+
value: // A connector answers an error with its JSON envelope and a real HTTP status (403, 409): the body says why, the reason phrase does not
|
|
12096
|
+
function __hasAnswerEnvelope() {
|
|
12097
|
+
var xhr = this.xhr;
|
|
12098
|
+
if (xhr.responseType && xhr.responseType !== 'text') {
|
|
12099
|
+
return false;
|
|
12100
|
+
}
|
|
12101
|
+
var text = xhr.responseText;
|
|
12102
|
+
if (!text || text[0] !== '{') {
|
|
12103
|
+
return false;
|
|
12104
|
+
}
|
|
12105
|
+
try {
|
|
12106
|
+
var answer = JSON.parse(text);
|
|
12107
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_14__.isPlainObject)(answer) && 'success' in answer;
|
|
12108
|
+
} catch (unused) {
|
|
12109
|
+
return false;
|
|
12110
|
+
}
|
|
12111
|
+
}
|
|
12112
|
+
},
|
|
12037
12113
|
{
|
|
12038
12114
|
key: "send",
|
|
12039
12115
|
value: function send() {
|
|
@@ -12078,7 +12154,7 @@ var Ajax = /*#__PURE__*/ function() {
|
|
|
12078
12154
|
var _this_options_onProgress, _this_options;
|
|
12079
12155
|
(_this_options_onProgress = (_this_options = _this.options).onProgress) === null || _this_options_onProgress === void 0 ? void 0 : _this_options_onProgress.call(_this_options, 10);
|
|
12080
12156
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
|
12081
|
-
if (o.successStatuses.includes(xhr.status)) {
|
|
12157
|
+
if (o.successStatuses.includes(xhr.status) || _this.__hasAnswerEnvelope()) {
|
|
12082
12158
|
onResolve();
|
|
12083
12159
|
} else if (xhr.statusText) {
|
|
12084
12160
|
_this.__isFulfilled = true;
|
|
@@ -15936,9 +16012,11 @@ var WRAP_NODES = new Set([
|
|
|
15936
16012
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15937
16013
|
/* harmony export */ ApplyStyle: function() { return /* binding */ ApplyStyle; }
|
|
15938
16014
|
/* harmony export */ });
|
|
15939
|
-
/* harmony import */ var
|
|
15940
|
-
/* harmony import */ var
|
|
15941
|
-
/* harmony import */ var
|
|
16015
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
16016
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28723);
|
|
16017
|
+
/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51640);
|
|
16018
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(98394);
|
|
16019
|
+
/* harmony import */ var _transactions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78462);
|
|
15942
16020
|
/*!
|
|
15943
16021
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
15944
16022
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -15948,13 +16026,40 @@ var WRAP_NODES = new Set([
|
|
|
15948
16026
|
*/
|
|
15949
16027
|
|
|
15950
16028
|
|
|
16029
|
+
|
|
16030
|
+
|
|
16031
|
+
/**
|
|
16032
|
+
* Take a selected fragment out of the elements its style takes the place
|
|
16033
|
+
* of: one around it is split, so the fragment leaves it, and one in it is
|
|
16034
|
+
* unwrapped
|
|
16035
|
+
*/ function takeOutOf(jodit, font, tags) {
|
|
16036
|
+
var range = jodit.s.createRange();
|
|
16037
|
+
var outer = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
|
|
16038
|
+
while(outer){
|
|
16039
|
+
range.selectNodeContents(outer);
|
|
16040
|
+
range.setEndBefore(font);
|
|
16041
|
+
var before = range.cloneContents();
|
|
16042
|
+
range.selectNodeContents(outer);
|
|
16043
|
+
range.setStartAfter(font);
|
|
16044
|
+
// Split only when there's more in it, as a split leaves empty copies
|
|
16045
|
+
// of the elements between
|
|
16046
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(before) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(range.cloneContents())) {
|
|
16047
|
+
(0,_api__WEBPACK_IMPORTED_MODULE_2__.extractSelectedPart)(outer, font, jodit);
|
|
16048
|
+
}
|
|
16049
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(outer);
|
|
16050
|
+
outer = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
|
|
16051
|
+
}
|
|
16052
|
+
;(0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_1__.$$)(tags.join(','), font).forEach(function(inner) {
|
|
16053
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(inner);
|
|
16054
|
+
});
|
|
16055
|
+
}
|
|
15951
16056
|
/** @internal */ function ApplyStyle(jodit, cs) {
|
|
15952
16057
|
var _editor_firstChild;
|
|
15953
16058
|
var sel = jodit.s, editor = jodit.editor;
|
|
15954
16059
|
(_editor_firstChild = editor.firstChild) === null || _editor_firstChild === void 0 ? void 0 : _editor_firstChild.normalize(); // FF fix for test "commandsTest - Exec command "bold"
|
|
15955
16060
|
var fakes = sel.fakes();
|
|
15956
16061
|
var collapsed = sel.isCollapsed();
|
|
15957
|
-
var mode =
|
|
16062
|
+
var mode = _constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL;
|
|
15958
16063
|
try {
|
|
15959
16064
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
15960
16065
|
try {
|
|
@@ -15962,16 +16067,20 @@ var WRAP_NODES = new Set([
|
|
|
15962
16067
|
// temporary wrapper before the selection is restored in finally.
|
|
15963
16068
|
for(var _iterator = sel.wrapInTagGen(fakes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
15964
16069
|
var font = _step.value;
|
|
16070
|
+
var _cs_options_exclude;
|
|
16071
|
+
if ((_cs_options_exclude = cs.options.exclude) === null || _cs_options_exclude === void 0 ? void 0 : _cs_options_exclude.length) {
|
|
16072
|
+
takeOutOf(jodit, font, cs.options.exclude);
|
|
16073
|
+
}
|
|
15965
16074
|
var state = {
|
|
15966
16075
|
collapsed: collapsed,
|
|
15967
16076
|
mode: mode,
|
|
15968
16077
|
element: font,
|
|
15969
|
-
next:
|
|
16078
|
+
next: _transactions__WEBPACK_IMPORTED_MODULE_4__.states.START,
|
|
15970
16079
|
jodit: jodit,
|
|
15971
16080
|
style: cs
|
|
15972
16081
|
};
|
|
15973
|
-
var machine = new
|
|
15974
|
-
while(!jodit.isInDestruct && machine.getState() !==
|
|
16082
|
+
var machine = new _api__WEBPACK_IMPORTED_MODULE_2__.FiniteStateMachine(_transactions__WEBPACK_IMPORTED_MODULE_4__.states.START, _transactions__WEBPACK_IMPORTED_MODULE_4__.transactions);
|
|
16083
|
+
while(!jodit.isInDestruct && machine.getState() !== _transactions__WEBPACK_IMPORTED_MODULE_4__.states.END){
|
|
15975
16084
|
state = machine.dispatch('exec', state);
|
|
15976
16085
|
}
|
|
15977
16086
|
// The first selected fragment determines how later fragments toggle.
|
|
@@ -22328,6 +22437,20 @@ var FOCUS_EVENTS = new Set([
|
|
|
22328
22437
|
'focusin',
|
|
22329
22438
|
'focusout'
|
|
22330
22439
|
]);
|
|
22440
|
+
var EDITING_KEYS = new Set([
|
|
22441
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.KEY_ENTER,
|
|
22442
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.KEY_BACKSPACE,
|
|
22443
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.KEY_DELETE
|
|
22444
|
+
]);
|
|
22445
|
+
/**
|
|
22446
|
+
* Whether the input method (IME) is using the key. Safari fires the keydown
|
|
22447
|
+
* that ends a composition, as the Enter that confirms Japanese text, after
|
|
22448
|
+
* `compositionend`, and types Korean without one, so `isComposing` is false and
|
|
22449
|
+
* only keyCode 229 tells. Only the keys the editor turns into edits are held
|
|
22450
|
+
* back: the handlers that follow typing still see the rest.
|
|
22451
|
+
*/ function isInputMethodKey(event) {
|
|
22452
|
+
return event.isComposing || event.keyCode === 229 && EDITING_KEYS.has(event.key);
|
|
22453
|
+
}
|
|
22331
22454
|
var __defaultStyleDisplayKey = 'data-jodit-default-style-display';
|
|
22332
22455
|
var __defaultClassesKey = 'data-jodit-default-classes';
|
|
22333
22456
|
var NOEDIT = {
|
|
@@ -23611,7 +23734,7 @@ var Jodit = /*#__PURE__*/ function(ViewWithToolbar) {
|
|
|
23611
23734
|
}
|
|
23612
23735
|
}
|
|
23613
23736
|
var w = _this.ew;
|
|
23614
|
-
if ((0,_swc_helpers_instanceof__WEBPACK_IMPORTED_MODULE_7__._)(event, w.KeyboardEvent) && event
|
|
23737
|
+
if ((0,_swc_helpers_instanceof__WEBPACK_IMPORTED_MODULE_7__._)(event, w.KeyboardEvent) && isInputMethodKey(event)) {
|
|
23615
23738
|
return;
|
|
23616
23739
|
}
|
|
23617
23740
|
if (_this.e && _this.e.fire) {
|
|
@@ -26048,7 +26171,8 @@ var DataProvider = /*#__PURE__*/ function() {
|
|
|
26048
26171
|
return resp.json();
|
|
26049
26172
|
}).then(function(resp) {
|
|
26050
26173
|
if (resp && !_this.isSuccess(resp)) {
|
|
26051
|
-
|
|
26174
|
+
var _resp_data;
|
|
26175
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_16__.answer)(_this.getMessage(resp), resp, (_resp_data = resp.data) === null || _resp_data === void 0 ? void 0 : _resp_data.code);
|
|
26052
26176
|
}
|
|
26053
26177
|
return resp;
|
|
26054
26178
|
});
|
|
@@ -26265,10 +26389,11 @@ var DataProvider = /*#__PURE__*/ function() {
|
|
|
26265
26389
|
var _this = this;
|
|
26266
26390
|
(0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_17__.set)('options.getLocalFileByUrl.data.url', url, this);
|
|
26267
26391
|
return this.get('getLocalFileByUrl').then(function(resp) {
|
|
26392
|
+
var _resp_data;
|
|
26268
26393
|
if (_this.isSuccess(resp)) {
|
|
26269
26394
|
return resp.data;
|
|
26270
26395
|
}
|
|
26271
|
-
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_16__.
|
|
26396
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_16__.answer)(_this.getMessage(resp), resp, (_resp_data = resp.data) === null || _resp_data === void 0 ? void 0 : _resp_data.code);
|
|
26272
26397
|
});
|
|
26273
26398
|
}
|
|
26274
26399
|
},
|
|
@@ -32166,6 +32291,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.uploader = {
|
|
|
32166
32291
|
defaultHandlerError: function defaultHandlerError(e) {
|
|
32167
32292
|
this.j.message.error(e.message);
|
|
32168
32293
|
},
|
|
32294
|
+
promptOnExists: true,
|
|
32295
|
+
promptOnExistsSuggestName: function promptOnExistsSuggestName(name) {
|
|
32296
|
+
return name;
|
|
32297
|
+
},
|
|
32169
32298
|
contentType: function contentType(requestData) {
|
|
32170
32299
|
return this.ow.FormData !== undefined && typeof requestData !== 'string' ? false : 'application/x-www-form-urlencoded; charset=UTF-8';
|
|
32171
32300
|
}
|
|
@@ -32350,9 +32479,16 @@ function processOldBrowserDrag(self, cData, handlerSuccess, handlerError, onFina
|
|
|
32350
32479
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32351
32480
|
/* harmony export */ sendFiles: function() { return /* binding */ sendFiles; }
|
|
32352
32481
|
/* harmony export */ });
|
|
32353
|
-
/* harmony import */ var
|
|
32354
|
-
/* harmony import */ var
|
|
32355
|
-
/* harmony import */ var
|
|
32482
|
+
/* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49376);
|
|
32483
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41411);
|
|
32484
|
+
/* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50684);
|
|
32485
|
+
/* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3233);
|
|
32486
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81937);
|
|
32487
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
|
|
32488
|
+
/* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80512);
|
|
32489
|
+
/* harmony import */ var jodit_modules_dialog_prompt__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74103);
|
|
32490
|
+
/* harmony import */ var jodit_modules_uploader_helpers_send__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77911);
|
|
32491
|
+
/* harmony import */ var jodit_modules_uploader_helpers_upload_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55083);
|
|
32356
32492
|
/*!
|
|
32357
32493
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32358
32494
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32362,85 +32498,200 @@ function processOldBrowserDrag(self, cData, handlerSuccess, handlerError, onFina
|
|
|
32362
32498
|
*/
|
|
32363
32499
|
|
|
32364
32500
|
|
|
32501
|
+
|
|
32502
|
+
|
|
32503
|
+
|
|
32504
|
+
|
|
32505
|
+
|
|
32506
|
+
|
|
32507
|
+
|
|
32365
32508
|
/**
|
|
32366
32509
|
* Send files to server
|
|
32367
|
-
*/ function sendFiles(uploader, files, handlerSuccess, handlerError, process
|
|
32368
|
-
|
|
32369
|
-
|
|
32370
|
-
|
|
32371
|
-
|
|
32372
|
-
|
|
32373
|
-
|
|
32374
|
-
|
|
32375
|
-
|
|
32376
|
-
// Client-side validation hook — returning `false` aborts the upload.
|
|
32377
|
-
// See https://github.com/xdan/jodit/issues/1329
|
|
32378
|
-
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(o.beforeUpload)) {
|
|
32379
|
-
if (o.beforeUpload.call(uploader, fileList) === false) {
|
|
32380
|
-
var err = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.error)('Upload canceled');
|
|
32381
|
-
(handlerError || o.defaultHandlerError).call(uploader, err);
|
|
32382
|
-
return Promise.reject(err);
|
|
32383
|
-
}
|
|
32384
|
-
}
|
|
32385
|
-
var promises = [];
|
|
32386
|
-
if (o.insertImageAsBase64URI) {
|
|
32387
|
-
readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
|
|
32388
|
-
}
|
|
32389
|
-
fileList = fileList.filter(function(a) {
|
|
32390
|
-
return a;
|
|
32391
|
-
});
|
|
32392
|
-
if (fileList.length) {
|
|
32393
|
-
var form = new FormData();
|
|
32394
|
-
form.append(o.pathVariableName, uploader.path);
|
|
32395
|
-
form.append('source', uploader.source);
|
|
32396
|
-
var file;
|
|
32397
|
-
for(var i = 0; i < fileList.length; i += 1){
|
|
32398
|
-
file = fileList[i];
|
|
32399
|
-
if (file) {
|
|
32400
|
-
var hasRealExtension = /\.\w+$/.test(file.name);
|
|
32401
|
-
var mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
32402
|
-
var extension = mime && mime[1] ? mime[1].toLowerCase() : '';
|
|
32403
|
-
var newName = fileList[i].name || Math.random().toString().replace('.', '');
|
|
32404
|
-
if (!hasRealExtension && extension) {
|
|
32405
|
-
var extForReg = extension;
|
|
32406
|
-
if ([
|
|
32407
|
-
'jpeg',
|
|
32408
|
-
'jpg'
|
|
32409
|
-
].includes(extForReg)) {
|
|
32410
|
-
extForReg = 'jpeg|jpg';
|
|
32510
|
+
*/ function sendFiles(uploader, files, handlerSuccess, handlerError, process, // Set when a refused upload is sent again: `beforeUpload` already had its say
|
|
32511
|
+
retryOf) {
|
|
32512
|
+
return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
|
|
32513
|
+
var o, fileList, extraData, plan, e, err, promises, form, file, i, hasRealExtension, mime, extension, newName, extForReg, reEnd, _o_processFileName_call, key, iFile, name;
|
|
32514
|
+
return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_3__._)(this, function(_state) {
|
|
32515
|
+
switch(_state.label){
|
|
32516
|
+
case 0:
|
|
32517
|
+
if (!files) {
|
|
32518
|
+
throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.error)('Need files');
|
|
32411
32519
|
}
|
|
32412
|
-
|
|
32413
|
-
|
|
32414
|
-
|
|
32520
|
+
o = uploader.o;
|
|
32521
|
+
fileList = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(files);
|
|
32522
|
+
if (!fileList.length) {
|
|
32523
|
+
throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.error)('Need files');
|
|
32415
32524
|
}
|
|
32416
|
-
|
|
32417
|
-
|
|
32418
|
-
|
|
32525
|
+
extraData = retryOf === null || retryOf === void 0 ? void 0 : retryOf.data;
|
|
32526
|
+
if (!(!retryOf && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(o.beforeUpload))) return [
|
|
32527
|
+
3,
|
|
32528
|
+
5
|
|
32529
|
+
];
|
|
32530
|
+
_state.label = 1;
|
|
32531
|
+
case 1:
|
|
32532
|
+
_state.trys.push([
|
|
32533
|
+
1,
|
|
32534
|
+
3,
|
|
32535
|
+
,
|
|
32536
|
+
4
|
|
32537
|
+
]);
|
|
32538
|
+
return [
|
|
32539
|
+
4,
|
|
32540
|
+
o.beforeUpload.call(uploader, fileList)
|
|
32541
|
+
];
|
|
32542
|
+
case 2:
|
|
32543
|
+
plan = _state.sent();
|
|
32544
|
+
return [
|
|
32545
|
+
3,
|
|
32546
|
+
4
|
|
32547
|
+
];
|
|
32548
|
+
case 3:
|
|
32549
|
+
e = _state.sent();
|
|
32550
|
+
(handlerError || o.defaultHandlerError).call(uploader, e);
|
|
32551
|
+
throw e;
|
|
32552
|
+
case 4:
|
|
32553
|
+
if (plan === false) {
|
|
32554
|
+
err = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.error)('Upload canceled');
|
|
32555
|
+
(handlerError || o.defaultHandlerError).call(uploader, err);
|
|
32556
|
+
throw err;
|
|
32557
|
+
}
|
|
32558
|
+
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isArray)(plan)) {
|
|
32559
|
+
fileList = plan;
|
|
32560
|
+
} else if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isPlainObject)(plan) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isArray)(plan.files)) {
|
|
32561
|
+
fileList = plan.files;
|
|
32562
|
+
extraData = plan.data;
|
|
32563
|
+
}
|
|
32564
|
+
if (!fileList.length) {
|
|
32565
|
+
return [
|
|
32566
|
+
2,
|
|
32567
|
+
[]
|
|
32568
|
+
];
|
|
32569
|
+
}
|
|
32570
|
+
_state.label = 5;
|
|
32571
|
+
case 5:
|
|
32572
|
+
promises = [];
|
|
32573
|
+
if (o.insertImageAsBase64URI) {
|
|
32574
|
+
readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
|
|
32575
|
+
}
|
|
32576
|
+
fileList = fileList.filter(function(a) {
|
|
32577
|
+
return a;
|
|
32578
|
+
});
|
|
32579
|
+
if (fileList.length) {
|
|
32580
|
+
form = new FormData();
|
|
32581
|
+
form.append(o.pathVariableName, uploader.path);
|
|
32582
|
+
form.append('source', uploader.source);
|
|
32583
|
+
;
|
|
32584
|
+
for(i = 0; i < fileList.length; i += 1){
|
|
32585
|
+
file = fileList[i];
|
|
32586
|
+
if (file) {
|
|
32587
|
+
hasRealExtension = /\.\w+$/.test(file.name);
|
|
32588
|
+
mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
32589
|
+
extension = mime && mime[1] ? mime[1].toLowerCase() : '';
|
|
32590
|
+
newName = fileList[i].name || Math.random().toString().replace('.', '');
|
|
32591
|
+
if (!hasRealExtension && extension) {
|
|
32592
|
+
extForReg = extension;
|
|
32593
|
+
if ([
|
|
32594
|
+
'jpeg',
|
|
32595
|
+
'jpg'
|
|
32596
|
+
].includes(extForReg)) {
|
|
32597
|
+
extForReg = 'jpeg|jpg';
|
|
32598
|
+
}
|
|
32599
|
+
reEnd = new RegExp('.(' + extForReg + ')$', 'i');
|
|
32600
|
+
if (!reEnd.test(newName)) {
|
|
32601
|
+
newName += '.' + extension;
|
|
32602
|
+
}
|
|
32603
|
+
}
|
|
32604
|
+
_o_processFileName_call = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_2__._)(o.processFileName.call(uploader, o.filesVariableName(i), fileList[i], newName), 3), key = _o_processFileName_call[0], iFile = _o_processFileName_call[1], name = _o_processFileName_call[2];
|
|
32605
|
+
form.append(key, iFile, name);
|
|
32606
|
+
}
|
|
32607
|
+
}
|
|
32608
|
+
if (process) {
|
|
32609
|
+
process(form);
|
|
32610
|
+
}
|
|
32611
|
+
if (o.data && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isPlainObject)(o.data)) {
|
|
32612
|
+
Object.keys(o.data).forEach(function(key) {
|
|
32613
|
+
form.append(key, o.data[key]);
|
|
32614
|
+
});
|
|
32615
|
+
}
|
|
32616
|
+
if (extraData) {
|
|
32617
|
+
Object.keys(extraData).forEach(function(key) {
|
|
32618
|
+
form.append(key, extraData[key]);
|
|
32619
|
+
});
|
|
32620
|
+
}
|
|
32621
|
+
o.prepareData.call(uploader, form);
|
|
32622
|
+
promises.push((0,jodit_modules_uploader_helpers_send__WEBPACK_IMPORTED_MODULE_8__.send)(uploader, form).then(function(resp) {
|
|
32623
|
+
if (o.isSuccess.call(uploader, resp)) {
|
|
32624
|
+
var handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
|
|
32625
|
+
handler.call(uploader, o.process.call(uploader, resp));
|
|
32626
|
+
return resp;
|
|
32627
|
+
}
|
|
32628
|
+
var err = new jodit_modules_uploader_helpers_upload_error__WEBPACK_IMPORTED_MODULE_9__.UploadError(o.getMessage.call(uploader, resp), resp, fileList, function(plan) {
|
|
32629
|
+
var _ref;
|
|
32630
|
+
return sendFiles(uploader, (_ref = plan === null || plan === void 0 ? void 0 : plan.files) !== null && _ref !== void 0 ? _ref : fileList, handlerSuccess, handlerError, process, {
|
|
32631
|
+
data: (0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, extraData, plan === null || plan === void 0 ? void 0 : plan.data)
|
|
32632
|
+
});
|
|
32633
|
+
});
|
|
32634
|
+
// A taken name is part of the upload, not a failure: ask for another one first
|
|
32635
|
+
if (err.code === jodit_core_constants__WEBPACK_IMPORTED_MODULE_4__.ERROR_CODE_CONFLICT && o.promptOnExists) {
|
|
32636
|
+
return askAnotherName(uploader, err);
|
|
32637
|
+
}
|
|
32638
|
+
var handler1 = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
|
|
32639
|
+
handler1.call(uploader, err);
|
|
32640
|
+
return resp;
|
|
32641
|
+
}).then(function() {
|
|
32642
|
+
uploader.j.events && uploader.j.e.fire('filesWereUploaded');
|
|
32643
|
+
}));
|
|
32644
|
+
}
|
|
32645
|
+
return [
|
|
32646
|
+
2,
|
|
32647
|
+
Promise.all(promises)
|
|
32648
|
+
];
|
|
32419
32649
|
}
|
|
32420
|
-
}
|
|
32421
|
-
|
|
32422
|
-
|
|
32423
|
-
|
|
32424
|
-
|
|
32425
|
-
|
|
32426
|
-
|
|
32650
|
+
});
|
|
32651
|
+
})();
|
|
32652
|
+
}
|
|
32653
|
+
function askAnotherName(uploader, err) {
|
|
32654
|
+
var files = err.files;
|
|
32655
|
+
// A batch is refused as a whole (the connector saved nothing) and the answer does not say which name is taken,
|
|
32656
|
+
// so the files go again one by one: the free ones are simply stored, the taken one answers 409 alone and gets its prompt
|
|
32657
|
+
if (files.length > 1) {
|
|
32658
|
+
return files.reduce(function(chain, file) {
|
|
32659
|
+
return chain.then(function() {
|
|
32660
|
+
return err.retry({
|
|
32661
|
+
files: [
|
|
32662
|
+
file
|
|
32663
|
+
]
|
|
32664
|
+
});
|
|
32427
32665
|
});
|
|
32428
|
-
}
|
|
32429
|
-
|
|
32430
|
-
|
|
32431
|
-
|
|
32432
|
-
|
|
32433
|
-
|
|
32434
|
-
|
|
32666
|
+
}, Promise.resolve());
|
|
32667
|
+
}
|
|
32668
|
+
var _files = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_2__._)(files, 1), file = _files[0];
|
|
32669
|
+
var j = uploader.j, o = uploader.o;
|
|
32670
|
+
return new Promise(function(resolve) {
|
|
32671
|
+
var answered = false;
|
|
32672
|
+
// `Dlgs.prototype.dlg`: the uploader's view does not always carry the Dlgs trait
|
|
32673
|
+
var dialog = jodit_modules_dialog_prompt__WEBPACK_IMPORTED_MODULE_7__.Prompt.call(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_6__.Dlgs.prototype.dlg.call(j, {
|
|
32674
|
+
closeOnClickOverlay: true
|
|
32675
|
+
}), j.i18n(err.message), j.i18n('Rename'), function(newName) {
|
|
32676
|
+
newName = newName.trim();
|
|
32677
|
+
if (!newName) {
|
|
32678
|
+
return false;
|
|
32435
32679
|
}
|
|
32436
|
-
|
|
32437
|
-
|
|
32438
|
-
|
|
32439
|
-
|
|
32440
|
-
|
|
32441
|
-
|
|
32442
|
-
|
|
32443
|
-
|
|
32680
|
+
answered = true;
|
|
32681
|
+
resolve(err.retry({
|
|
32682
|
+
files: [
|
|
32683
|
+
new File([
|
|
32684
|
+
file
|
|
32685
|
+
], newName, {
|
|
32686
|
+
type: file.type
|
|
32687
|
+
})
|
|
32688
|
+
]
|
|
32689
|
+
}));
|
|
32690
|
+
}, j.i18n('Enter new name'), o.promptOnExistsSuggestName.call(uploader, file.name));
|
|
32691
|
+
dialog.e.on(dialog, 'afterClose', function() {
|
|
32692
|
+
!answered && resolve(undefined);
|
|
32693
|
+
});
|
|
32694
|
+
});
|
|
32444
32695
|
}
|
|
32445
32696
|
function readImagesWithReader(fileList, imagesExtensions, promises, uploader, handlerSuccess, defaultHandlerSuccess) {
|
|
32446
32697
|
var _loop = function() {
|
|
@@ -32468,7 +32719,7 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
|
|
|
32468
32719
|
name
|
|
32469
32720
|
]
|
|
32470
32721
|
};
|
|
32471
|
-
var handler = (0,
|
|
32722
|
+
var handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
|
|
32472
32723
|
handler.call(uploader, resp);
|
|
32473
32724
|
resolve(resp);
|
|
32474
32725
|
};
|
|
@@ -32588,6 +32839,51 @@ function send(uploader, data) {
|
|
|
32588
32839
|
}
|
|
32589
32840
|
|
|
32590
32841
|
|
|
32842
|
+
/***/ }),
|
|
32843
|
+
|
|
32844
|
+
/***/ 55083:
|
|
32845
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
32846
|
+
|
|
32847
|
+
"use strict";
|
|
32848
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32849
|
+
/* harmony export */ UploadError: function() { return /* binding */ UploadError; }
|
|
32850
|
+
/* harmony export */ });
|
|
32851
|
+
/* harmony import */ var _swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69262);
|
|
32852
|
+
/* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73104);
|
|
32853
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25045);
|
|
32854
|
+
/* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34918);
|
|
32855
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33201);
|
|
32856
|
+
/*!
|
|
32857
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32858
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
32859
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
32860
|
+
*/ /**
|
|
32861
|
+
* @module modules/uploader
|
|
32862
|
+
*/
|
|
32863
|
+
|
|
32864
|
+
|
|
32865
|
+
|
|
32866
|
+
|
|
32867
|
+
// The connector refused these files: the handler can change the request and send it again
|
|
32868
|
+
var UploadError = /*#__PURE__*/ function(AnswerError) {
|
|
32869
|
+
"use strict";
|
|
32870
|
+
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__._)(UploadError, AnswerError);
|
|
32871
|
+
function UploadError(message, answer, files, retry) {
|
|
32872
|
+
(0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, UploadError);
|
|
32873
|
+
var _this;
|
|
32874
|
+
var _answer_data;
|
|
32875
|
+
_this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UploadError, [
|
|
32876
|
+
message,
|
|
32877
|
+
answer,
|
|
32878
|
+
(_answer_data = answer.data) === null || _answer_data === void 0 ? void 0 : _answer_data.code
|
|
32879
|
+
]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(_this, "files", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__._)(_this, "retry", void 0), _this.files = files, _this.retry = retry;
|
|
32880
|
+
Object.setPrototypeOf(_this, UploadError.prototype);
|
|
32881
|
+
return _this;
|
|
32882
|
+
}
|
|
32883
|
+
return UploadError;
|
|
32884
|
+
}(jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_4__.AnswerError);
|
|
32885
|
+
|
|
32886
|
+
|
|
32591
32887
|
/***/ }),
|
|
32592
32888
|
|
|
32593
32889
|
/***/ 94925:
|
|
@@ -32608,9 +32904,10 @@ function send(uploader, data) {
|
|
|
32608
32904
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81937);
|
|
32609
32905
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23211);
|
|
32610
32906
|
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
|
|
32611
|
-
/* harmony import */ var
|
|
32612
|
-
/* harmony import */ var
|
|
32613
|
-
/* harmony import */ var
|
|
32907
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(33201);
|
|
32908
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5266);
|
|
32909
|
+
/* harmony import */ var jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(11981);
|
|
32910
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(40013);
|
|
32614
32911
|
/*!
|
|
32615
32912
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32616
32913
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32634,6 +32931,7 @@ function send(uploader, data) {
|
|
|
32634
32931
|
|
|
32635
32932
|
|
|
32636
32933
|
|
|
32934
|
+
|
|
32637
32935
|
var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
32638
32936
|
"use strict";
|
|
32639
32937
|
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(Uploader, ViewComponent);
|
|
@@ -32643,7 +32941,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32643
32941
|
_this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, Uploader, [
|
|
32644
32942
|
editor
|
|
32645
32943
|
]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "path", ''), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "source", 'default'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "options", void 0);
|
|
32646
|
-
_this.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(options || {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(
|
|
32944
|
+
_this.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(options || {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_12__.Config.defaultOptions.uploader, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isJoditObject)(editor) ? editor.o.uploader : {}));
|
|
32647
32945
|
return _this;
|
|
32648
32946
|
}
|
|
32649
32947
|
;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(Uploader, [
|
|
@@ -32718,14 +33016,14 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32718
33016
|
}
|
|
32719
33017
|
};
|
|
32720
33018
|
// send data on server
|
|
32721
|
-
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.IS_IE && (0,
|
|
32722
|
-
(0,
|
|
33019
|
+
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.IS_IE && (0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.hasFiles)(cData)) {
|
|
33020
|
+
(0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.sendFiles)(self, cData.files, handlerSuccess, handlerError).finally(onFinally);
|
|
32723
33021
|
return false;
|
|
32724
33022
|
}
|
|
32725
33023
|
if (jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.IS_IE && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.IS_ES_NEXT) {
|
|
32726
|
-
return (0,
|
|
33024
|
+
return (0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.processOldBrowserDrag)(self, cData, handlerSuccess, handlerError, onFinally);
|
|
32727
33025
|
}
|
|
32728
|
-
if ((0,
|
|
33026
|
+
if ((0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.hasItems)(cData)) {
|
|
32729
33027
|
var items = cData.items;
|
|
32730
33028
|
for(i = 0; i < items.length; i += 1){
|
|
32731
33029
|
if (items[i].kind === 'file' && items[i].type === 'image/png') {
|
|
@@ -32733,7 +33031,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32733
33031
|
if (file) {
|
|
32734
33032
|
var mime = file.type.match(/\/([a-z0-9]+)/i);
|
|
32735
33033
|
extension = mime[1] ? mime[1].toLowerCase() : '';
|
|
32736
|
-
(0,
|
|
33034
|
+
(0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.sendFiles)(self, [
|
|
32737
33035
|
file
|
|
32738
33036
|
], handlerSuccess, handlerError, processData).finally(onFinally);
|
|
32739
33037
|
}
|
|
@@ -32758,21 +33056,21 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32758
33056
|
self.j.e.on(form, 'dragend dragover dragenter dragleave drop', function(e) {
|
|
32759
33057
|
e.preventDefault();
|
|
32760
33058
|
}).on(form, 'dragover', function(event) {
|
|
32761
|
-
if ((0,
|
|
33059
|
+
if ((0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.hasFiles)(event.dataTransfer) || (0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.hasItems)(event.dataTransfer)) {
|
|
32762
33060
|
form.classList.add('jodit_drag_hover');
|
|
32763
33061
|
event.preventDefault();
|
|
32764
33062
|
}
|
|
32765
33063
|
}).on(form, 'dragend dragleave', function(event) {
|
|
32766
33064
|
form.classList.remove('jodit_drag_hover');
|
|
32767
|
-
if ((0,
|
|
33065
|
+
if ((0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.hasFiles)(event.dataTransfer)) {
|
|
32768
33066
|
event.preventDefault();
|
|
32769
33067
|
}
|
|
32770
33068
|
}).on(form, 'drop', function(event) {
|
|
32771
33069
|
form.classList.remove('jodit_drag_hover');
|
|
32772
|
-
if ((0,
|
|
33070
|
+
if ((0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.hasFiles)(event.dataTransfer)) {
|
|
32773
33071
|
event.preventDefault();
|
|
32774
33072
|
event.stopImmediatePropagation();
|
|
32775
|
-
(0,
|
|
33073
|
+
(0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.sendFiles)(self, event.dataTransfer.files, handlerSuccess, handlerError).finally(onFinally);
|
|
32776
33074
|
}
|
|
32777
33075
|
});
|
|
32778
33076
|
var inputFile = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.first(form, function(node) {
|
|
@@ -32781,7 +33079,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32781
33079
|
});
|
|
32782
33080
|
if (inputFile) {
|
|
32783
33081
|
self.j.e.on(inputFile, 'change', function() {
|
|
32784
|
-
(0,
|
|
33082
|
+
(0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.sendFiles)(self, inputFile.files, handlerSuccess, handlerError).then(function() {
|
|
32785
33083
|
inputFile.value = '';
|
|
32786
33084
|
if (!/safari/i.test(navigator.userAgent)) {
|
|
32787
33085
|
inputFile.type = '';
|
|
@@ -32799,16 +33097,17 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32799
33097
|
value: function uploadRemoteImage(url, handlerSuccess, handlerError) {
|
|
32800
33098
|
var uploader = this, o = uploader.o;
|
|
32801
33099
|
var handlerE = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
|
|
32802
|
-
(0,
|
|
33100
|
+
(0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.send)(uploader, {
|
|
32803
33101
|
action: 'fileUploadRemote',
|
|
32804
33102
|
url: url
|
|
32805
33103
|
}).then(function(resp) {
|
|
33104
|
+
var _resp_data;
|
|
32806
33105
|
if (o.isSuccess.call(uploader, resp)) {
|
|
32807
33106
|
var handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
|
|
32808
33107
|
handler.call(uploader, o.process.call(uploader, resp));
|
|
32809
33108
|
return;
|
|
32810
33109
|
}
|
|
32811
|
-
handlerE.call(uploader, (0,
|
|
33110
|
+
handlerE.call(uploader, (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_11__.answer)(o.getMessage.call(uploader, resp), resp, (_resp_data = resp.data) === null || _resp_data === void 0 ? void 0 : _resp_data.code));
|
|
32812
33111
|
}).catch(function(e) {
|
|
32813
33112
|
return handlerE.call(uploader, e);
|
|
32814
33113
|
});
|
|
@@ -32819,7 +33118,23 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32819
33118
|
value: function upload(files) {
|
|
32820
33119
|
var _this = this;
|
|
32821
33120
|
return this.async.promise(function(resolve, reject) {
|
|
32822
|
-
|
|
33121
|
+
var settled = false;
|
|
33122
|
+
var settle = function settle(end) {
|
|
33123
|
+
return function(value) {
|
|
33124
|
+
settled = true;
|
|
33125
|
+
end(value);
|
|
33126
|
+
};
|
|
33127
|
+
};
|
|
33128
|
+
(0,jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.sendFiles)(_this, files, settle(resolve), settle(reject)).then(function() {
|
|
33129
|
+
// `beforeUpload` kept no file, so no handler ran
|
|
33130
|
+
if (!settled) {
|
|
33131
|
+
resolve({
|
|
33132
|
+
baseurl: '',
|
|
33133
|
+
files: [],
|
|
33134
|
+
isImages: []
|
|
33135
|
+
});
|
|
33136
|
+
}
|
|
33137
|
+
}, settle(reject));
|
|
32823
33138
|
});
|
|
32824
33139
|
}
|
|
32825
33140
|
},
|
|
@@ -32827,7 +33142,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
32827
33142
|
key: "destruct",
|
|
32828
33143
|
value: function destruct() {
|
|
32829
33144
|
this.setStatus(jodit_core_component___WEBPACK_IMPORTED_MODULE_7__.STATUSES.beforeDestruct);
|
|
32830
|
-
var instances =
|
|
33145
|
+
var instances = jodit_modules_uploader_helpers__WEBPACK_IMPORTED_MODULE_13__.ajaxInstances.get(this);
|
|
32831
33146
|
if (instances) {
|
|
32832
33147
|
instances.forEach(function(ajax) {
|
|
32833
33148
|
try {
|
|
@@ -34595,6 +34910,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
|
|
|
34595
34910
|
if (checkJoinBareText(jodit, fakeNode, backspace)) {
|
|
34596
34911
|
return true;
|
|
34597
34912
|
}
|
|
34913
|
+
// Old content can have an inline element round blocks beside the text:
|
|
34914
|
+
// moved inside them, the line joins the block as it would bare text
|
|
34915
|
+
// (#1781)
|
|
34916
|
+
var inline = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
|
|
34917
|
+
if (joinsBareText(jodit, edgeBlock(inline, backspace)) && moveInlineInside(inline, jodit.editor)) {
|
|
34918
|
+
return joinNeighbors(jodit, fakeNode, backspace, moved);
|
|
34919
|
+
}
|
|
34598
34920
|
var nextBox = fakeNode, mainClosestBox = nextBox;
|
|
34599
34921
|
// Find the main big closest element
|
|
34600
34922
|
while(nextBox && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(nextBox, backspace) && nextBox.parentElement !== jodit.editor){
|
|
@@ -34902,9 +35224,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
|
|
|
34902
35224
|
* in `<div>a|<p>b</p>c</div>` gives `<div>a|b<br>c</div>`
|
|
34903
35225
|
*/ function checkJoinBareText(jodit, fakeNode, backspace) {
|
|
34904
35226
|
var block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
|
|
34905
|
-
if (!
|
|
34906
|
-
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
|
|
34907
|
-
})) {
|
|
35227
|
+
if (!joinsBareText(jodit, block)) {
|
|
34908
35228
|
return false;
|
|
34909
35229
|
}
|
|
34910
35230
|
var filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
|
|
@@ -34931,6 +35251,28 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
|
|
|
34931
35251
|
jodit.s.setCursorBefore(fakeNode);
|
|
34932
35252
|
return true;
|
|
34933
35253
|
}
|
|
35254
|
+
/**
|
|
35255
|
+
* Whether a block joins the bare text beside it: not a list, a table or a
|
|
35256
|
+
* cell, and holding no block of its own
|
|
35257
|
+
*/ function joinsBareText(jodit, block) {
|
|
35258
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) && !Array.from(block.childNodes).some(function(node) {
|
|
35259
|
+
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
|
|
35260
|
+
});
|
|
35261
|
+
}
|
|
35262
|
+
/**
|
|
35263
|
+
* The block an inline element holds on its side facing the caret, through
|
|
35264
|
+
* the inline elements in it: the `<p>` of `<span><strong><p>…</p></strong></span>`
|
|
35265
|
+
*/ function edgeBlock(node, backspace) {
|
|
35266
|
+
var edge = node;
|
|
35267
|
+
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(edge) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(edge)){
|
|
35268
|
+
var _ref;
|
|
35269
|
+
var children = Array.from(edge.childNodes).filter(function(child) {
|
|
35270
|
+
return !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child);
|
|
35271
|
+
});
|
|
35272
|
+
edge = (_ref = backspace ? children[children.length - 1] : children[0]) !== null && _ref !== void 0 ? _ref : null;
|
|
35273
|
+
}
|
|
35274
|
+
return edge === node ? null : edge;
|
|
35275
|
+
}
|
|
34934
35276
|
function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
|
|
34935
35277
|
// Process UL/LI/OL cases
|
|
34936
35278
|
var siblingIsList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
|
|
@@ -35385,7 +35727,6 @@ function isNotEditable(jodit, node) {
|
|
|
35385
35727
|
if (!prn || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn)) {
|
|
35386
35728
|
return false;
|
|
35387
35729
|
}
|
|
35388
|
-
var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
|
|
35389
35730
|
do {
|
|
35390
35731
|
if (prn && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(prn)) {
|
|
35391
35732
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(prn, fakeNode);
|
|
@@ -35402,6 +35743,9 @@ function isNotEditable(jodit, node) {
|
|
|
35402
35743
|
if (found && (0,_check_join_two_lists__WEBPACK_IMPORTED_MODULE_2__.checkJoinTwoLists)(jodit, fakeNode, backspace)) {
|
|
35403
35744
|
return true;
|
|
35404
35745
|
}
|
|
35746
|
+
// Looked for once the empty elements have gone, as the one beside the
|
|
35747
|
+
// caret can be in them: the `<br>` that Delete in `<p>|<br></p>` leaves
|
|
35748
|
+
var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
|
|
35405
35749
|
if (neighbor && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(neighbor) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(neighbor, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
|
|
35406
35750
|
setCursorIn(neighbor, !backspace);
|
|
35407
35751
|
} else {
|
|
@@ -35879,8 +36223,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
|
|
|
35879
36223
|
}
|
|
35880
36224
|
cssRules[key] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(cssOptions[key]) ? cssOptions[key][0] : cssOptions[key];
|
|
35881
36225
|
});
|
|
36226
|
+
var element = control.tags ? control.tags[0] : undefined;
|
|
35882
36227
|
editor.s.commitStyle({
|
|
35883
|
-
element:
|
|
36228
|
+
element: element,
|
|
36229
|
+
// As in the browsers and Word, each takes the other's place
|
|
36230
|
+
exclude: element === 'sub' ? [
|
|
36231
|
+
'sup'
|
|
36232
|
+
] : element === 'sup' ? [
|
|
36233
|
+
'sub'
|
|
36234
|
+
] : []
|
|
35884
36235
|
});
|
|
35885
36236
|
editor.synchronizeValues();
|
|
35886
36237
|
return false;
|
|
@@ -38680,11 +39031,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38680
39031
|
/* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
|
|
38681
39032
|
/* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50684);
|
|
38682
39033
|
/* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38574);
|
|
38683
|
-
/* harmony import */ var
|
|
38684
|
-
/* harmony import */ var
|
|
38685
|
-
/* harmony import */ var
|
|
38686
|
-
/* harmony import */ var
|
|
38687
|
-
/* harmony import */ var
|
|
39034
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
|
|
39035
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27795);
|
|
39036
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
|
|
39037
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
|
|
39038
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4040);
|
|
39039
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
|
|
38688
39040
|
/*!
|
|
38689
39041
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
38690
39042
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -38706,6 +39058,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38706
39058
|
|
|
38707
39059
|
|
|
38708
39060
|
|
|
39061
|
+
|
|
38709
39062
|
var NOT_EMPTY_CONTENT_TAGS = new Set([
|
|
38710
39063
|
'img',
|
|
38711
39064
|
'table',
|
|
@@ -38713,6 +39066,18 @@ var NOT_EMPTY_CONTENT_TAGS = new Set([
|
|
|
38713
39066
|
'iframe',
|
|
38714
39067
|
'hr'
|
|
38715
39068
|
]);
|
|
39069
|
+
var KEEPS_SPACES = new Set([
|
|
39070
|
+
'pre',
|
|
39071
|
+
'pre-wrap',
|
|
39072
|
+
'break-spaces'
|
|
39073
|
+
]);
|
|
39074
|
+
/**
|
|
39075
|
+
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
39076
|
+
* line break, a block or text starting (or ending) with a plain space
|
|
39077
|
+
*/ function hidesSpace(neighbor, edge) {
|
|
39078
|
+
var _neighbor_nodeValue;
|
|
39079
|
+
return !neighbor || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(neighbor, 'br') || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(neighbor) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(neighbor) && edge.test((_neighbor_nodeValue = neighbor.nodeValue) !== null && _neighbor_nodeValue !== void 0 ? _neighbor_nodeValue : '');
|
|
39080
|
+
}
|
|
38716
39081
|
var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
38717
39082
|
"use strict";
|
|
38718
39083
|
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(deleteCommand, Plugin);
|
|
@@ -38750,13 +39115,13 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38750
39115
|
*/ function __afterDeleteCommand() {
|
|
38751
39116
|
var jodit = this.j;
|
|
38752
39117
|
var current = jodit.s.current();
|
|
38753
|
-
if (current &&
|
|
39118
|
+
if (current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(current.firstChild, 'br')) {
|
|
38754
39119
|
jodit.s.removeNode(current.firstChild);
|
|
38755
39120
|
}
|
|
38756
|
-
if (!(0,
|
|
38757
|
-
return
|
|
38758
|
-
}) && (!current || !
|
|
38759
|
-
|
|
39121
|
+
if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_11__.trim)(jodit.editor.textContent || '') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.first(jodit.editor, function(node) {
|
|
39122
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS);
|
|
39123
|
+
}) && (!current || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(current, 'table', jodit.editor))) {
|
|
39124
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.detach(jodit.editor);
|
|
38760
39125
|
var node = jodit.s.setCursorIn(jodit.editor);
|
|
38761
39126
|
jodit.s.removeNode(node);
|
|
38762
39127
|
}
|
|
@@ -38779,14 +39144,15 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38779
39144
|
range.deleteContents();
|
|
38780
39145
|
var fake = jodit.createInside.fake();
|
|
38781
39146
|
range.insertNode(fake);
|
|
38782
|
-
var leftSibling =
|
|
38783
|
-
var rightSibling =
|
|
39147
|
+
var leftSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.findSibling(fake, true);
|
|
39148
|
+
var rightSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.findSibling(fake, false);
|
|
38784
39149
|
this.__moveContentInLeftSibling(fake, leftSibling, rightSibling);
|
|
39150
|
+
this.__keepSpacesVisible(fake);
|
|
38785
39151
|
range.setStartBefore(fake);
|
|
38786
39152
|
range.collapse(true);
|
|
38787
39153
|
this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
|
|
38788
39154
|
this.__addBrInEmptyBlock(fake, range);
|
|
38789
|
-
|
|
39155
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(fake);
|
|
38790
39156
|
jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
|
|
38791
39157
|
return false;
|
|
38792
39158
|
}
|
|
@@ -38803,27 +39169,27 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38803
39169
|
* Returns where the caret goes, or null when no table is involved
|
|
38804
39170
|
*/ function __clearSelectedCells(range) {
|
|
38805
39171
|
var _this_j = this.j, editor = _this_j.editor, createInside = _this_j.createInside;
|
|
38806
|
-
var startCell =
|
|
38807
|
-
var endCell =
|
|
39172
|
+
var startCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(range.startContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isCell, editor);
|
|
39173
|
+
var endCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(range.endContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isCell, editor);
|
|
38808
39174
|
if (startCell === endCell) {
|
|
38809
39175
|
return null;
|
|
38810
39176
|
}
|
|
38811
|
-
var startTable =
|
|
38812
|
-
var endTable =
|
|
39177
|
+
var startTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(startCell, 'table', editor);
|
|
39178
|
+
var endTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(endCell, 'table', editor);
|
|
38813
39179
|
var caret = range.cloneRange();
|
|
38814
39180
|
caret.collapse(true);
|
|
38815
39181
|
var parts = [];
|
|
38816
39182
|
var addParts = function addParts(table) {
|
|
38817
|
-
(0,
|
|
38818
|
-
return (0,
|
|
39183
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.toArray)(table.rows).flatMap(function(row) {
|
|
39184
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.toArray)(row.cells);
|
|
38819
39185
|
}).filter(function(cell) {
|
|
38820
39186
|
return range.intersectsNode(cell);
|
|
38821
39187
|
}).forEach(function(cell) {
|
|
38822
39188
|
var part = range.cloneRange();
|
|
38823
|
-
if (!
|
|
39189
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(cell, range.startContainer)) {
|
|
38824
39190
|
part.setStart(cell, 0);
|
|
38825
39191
|
}
|
|
38826
|
-
if (!
|
|
39192
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(cell, range.endContainer)) {
|
|
38827
39193
|
part.setEnd(cell, cell.childNodes.length);
|
|
38828
39194
|
}
|
|
38829
39195
|
parts.push([
|
|
@@ -38847,9 +39213,9 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38847
39213
|
parts.forEach(function(param) {
|
|
38848
39214
|
var _param = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(param, 2), cell = _param[0], part = _param[1];
|
|
38849
39215
|
part.deleteContents();
|
|
38850
|
-
if (
|
|
38851
|
-
|
|
38852
|
-
|
|
39216
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(cell)) {
|
|
39217
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.detach(cell);
|
|
39218
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(cell, createInside.element('br'));
|
|
38853
39219
|
}
|
|
38854
39220
|
});
|
|
38855
39221
|
return startTable ? caret : null;
|
|
@@ -38860,49 +39226,89 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38860
39226
|
value: function __moveContentInLeftSibling(fake, leftSibling, rightSibling) {
|
|
38861
39227
|
leftSibling = this.__defineRightLeftBox(leftSibling);
|
|
38862
39228
|
// Nothing is moved into a table, and a block left empty after it goes
|
|
38863
|
-
if (
|
|
38864
|
-
if (
|
|
38865
|
-
|
|
39229
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(leftSibling, 'table')) {
|
|
39230
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(rightSibling)) {
|
|
39231
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(rightSibling);
|
|
38866
39232
|
}
|
|
38867
39233
|
return;
|
|
38868
39234
|
}
|
|
38869
|
-
if (!
|
|
38870
|
-
|
|
38871
|
-
|
|
38872
|
-
|
|
39235
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(rightSibling) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(rightSibling, 'table') && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(leftSibling)) {
|
|
39236
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, fake);
|
|
39237
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.moveContent(rightSibling, leftSibling);
|
|
39238
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(rightSibling);
|
|
38873
39239
|
}
|
|
38874
|
-
if (
|
|
39240
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isLeaf(rightSibling.firstElementChild)) {
|
|
38875
39241
|
var item = rightSibling.firstElementChild;
|
|
38876
39242
|
// What's left of the right list's first item joins the left block,
|
|
38877
39243
|
// up to a list nested in the item
|
|
38878
|
-
if (!
|
|
38879
|
-
|
|
38880
|
-
while(item.firstChild && !
|
|
38881
|
-
|
|
39244
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(item) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(leftSibling)) {
|
|
39245
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, fake);
|
|
39246
|
+
while(item.firstChild && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(item.firstChild)){
|
|
39247
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, item.firstChild);
|
|
38882
39248
|
}
|
|
38883
39249
|
}
|
|
38884
39250
|
// Remove empty right LI
|
|
38885
|
-
if (
|
|
38886
|
-
|
|
39251
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(item)) {
|
|
39252
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(item);
|
|
38887
39253
|
}
|
|
38888
|
-
if (
|
|
38889
|
-
|
|
39254
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(rightSibling)) {
|
|
39255
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(rightSibling);
|
|
38890
39256
|
}
|
|
38891
39257
|
}
|
|
38892
39258
|
}
|
|
38893
39259
|
},
|
|
39260
|
+
{
|
|
39261
|
+
key: "__keepSpacesVisible",
|
|
39262
|
+
value: /**
|
|
39263
|
+
* A plain space the deletion leaves at an edge of the block, before a line
|
|
39264
|
+
* break or next to another space isn't shown, and the browser drops it when
|
|
39265
|
+
* the next char is typed. It becomes non-breaking, as in the browsers' own
|
|
39266
|
+
* delete and in Backspace without a selection (#1522)
|
|
39267
|
+
*/ function __keepSpacesVisible(fake) {
|
|
39268
|
+
var _Dom_closest;
|
|
39269
|
+
var jodit = this.jodit;
|
|
39270
|
+
var block = (_Dom_closest = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock, jodit.editor)) !== null && _Dom_closest !== void 0 ? _Dom_closest : jodit.editor;
|
|
39271
|
+
if (KEEPS_SPACES.has(jodit.ew.getComputedStyle(block).whiteSpace)) {
|
|
39272
|
+
return;
|
|
39273
|
+
}
|
|
39274
|
+
var before = this.__findNeighbor(fake, true, block);
|
|
39275
|
+
var after = this.__findNeighbor(fake, false, block);
|
|
39276
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(before) && hidesSpace(after, /^ /)) {
|
|
39277
|
+
before.nodeValue = before.nodeValue.replace(/ +$/, function(spaces) {
|
|
39278
|
+
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.NBSP_SPACE.repeat(spaces.length);
|
|
39279
|
+
});
|
|
39280
|
+
}
|
|
39281
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(after) && hidesSpace(before, / $/)) {
|
|
39282
|
+
after.nodeValue = after.nodeValue.replace(/^ +/, function(spaces) {
|
|
39283
|
+
return jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.NBSP_SPACE.repeat(spaces.length);
|
|
39284
|
+
});
|
|
39285
|
+
}
|
|
39286
|
+
}
|
|
39287
|
+
},
|
|
39288
|
+
{
|
|
39289
|
+
key: "__findNeighbor",
|
|
39290
|
+
value: /**
|
|
39291
|
+
* The text, line break or other element next to the caret in its block,
|
|
39292
|
+
* looking inside inline elements
|
|
39293
|
+
*/ function __findNeighbor(fake, left, block) {
|
|
39294
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.call)(left ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.prev : jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.next, fake, function(node) {
|
|
39295
|
+
var _node_nodeValue;
|
|
39296
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(node) ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.trimInv)((_node_nodeValue = node.nodeValue) !== null && _node_nodeValue !== void 0 ? _node_nodeValue : '').length > 0 : !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isComment(node) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isInlineBlock(node) && node.firstChild);
|
|
39297
|
+
}, block);
|
|
39298
|
+
}
|
|
39299
|
+
},
|
|
38894
39300
|
{
|
|
38895
39301
|
key: "__defineRightLeftBox",
|
|
38896
39302
|
value: /**
|
|
38897
39303
|
* If left sibling is list - return last leaf
|
|
38898
39304
|
*/ function __defineRightLeftBox(leftSibling) {
|
|
38899
|
-
if (!
|
|
39305
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(leftSibling)) {
|
|
38900
39306
|
return leftSibling;
|
|
38901
39307
|
}
|
|
38902
39308
|
var lastLeaf = leftSibling.lastElementChild;
|
|
38903
|
-
if (!
|
|
39309
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isLeaf(lastLeaf)) {
|
|
38904
39310
|
lastLeaf = this.j.createInside.element('li');
|
|
38905
|
-
|
|
39311
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, lastLeaf);
|
|
38906
39312
|
}
|
|
38907
39313
|
return lastLeaf;
|
|
38908
39314
|
}
|
|
@@ -38913,9 +39319,9 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38913
39319
|
* Add BR in the empty block left at the caret
|
|
38914
39320
|
*/ function __addBrInEmptyBlock(fake, range) {
|
|
38915
39321
|
var jodit = this.j;
|
|
38916
|
-
if (fake.isConnected &&
|
|
39322
|
+
if (fake.isConnected && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
|
|
38917
39323
|
var br = jodit.createInside.element('br');
|
|
38918
|
-
|
|
39324
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.after(fake, br);
|
|
38919
39325
|
range.setStartBefore(br);
|
|
38920
39326
|
range.collapse(true);
|
|
38921
39327
|
}
|
|
@@ -38924,25 +39330,25 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
38924
39330
|
{
|
|
38925
39331
|
key: "__moveCursorInEditableSibling",
|
|
38926
39332
|
value: function __moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
|
|
38927
|
-
if (!leftSibling || !
|
|
39333
|
+
if (!leftSibling || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(leftSibling)) {
|
|
38928
39334
|
var _Dom_closest;
|
|
38929
|
-
var root = (_Dom_closest =
|
|
38930
|
-
var leftText =
|
|
39335
|
+
var root = (_Dom_closest = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock, jodit.editor)) !== null && _Dom_closest !== void 0 ? _Dom_closest : jodit.editor;
|
|
39336
|
+
var leftText = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.prev(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText, root);
|
|
38931
39337
|
if (leftText) {
|
|
38932
39338
|
range.setStartAfter(leftText);
|
|
38933
39339
|
range.collapse(true);
|
|
38934
|
-
|
|
39340
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(fake);
|
|
38935
39341
|
}
|
|
38936
39342
|
}
|
|
38937
39343
|
}
|
|
38938
39344
|
}
|
|
38939
39345
|
]);
|
|
38940
39346
|
return deleteCommand;
|
|
38941
|
-
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(
|
|
39347
|
+
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__.Plugin));
|
|
38942
39348
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(deleteCommand, "requires", [
|
|
38943
39349
|
'backspace'
|
|
38944
39350
|
]);
|
|
38945
|
-
|
|
39351
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('deleteCommand', deleteCommand);
|
|
38946
39352
|
|
|
38947
39353
|
|
|
38948
39354
|
/***/ }),
|
|
@@ -51641,8 +52047,15 @@ var key = 'table_processor_observer-resize';
|
|
|
51641
52047
|
}
|
|
51642
52048
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "hideTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "drag", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "wholeTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workCell", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "minX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "maxX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startX", 0), /**
|
|
51643
52049
|
* The table's and its cells' styles as a column drag started, put back
|
|
51644
|
-
* before
|
|
52050
|
+
* as it ends, before the final widths
|
|
51645
52051
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startStyles", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startLeft", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startEdge", 0), /**
|
|
52052
|
+
* For each of the two columns a drag resizes, the cell whose width
|
|
52053
|
+
* `setColumnWidthByDelta` sets, with its width as the drag started, and
|
|
52054
|
+
* the cells below it, whose widths it clears
|
|
52055
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startWidths", []), /**
|
|
52056
|
+
* The table's width as the drag started, and for a drag of its edge, the
|
|
52057
|
+
* width inside what holds it and its margin on that side
|
|
52058
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startTableWidth", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startParentWidth", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startMargin", 0), /**
|
|
51646
52059
|
* The row whose height the handle sets, or null while it sets a width
|
|
51647
52060
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workRow", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startHeight", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "rowStyle", null), /**
|
|
51648
52061
|
* The boxes that scroll the row, with their styles, as a row drag turns
|
|
@@ -51696,7 +52109,7 @@ var key = 'table_processor_observer-resize';
|
|
|
51696
52109
|
* Click on resize handle
|
|
51697
52110
|
*/ function onHandleMouseDown(event) {
|
|
51698
52111
|
var _this = this;
|
|
51699
|
-
if (this.j.isLocked) {
|
|
52112
|
+
if (this.j.isLocked || this.j.o.readonly) {
|
|
51700
52113
|
return;
|
|
51701
52114
|
}
|
|
51702
52115
|
this.drag = true;
|
|
@@ -51732,10 +52145,15 @@ var key = 'table_processor_observer-resize';
|
|
|
51732
52145
|
var box;
|
|
51733
52146
|
this.minX = 0;
|
|
51734
52147
|
this.maxX = 1000000;
|
|
52148
|
+
this.startTableWidth = this.workTable.offsetWidth;
|
|
51735
52149
|
if (this.wholeTable != null) {
|
|
51736
|
-
var
|
|
52150
|
+
var parent = this.workTable.parentNode;
|
|
52151
|
+
var tableBox = parent.getBoundingClientRect();
|
|
51737
52152
|
this.minX = tableBox.left;
|
|
51738
52153
|
this.maxX = this.minX + tableBox.width;
|
|
52154
|
+
var side = this.isRTL ? 'marginRight' : 'marginLeft';
|
|
52155
|
+
this.startParentWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.getContentWidth)(parent, this.j.ew);
|
|
52156
|
+
this.startMargin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
|
|
51739
52157
|
} else {
|
|
51740
52158
|
// find maximum columns
|
|
51741
52159
|
var coordinate = this.module.formalCoordinate(this.workTable, this.workCell, true);
|
|
@@ -51749,6 +52167,21 @@ var key = 'table_processor_observer-resize';
|
|
|
51749
52167
|
_this.maxX = Math.min(box.left + box.width - jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.NEARBY / 2, _this.maxX);
|
|
51750
52168
|
}
|
|
51751
52169
|
});
|
|
52170
|
+
var matrix = this.module.formalMatrix(this.workTable);
|
|
52171
|
+
this.startWidths = this.resizedColumns().map(function(column) {
|
|
52172
|
+
var cells = matrix.map(function(row) {
|
|
52173
|
+
return row[column];
|
|
52174
|
+
});
|
|
52175
|
+
var index = cells.findIndex(function(td) {
|
|
52176
|
+
return td.colSpan === 1 || cells.length === 1;
|
|
52177
|
+
});
|
|
52178
|
+
var cell = cells[index];
|
|
52179
|
+
return [
|
|
52180
|
+
cell,
|
|
52181
|
+
cell ? cell.offsetWidth : 0,
|
|
52182
|
+
cells.slice(Math.max(index, 0) + 1)
|
|
52183
|
+
];
|
|
52184
|
+
});
|
|
51752
52185
|
}
|
|
51753
52186
|
return false;
|
|
51754
52187
|
}
|
|
@@ -51780,8 +52213,11 @@ var key = 'table_processor_observer-resize';
|
|
|
51780
52213
|
x = this.maxX;
|
|
51781
52214
|
}
|
|
51782
52215
|
this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
|
|
51783
|
-
this.
|
|
51784
|
-
|
|
52216
|
+
if (this.wholeTable == null) {
|
|
52217
|
+
this.setColumnWidths();
|
|
52218
|
+
} else {
|
|
52219
|
+
this.resizeTable();
|
|
52220
|
+
}
|
|
51785
52221
|
var tableBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.offset)(this.workTable, this.j, this.j.ed);
|
|
51786
52222
|
Object.assign(this.resizeHandler.style, {
|
|
51787
52223
|
left: this.startLeft + this.columnEdge() - this.startEdge + 'px',
|
|
@@ -51920,6 +52356,19 @@ var key = 'table_processor_observer-resize';
|
|
|
51920
52356
|
this.scrollFrame = this.j.async.requestAnimationFrame(scroll);
|
|
51921
52357
|
}
|
|
51922
52358
|
},
|
|
52359
|
+
{
|
|
52360
|
+
key: "resizedColumns",
|
|
52361
|
+
value: /**
|
|
52362
|
+
* The two columns a column drag resizes: the work cell's last, and the
|
|
52363
|
+
* next cell's first
|
|
52364
|
+
*/ function resizedColumns() {
|
|
52365
|
+
var nextTD = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.call)(this.isRTL ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.next, this.workCell, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isCell, this.workCell.parentNode);
|
|
52366
|
+
return [
|
|
52367
|
+
this.module.formalCoordinate(this.workTable, this.workCell, true)[1],
|
|
52368
|
+
this.module.formalCoordinate(this.workTable, nextTD)[1]
|
|
52369
|
+
];
|
|
52370
|
+
}
|
|
52371
|
+
},
|
|
51923
52372
|
{
|
|
51924
52373
|
key: "resizeColumns",
|
|
51925
52374
|
value: /**
|
|
@@ -51928,9 +52377,32 @@ var key = 'table_processor_observer-resize';
|
|
|
51928
52377
|
var delta = this.resizeDelta;
|
|
51929
52378
|
var marked = [];
|
|
51930
52379
|
var tableModule = this.module;
|
|
51931
|
-
|
|
51932
|
-
|
|
51933
|
-
tableModule.setColumnWidthByDelta(this.workTable,
|
|
52380
|
+
var _this_resizedColumns = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(this.resizedColumns(), 2), column = _this_resizedColumns[0], nextColumn = _this_resizedColumns[1];
|
|
52381
|
+
tableModule.setColumnWidthByDelta(this.workTable, column, delta, true, marked);
|
|
52382
|
+
tableModule.setColumnWidthByDelta(this.workTable, nextColumn, -delta, false, marked);
|
|
52383
|
+
}
|
|
52384
|
+
},
|
|
52385
|
+
{
|
|
52386
|
+
key: "setColumnWidths",
|
|
52387
|
+
value: /**
|
|
52388
|
+
* Sets the widths `resizeColumns` would while the handle is dragged, from
|
|
52389
|
+
* the widths the drag started with, so that a move doesn't put back every
|
|
52390
|
+
* cell's style and lay the table out again to measure them
|
|
52391
|
+
*/ function setColumnWidths() {
|
|
52392
|
+
var _this = this;
|
|
52393
|
+
this.startWidths.forEach(function(param, index) {
|
|
52394
|
+
var _param = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(param, 3), cell = _param[0], width = _param[1], below = _param[2];
|
|
52395
|
+
var delta = index ? -_this.resizeDelta : _this.resizeDelta;
|
|
52396
|
+
if (cell) {
|
|
52397
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(cell, 'width', ((width + delta) / _this.startTableWidth * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.ACCURACY) + '%');
|
|
52398
|
+
}
|
|
52399
|
+
below.forEach(function(td) {
|
|
52400
|
+
td.style.removeProperty('width');
|
|
52401
|
+
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(td, 'style')) {
|
|
52402
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(td, 'style', null);
|
|
52403
|
+
}
|
|
52404
|
+
});
|
|
52405
|
+
});
|
|
51934
52406
|
}
|
|
51935
52407
|
},
|
|
51936
52408
|
{
|
|
@@ -51939,7 +52411,7 @@ var key = 'table_processor_observer-resize';
|
|
|
51939
52411
|
* Resize whole table
|
|
51940
52412
|
*/ function resizeTable() {
|
|
51941
52413
|
var delta = this.resizeDelta * (this.isRTL ? -1 : 1);
|
|
51942
|
-
var width = this.
|
|
52414
|
+
var width = this.startTableWidth, parentWidth = this.startParentWidth;
|
|
51943
52415
|
// for RTL use mirror logic
|
|
51944
52416
|
var rightSide = !this.wholeTable;
|
|
51945
52417
|
var needChangeWidth = this.isRTL ? !rightSide : rightSide;
|
|
@@ -51948,10 +52420,9 @@ var key = 'table_processor_observer-resize';
|
|
|
51948
52420
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.workTable, 'width', (width + delta) / parentWidth * 100 + '%');
|
|
51949
52421
|
} else {
|
|
51950
52422
|
var side = this.isRTL ? 'marginRight' : 'marginLeft';
|
|
51951
|
-
var margin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
|
|
51952
52423
|
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.workTable, (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)({
|
|
51953
52424
|
width: (width - delta) / parentWidth * 100 + '%'
|
|
51954
|
-
}, side, (
|
|
52425
|
+
}, side, (this.startMargin + delta) / parentWidth * 100 + '%'));
|
|
51955
52426
|
}
|
|
51956
52427
|
}
|
|
51957
52428
|
},
|
|
@@ -52048,9 +52519,10 @@ var key = 'table_processor_observer-resize';
|
|
|
52048
52519
|
if (!editor.o.tableAllowCellResize) {
|
|
52049
52520
|
return;
|
|
52050
52521
|
}
|
|
52051
|
-
|
|
52522
|
+
var observeTables = function observeTables() {
|
|
52052
52523
|
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.$$)('table', editor.editor).forEach(_this.observe);
|
|
52053
|
-
}
|
|
52524
|
+
};
|
|
52525
|
+
editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', observeTables).on(this.j.ow, 'scroll.resize-cells', function() {
|
|
52054
52526
|
if (!_this.drag || _this.workRow) {
|
|
52055
52527
|
return;
|
|
52056
52528
|
}
|
|
@@ -52068,6 +52540,8 @@ var key = 'table_processor_observer-resize';
|
|
|
52068
52540
|
tableModule.normalizeTable(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(td, 'table', editor.editor));
|
|
52069
52541
|
});
|
|
52070
52542
|
});
|
|
52543
|
+
// None of those events comes with the editor's starting value
|
|
52544
|
+
observeTables();
|
|
52071
52545
|
}
|
|
52072
52546
|
},
|
|
52073
52547
|
{
|
|
@@ -52085,7 +52559,9 @@ var key = 'table_processor_observer-resize';
|
|
|
52085
52559
|
_this.hideResizeHandle();
|
|
52086
52560
|
}
|
|
52087
52561
|
}).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle(function(event) {
|
|
52088
|
-
|
|
52562
|
+
// A drag from a cell isn't a resize, and the handle on
|
|
52563
|
+
// a border it passes would take its moves (#1778)
|
|
52564
|
+
if (_this.j.isLocked || _this.j.o.readonly || event.buttons) {
|
|
52089
52565
|
return;
|
|
52090
52566
|
}
|
|
52091
52567
|
var cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.up(event.target, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isCell, table);
|
|
@@ -54370,7 +54846,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
|
|
|
54370
54846
|
|
|
54371
54847
|
|
|
54372
54848
|
var key = 'table_processor_observer';
|
|
54373
|
-
var MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
|
|
54374
54849
|
var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
54375
54850
|
"use strict";
|
|
54376
54851
|
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(selectCells, Plugin);
|
|
@@ -54385,7 +54860,12 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54385
54860
|
* First selected cell
|
|
54386
54861
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__selectedCell", null), /**
|
|
54387
54862
|
* User is selecting cells now
|
|
54388
|
-
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isSelectionMode", false)
|
|
54863
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isSelectionMode", false), /**
|
|
54864
|
+
* The cell the marks were last drawn to
|
|
54865
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__movedTo", null), /**
|
|
54866
|
+
* A drag let go outside the table ends in a click on the editor, which
|
|
54867
|
+
* would unmark its cells
|
|
54868
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__keepMarks", false);
|
|
54389
54869
|
return _this;
|
|
54390
54870
|
}
|
|
54391
54871
|
;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(selectCells, [
|
|
@@ -54408,6 +54888,8 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54408
54888
|
// move the caret, as table-keyboard-navigation's do
|
|
54409
54889
|
.on('keydown', this.__onKeyDown, {
|
|
54410
54890
|
top: true
|
|
54891
|
+
}).on('clickEditor', this.__onClickAfterDrag, {
|
|
54892
|
+
top: true
|
|
54411
54893
|
}).on('keydown.select-cells', function(event) {
|
|
54412
54894
|
if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.KEY_TAB) {
|
|
54413
54895
|
_this.unselectCells();
|
|
@@ -54553,12 +55035,15 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54553
55035
|
}
|
|
54554
55036
|
this.__isSelectionMode = true;
|
|
54555
55037
|
this.__selectedCell = cell;
|
|
55038
|
+
this.__movedTo = cell;
|
|
54556
55039
|
this.__tableModule.addSelection(cell);
|
|
54557
|
-
this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells',
|
|
54558
|
-
|
|
54559
|
-
|
|
54560
|
-
|
|
54561
|
-
|
|
55040
|
+
this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', this.__onMove.bind(this, table)).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
|
|
55041
|
+
new Set([
|
|
55042
|
+
this.j.ew,
|
|
55043
|
+
this.j.ow
|
|
55044
|
+
]).forEach(function(win) {
|
|
55045
|
+
return _this.j.e.on(win, 'mouseup.select-cells touchend.select-cells', _this.__onRelease.bind(_this, table));
|
|
55046
|
+
});
|
|
54562
55047
|
return false;
|
|
54563
55048
|
}
|
|
54564
55049
|
},
|
|
@@ -54569,6 +55054,29 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54569
55054
|
this.__onRemoveSelection();
|
|
54570
55055
|
}
|
|
54571
55056
|
},
|
|
55057
|
+
{
|
|
55058
|
+
key: "onMouseDown",
|
|
55059
|
+
value: function onMouseDown() {
|
|
55060
|
+
this.__keepMarks = false;
|
|
55061
|
+
}
|
|
55062
|
+
},
|
|
55063
|
+
{
|
|
55064
|
+
key: "__onClickAfterDrag",
|
|
55065
|
+
value: /**
|
|
55066
|
+
* The click that ends a drag let go outside the table, and inside the
|
|
55067
|
+
* editor, lands on the editor. Taken on, it would unmark the cells and
|
|
55068
|
+
* close their popup. As for the click on a row after a drag over the
|
|
55069
|
+
* cells, the browser's own selection from the drag goes
|
|
55070
|
+
*/ function __onClickAfterDrag() {
|
|
55071
|
+
if (this.__keepMarks) {
|
|
55072
|
+
var _this_j_s_sel;
|
|
55073
|
+
this.__keepMarks = false;
|
|
55074
|
+
(_this_j_s_sel = this.j.s.sel) === null || _this_j_s_sel === void 0 ? void 0 : _this_j_s_sel.removeAllRanges();
|
|
55075
|
+
this.j.e.stopPropagation('clickEditor');
|
|
55076
|
+
return false;
|
|
55077
|
+
}
|
|
55078
|
+
}
|
|
55079
|
+
},
|
|
54572
55080
|
{
|
|
54573
55081
|
key: "onChange",
|
|
54574
55082
|
value: function onChange() {
|
|
@@ -54592,16 +55100,20 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54592
55100
|
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
54593
55101
|
// host, so the lookup must start from the shadow root
|
|
54594
55102
|
var node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
54595
|
-
|
|
54596
|
-
return;
|
|
54597
|
-
}
|
|
54598
|
-
var cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, [
|
|
55103
|
+
var cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, [
|
|
54599
55104
|
'td',
|
|
54600
55105
|
'th'
|
|
54601
55106
|
], table);
|
|
54602
55107
|
if (!cell || !this.__selectedCell) {
|
|
54603
55108
|
return;
|
|
54604
55109
|
}
|
|
55110
|
+
// The marks change only when the mouse goes into another cell, and then
|
|
55111
|
+
// at once rather than throttled, as the browser's own selection from
|
|
55112
|
+
// the drag shows in the cells between until they do (#1778)
|
|
55113
|
+
if (cell === this.__movedTo) {
|
|
55114
|
+
return;
|
|
55115
|
+
}
|
|
55116
|
+
this.__movedTo = cell;
|
|
54605
55117
|
if (cell !== this.__selectedCell) {
|
|
54606
55118
|
this.j.lock(key);
|
|
54607
55119
|
}
|
|
@@ -54645,9 +55157,7 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54645
55157
|
value: /**
|
|
54646
55158
|
* Stop a selection process
|
|
54647
55159
|
*/ function __onStopSelection(table, e) {
|
|
54648
|
-
var _this = this;
|
|
54649
55160
|
var _this_j_o_shadowRoot;
|
|
54650
|
-
var _box_bound__, _box_bound__1;
|
|
54651
55161
|
if (!this.__selectedCell) {
|
|
54652
55162
|
return;
|
|
54653
55163
|
}
|
|
@@ -54670,10 +55180,40 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54670
55180
|
if (ownTable && ownTable !== table) {
|
|
54671
55181
|
return; // Nested tables
|
|
54672
55182
|
}
|
|
54673
|
-
|
|
55183
|
+
this.__showCellsPopup(table, [
|
|
54674
55184
|
cell,
|
|
54675
55185
|
this.__selectedCell
|
|
54676
|
-
])
|
|
55186
|
+
]);
|
|
55187
|
+
this.__stopListening();
|
|
55188
|
+
}
|
|
55189
|
+
},
|
|
55190
|
+
{
|
|
55191
|
+
key: "__onRelease",
|
|
55192
|
+
value: /**
|
|
55193
|
+
* A drag let go outside the table doesn't reach the table's `mouseup`, so
|
|
55194
|
+
* the window's ends it, leaving the cells marked as they were (#1774)
|
|
55195
|
+
*/ function __onRelease(table, e) {
|
|
55196
|
+
if (this.__isSelectionMode) {
|
|
55197
|
+
this.__isSelectionMode = false;
|
|
55198
|
+
if (!this.j.isLockedNotBy(key)) {
|
|
55199
|
+
this.j.unlock();
|
|
55200
|
+
}
|
|
55201
|
+
var cells = this.__tableModule.getAllSelectedCells();
|
|
55202
|
+
// One let go outside the editor clicks outside it, which unmarks them
|
|
55203
|
+
if (cells.length > 1 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(this.j.editor, e.target)) {
|
|
55204
|
+
this.__keepMarks = true;
|
|
55205
|
+
this.__showCellsPopup(table, cells);
|
|
55206
|
+
}
|
|
55207
|
+
}
|
|
55208
|
+
this.__stopListening();
|
|
55209
|
+
}
|
|
55210
|
+
},
|
|
55211
|
+
{
|
|
55212
|
+
key: "__showCellsPopup",
|
|
55213
|
+
value: function __showCellsPopup(table, cells) {
|
|
55214
|
+
var _this = this;
|
|
55215
|
+
var _box_bound__, _box_bound__1;
|
|
55216
|
+
var bound = this.__tableModule.getSelectedBound(table, cells), box = this.__tableModule.formalMatrix(table);
|
|
54677
55217
|
var max = (_box_bound__ = box[bound[1][0]]) === null || _box_bound__ === void 0 ? void 0 : _box_bound__[bound[1][1]], min = (_box_bound__1 = box[bound[0][0]]) === null || _box_bound__1 === void 0 ? void 0 : _box_bound__1[bound[0][1]];
|
|
54678
55218
|
// `getSelectedBound` keeps its `Infinity` sentinel when none of the
|
|
54679
55219
|
// selected cells belong to this table's matrix — e.g. after a
|
|
@@ -54693,10 +55233,22 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54693
55233
|
height: maxOffset.top - minOffset.top + maxOffset.height
|
|
54694
55234
|
};
|
|
54695
55235
|
}, 'cells');
|
|
55236
|
+
}
|
|
55237
|
+
},
|
|
55238
|
+
{
|
|
55239
|
+
key: "__stopListening",
|
|
55240
|
+
value: function __stopListening() {
|
|
55241
|
+
var _this = this;
|
|
54696
55242
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_12__.$$)('table', this.j.editor).forEach(function(table) {
|
|
54697
55243
|
_this.j.e.off(table, 'mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells');
|
|
54698
55244
|
});
|
|
54699
|
-
|
|
55245
|
+
new Set([
|
|
55246
|
+
this.j.ew,
|
|
55247
|
+
this.j.ow
|
|
55248
|
+
]).forEach(function(win) {
|
|
55249
|
+
return _this.j.e.off(win, 'mouseup.select-cells touchend.select-cells');
|
|
55250
|
+
});
|
|
55251
|
+
this.__movedTo = null;
|
|
54700
55252
|
}
|
|
54701
55253
|
},
|
|
54702
55254
|
{
|
|
@@ -54899,7 +55451,8 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54899
55451
|
key: "beforeDestruct",
|
|
54900
55452
|
value: /** @override */ function beforeDestruct(jodit) {
|
|
54901
55453
|
this.__onRemoveSelection();
|
|
54902
|
-
|
|
55454
|
+
this.__stopListening();
|
|
55455
|
+
jodit.e.off('.select-cells').off('keydown', this.__onKeyDown).off('clickEditor', this.__onClickAfterDrag);
|
|
54903
55456
|
}
|
|
54904
55457
|
}
|
|
54905
55458
|
]);
|
|
@@ -54920,6 +55473,15 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
|
|
|
54920
55473
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
|
|
54921
55474
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':outsideClick')
|
|
54922
55475
|
], selectCells.prototype, "onOutsideClick", null);
|
|
55476
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
|
|
55477
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)([
|
|
55478
|
+
':mousedown',
|
|
55479
|
+
':touchstart'
|
|
55480
|
+
])
|
|
55481
|
+
], selectCells.prototype, "onMouseDown", null);
|
|
55482
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
|
|
55483
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
|
|
55484
|
+
], selectCells.prototype, "__onClickAfterDrag", null);
|
|
54923
55485
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
|
|
54924
55486
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':change')
|
|
54925
55487
|
], selectCells.prototype, "onChange", null);
|
|
@@ -54976,10 +55538,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
54976
55538
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
|
|
54977
55539
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23211);
|
|
54978
55540
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
|
|
54979
|
-
/* harmony import */ var
|
|
54980
|
-
/* harmony import */ var
|
|
54981
|
-
/* harmony import */ var
|
|
54982
|
-
/* harmony import */ var
|
|
55541
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(88475);
|
|
55542
|
+
/* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(57821);
|
|
55543
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(91206);
|
|
55544
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(4099);
|
|
55545
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(47670);
|
|
54983
55546
|
/*!
|
|
54984
55547
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
54985
55548
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -55003,6 +55566,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55003
55566
|
|
|
55004
55567
|
|
|
55005
55568
|
|
|
55569
|
+
|
|
55006
55570
|
/**
|
|
55007
55571
|
* A utility plugin that allows you to subscribe to a click/mousedown/touchstart/mouseup on an element in DOM order
|
|
55008
55572
|
*
|
|
@@ -55029,7 +55593,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55029
55593
|
* Where the last press started. Chrome reports a drag that begins in one
|
|
55030
55594
|
* element and ends in another as a `click` on their common ancestor, so a
|
|
55031
55595
|
* press inside a popup is remembered to tell such a drag from a real click.
|
|
55032
|
-
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressTarget", null)
|
|
55596
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressTarget", null), /**
|
|
55597
|
+
* The row a press to its right was beside, and the caret it put there,
|
|
55598
|
+
* while the button is down
|
|
55599
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressBesideRow", null);
|
|
55033
55600
|
return _this;
|
|
55034
55601
|
}
|
|
55035
55602
|
;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(select, [
|
|
@@ -55040,6 +55607,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55040
55607
|
this.proxyEventsList.forEach(function(eventName) {
|
|
55041
55608
|
jodit.e.on(eventName + '.select', _this.onStartSelection);
|
|
55042
55609
|
});
|
|
55610
|
+
jodit.e.on('dblclick', this.__onDblClickBesideRow, {
|
|
55611
|
+
top: true
|
|
55612
|
+
});
|
|
55043
55613
|
}
|
|
55044
55614
|
},
|
|
55045
55615
|
{
|
|
@@ -55047,8 +55617,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55047
55617
|
value: function beforeDestruct(jodit) {
|
|
55048
55618
|
var _this = this;
|
|
55049
55619
|
this.proxyEventsList.forEach(function(eventName) {
|
|
55050
|
-
jodit.e.
|
|
55620
|
+
jodit.e.off(eventName + '.select', _this.onStartSelection);
|
|
55051
55621
|
});
|
|
55622
|
+
this.__endPressBesideRow();
|
|
55623
|
+
jodit.e.off('dblclick', this.__onDblClickBesideRow);
|
|
55052
55624
|
}
|
|
55053
55625
|
},
|
|
55054
55626
|
{
|
|
@@ -55057,7 +55629,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55057
55629
|
var j = this.j;
|
|
55058
55630
|
var result, target = e.target;
|
|
55059
55631
|
while(result === undefined && target && target !== j.editor){
|
|
55060
|
-
result = j.e.fire((0,
|
|
55632
|
+
result = j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_12__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
|
|
55061
55633
|
target = target.parentElement;
|
|
55062
55634
|
}
|
|
55063
55635
|
if (e.type === 'click' && result === undefined && target === j.editor) {
|
|
@@ -55086,10 +55658,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55086
55658
|
}
|
|
55087
55659
|
// Selecting the text of a popup input with the mouse and releasing
|
|
55088
55660
|
// the button past the popup's edge is not a click outside of it.
|
|
55089
|
-
if (pressed &&
|
|
55661
|
+
if (pressed && jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.UIElement.closestElement(pressed, jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.Popup)) {
|
|
55090
55662
|
return;
|
|
55091
55663
|
}
|
|
55092
|
-
var box =
|
|
55664
|
+
var box = jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.UIElement.closestElement(node, jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.Popup);
|
|
55093
55665
|
if (!box) {
|
|
55094
55666
|
this.j.e.fire('outsideClick', e);
|
|
55095
55667
|
}
|
|
@@ -55147,6 +55719,161 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55147
55719
|
}
|
|
55148
55720
|
}
|
|
55149
55721
|
},
|
|
55722
|
+
{
|
|
55723
|
+
key: "__rowBeside",
|
|
55724
|
+
value: /**
|
|
55725
|
+
* The table row the mouse is to the right of
|
|
55726
|
+
*/ function __rowBeside(e) {
|
|
55727
|
+
var _rows_find;
|
|
55728
|
+
var j = this.j;
|
|
55729
|
+
var target = e.target;
|
|
55730
|
+
if (j.o.readonly || e.button !== 0 || e.detail > 2 || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isHTMLElement(target) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.closest(target, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isCell, j.editor)) {
|
|
55731
|
+
return null;
|
|
55732
|
+
}
|
|
55733
|
+
var table = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(target.children).find(function(elm) {
|
|
55734
|
+
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(elm, 'table')) {
|
|
55735
|
+
return false;
|
|
55736
|
+
}
|
|
55737
|
+
var box = elm.getBoundingClientRect();
|
|
55738
|
+
return e.clientX >= box.right && e.clientY >= box.top && e.clientY < box.bottom;
|
|
55739
|
+
});
|
|
55740
|
+
var rows = table ? (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(table.rows).filter(function(row) {
|
|
55741
|
+
return row.cells.length;
|
|
55742
|
+
}) : [];
|
|
55743
|
+
if (!table || !rows.length) {
|
|
55744
|
+
return null;
|
|
55745
|
+
}
|
|
55746
|
+
var row = (_rows_find = rows.find(function(row) {
|
|
55747
|
+
return e.clientY < row.getBoundingClientRect().bottom;
|
|
55748
|
+
})) !== null && _rows_find !== void 0 ? _rows_find : rows[rows.length - 1];
|
|
55749
|
+
return {
|
|
55750
|
+
table: table,
|
|
55751
|
+
row: row
|
|
55752
|
+
};
|
|
55753
|
+
}
|
|
55754
|
+
},
|
|
55755
|
+
{
|
|
55756
|
+
key: "onMouseDownBesideTableRow",
|
|
55757
|
+
value: /**
|
|
55758
|
+
* A press to the right of a table row puts the caret where Word's typing
|
|
55759
|
+
* goes from there: the start of the next row's first cell, or of the block
|
|
55760
|
+
* after the table for the last row (#1770). The browsers put it after the
|
|
55761
|
+
* table, whichever row it's beside, so typing starts a new line below it.
|
|
55762
|
+
* Their own press is stopped, as its drag would start after the table and
|
|
55763
|
+
* take in the rows below first
|
|
55764
|
+
*/ function onMouseDownBesideTableRow(e) {
|
|
55765
|
+
var _this = this;
|
|
55766
|
+
var j = this.j;
|
|
55767
|
+
var beside = this.__rowBeside(e);
|
|
55768
|
+
if (!beside) {
|
|
55769
|
+
return;
|
|
55770
|
+
}
|
|
55771
|
+
// A press before the last one was let go must not stack its listeners
|
|
55772
|
+
this.__endPressBesideRow();
|
|
55773
|
+
e.preventDefault();
|
|
55774
|
+
this.__putCaretBesideRow(beside.table, beside.row);
|
|
55775
|
+
this.__pressBesideRow = {
|
|
55776
|
+
row: beside.row,
|
|
55777
|
+
caret: j.s.range.cloneRange()
|
|
55778
|
+
};
|
|
55779
|
+
j.e.on(j.ew, 'mousemove', this.__onDragFromRow);
|
|
55780
|
+
new Set([
|
|
55781
|
+
j.ew,
|
|
55782
|
+
j.ow
|
|
55783
|
+
]).forEach(function(win) {
|
|
55784
|
+
return j.e.on(win, 'mouseup', _this.__onReleaseFromRow);
|
|
55785
|
+
});
|
|
55786
|
+
}
|
|
55787
|
+
},
|
|
55788
|
+
{
|
|
55789
|
+
key: "__onDragFromRow",
|
|
55790
|
+
value: /**
|
|
55791
|
+
* A drag from beside a row selects from the end of the row to the mouse,
|
|
55792
|
+
* and back beside the row it's the caret again
|
|
55793
|
+
*/ function __onDragFromRow(e) {
|
|
55794
|
+
var _this___rowBeside;
|
|
55795
|
+
var s = this.j.s;
|
|
55796
|
+
var press = this.__pressBesideRow;
|
|
55797
|
+
if (!press || !(e.buttons & 1)) {
|
|
55798
|
+
this.__endPressBesideRow();
|
|
55799
|
+
return;
|
|
55800
|
+
}
|
|
55801
|
+
if (((_this___rowBeside = this.__rowBeside(e)) === null || _this___rowBeside === void 0 ? void 0 : _this___rowBeside.row) === press.row) {
|
|
55802
|
+
if (!s.isCollapsed()) {
|
|
55803
|
+
s.selectRange(press.caret.cloneRange());
|
|
55804
|
+
}
|
|
55805
|
+
return;
|
|
55806
|
+
}
|
|
55807
|
+
var cells = press.row.cells;
|
|
55808
|
+
var last = cells[cells.length - 1];
|
|
55809
|
+
if (s.insertCursorAtPoint(e.clientX, e.clientY)) {
|
|
55810
|
+
var _s_sel;
|
|
55811
|
+
var _s_range = s.range, startContainer = _s_range.startContainer, startOffset = _s_range.startOffset;
|
|
55812
|
+
(_s_sel = s.sel) === null || _s_sel === void 0 ? void 0 : _s_sel.setBaseAndExtent(last, last.childNodes.length, startContainer, startOffset);
|
|
55813
|
+
}
|
|
55814
|
+
}
|
|
55815
|
+
},
|
|
55816
|
+
{
|
|
55817
|
+
key: "__onReleaseFromRow",
|
|
55818
|
+
value: /**
|
|
55819
|
+
* In iframe mode, a press in an editor without the focus puts the caret at
|
|
55820
|
+
* its end, so a release that selected nothing puts it back
|
|
55821
|
+
*/ function __onReleaseFromRow() {
|
|
55822
|
+
var press = this.__pressBesideRow;
|
|
55823
|
+
this.__endPressBesideRow();
|
|
55824
|
+
if (press && this.j.s.isCollapsed()) {
|
|
55825
|
+
this.j.s.selectRange(press.caret);
|
|
55826
|
+
}
|
|
55827
|
+
}
|
|
55828
|
+
},
|
|
55829
|
+
{
|
|
55830
|
+
key: "__endPressBesideRow",
|
|
55831
|
+
value: function __endPressBesideRow() {
|
|
55832
|
+
var _this = this;
|
|
55833
|
+
var j = this.j;
|
|
55834
|
+
this.__pressBesideRow = null;
|
|
55835
|
+
j.e.off(j.ew, 'mousemove', this.__onDragFromRow);
|
|
55836
|
+
new Set([
|
|
55837
|
+
j.ew,
|
|
55838
|
+
j.ow
|
|
55839
|
+
]).forEach(function(win) {
|
|
55840
|
+
return j.e.off(win, 'mouseup', _this.__onReleaseFromRow);
|
|
55841
|
+
});
|
|
55842
|
+
}
|
|
55843
|
+
},
|
|
55844
|
+
{
|
|
55845
|
+
key: "__onDblClickBesideRow",
|
|
55846
|
+
value: /**
|
|
55847
|
+
* A double click beside a row is two clicks there, so add-new-line,
|
|
55848
|
+
* which adds a line on a double click with a caret, doesn't see it
|
|
55849
|
+
*/ function __onDblClickBesideRow(e) {
|
|
55850
|
+
if (this.__rowBeside(e)) {
|
|
55851
|
+
this.j.e.stopPropagation('dblclick');
|
|
55852
|
+
return false;
|
|
55853
|
+
}
|
|
55854
|
+
}
|
|
55855
|
+
},
|
|
55856
|
+
{
|
|
55857
|
+
key: "__putCaretBesideRow",
|
|
55858
|
+
value: function __putCaretBesideRow(table, row) {
|
|
55859
|
+
var j = this.j;
|
|
55860
|
+
var rows = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(table.rows);
|
|
55861
|
+
var next = rows.slice(rows.indexOf(row) + 1).find(function(row) {
|
|
55862
|
+
return row.cells.length;
|
|
55863
|
+
});
|
|
55864
|
+
var after = table.nextSibling;
|
|
55865
|
+
while(after && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isEmptyTextNode(after)){
|
|
55866
|
+
after = after.nextSibling;
|
|
55867
|
+
}
|
|
55868
|
+
if (next) {
|
|
55869
|
+
j.s.setCursorIn(next.cells[0], true);
|
|
55870
|
+
} else if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isBlock(after) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(after, 'table') && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isContentEditable(after, j.editor)) {
|
|
55871
|
+
j.s.setCursorIn(after, true);
|
|
55872
|
+
} else {
|
|
55873
|
+
j.s.setCursorAfter(table);
|
|
55874
|
+
}
|
|
55875
|
+
}
|
|
55876
|
+
},
|
|
55150
55877
|
{
|
|
55151
55878
|
key: "onClickKeepPendingFormat",
|
|
55152
55879
|
value: /**
|
|
@@ -55210,7 +55937,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55210
55937
|
}
|
|
55211
55938
|
]);
|
|
55212
55939
|
return select;
|
|
55213
|
-
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(
|
|
55940
|
+
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_13__.Plugin));
|
|
55214
55941
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
|
|
55215
55942
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
55216
55943
|
], select.prototype, "onStartSelection", null);
|
|
@@ -55238,6 +55965,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
55238
55965
|
':click'
|
|
55239
55966
|
])
|
|
55240
55967
|
], select.prototype, "onClickRightOfNestedListItem", null);
|
|
55968
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
|
|
55969
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':mousedown')
|
|
55970
|
+
], select.prototype, "onMouseDownBesideTableRow", null);
|
|
55971
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
|
|
55972
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
55973
|
+
], select.prototype, "__onDragFromRow", null);
|
|
55974
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
|
|
55975
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
55976
|
+
], select.prototype, "__onReleaseFromRow", null);
|
|
55977
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
|
|
55978
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
55979
|
+
], select.prototype, "__onDblClickBesideRow", null);
|
|
55241
55980
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
|
|
55242
55981
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)([
|
|
55243
55982
|
':click'
|