jodit 4.20.1 → 4.20.3
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 +22 -0
- package/es2015/jodit.css +68 -9
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +10 -10
- package/es2015/jodit.js +309 -72
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +7 -7
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +10 -10
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +7 -7
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +68 -9
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +11 -11
- package/es2021/jodit.js +302 -72
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +7 -7
- 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 +68 -9
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +19 -19
- package/es2021.en/jodit.js +302 -72
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +19 -19
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +45 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +358 -74
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/modules/file-browser/builders/context-menu.js +6 -2
- package/esm/modules/toolbar/button/button.d.ts +10 -0
- package/esm/modules/toolbar/button/button.js +17 -2
- package/esm/modules/toolbar/button/select/select.d.ts +6 -0
- package/esm/modules/toolbar/button/select/select.js +18 -0
- package/esm/modules/toolbar/factory.js +3 -1
- package/esm/modules/widget/color-picker/color-picker.js +76 -18
- package/esm/plugins/anchor/anchor.d.ts +11 -0
- package/esm/plugins/anchor/anchor.js +84 -8
- package/esm/plugins/backspace/cases/check-not-collapsed.js +1 -1
- package/esm/plugins/delete/delete.d.ts +12 -0
- package/esm/plugins/delete/delete.js +66 -4
- package/esm/plugins/delete/interface.d.ts +4 -2
- package/esm/plugins/dtd/after-insert/remove-extra-br.js +7 -1
- package/esm/plugins/fullsize/config.js +2 -0
- package/esm/plugins/hr/hr.js +0 -1
- package/esm/plugins/line-height/config.js +0 -1
- package/esm/plugins/placeholder/placeholder.js +3 -1
- package/esm/types/toolbar.d.ts +2 -0
- package/package.json +1 -1
- package/types/modules/toolbar/button/button.d.ts +10 -0
- package/types/modules/toolbar/button/select/select.d.ts +6 -0
- package/types/plugins/anchor/anchor.d.ts +11 -0
- package/types/plugins/delete/delete.d.ts +12 -0
- package/types/plugins/delete/interface.d.ts +4 -2
- package/types/types/toolbar.d.ts +2 -0
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.20.
|
|
4
|
+
* Version: v4.20.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -2155,7 +2155,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2155
2155
|
* @packageDocumentation
|
|
2156
2156
|
* @module constants
|
|
2157
2157
|
*/
|
|
2158
|
-
var APP_VERSION = "4.20.
|
|
2158
|
+
var APP_VERSION = "4.20.3";
|
|
2159
2159
|
// prettier-ignore
|
|
2160
2160
|
var ES = "es5";
|
|
2161
2161
|
var IS_ES_MODERN = false;
|
|
@@ -26038,12 +26038,13 @@ var CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = function pr
|
|
|
26038
26038
|
}), temp_content = self.c.div(CLASS_PREVIEW, '<div class="jodit-icon_loader"></div>'), preview_box = self.c.div(CLASS_PREVIEW + '__box'), next = self.c.fromHTML(preview_tpl_next()), prev = self.c.fromHTML(preview_tpl_next('prev', 'left')), addLoadHandler = function addLoadHandler(src) {
|
|
26039
26039
|
var image = self.c.element('img');
|
|
26040
26040
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(image, 'src', src);
|
|
26041
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(image, 'alt', ga('data-name'));
|
|
26041
26042
|
var onload = function onload() {
|
|
26042
26043
|
var _self_events;
|
|
26043
26044
|
if (self.isInDestruct) {
|
|
26044
26045
|
return;
|
|
26045
26046
|
}
|
|
26046
|
-
self.e.off(image, 'load');
|
|
26047
|
+
self.e.off(image, 'load error');
|
|
26047
26048
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.detach(temp_content);
|
|
26048
26049
|
if (opt.showPreviewNavigation) {
|
|
26049
26050
|
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.prevWithClass(item, self.files.getFullElName('item'))) {
|
|
@@ -26058,7 +26059,10 @@ var CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = function pr
|
|
|
26058
26059
|
preview.setPosition();
|
|
26059
26060
|
self === null || self === void 0 ? void 0 : (_self_events = self.events) === null || _self_events === void 0 ? void 0 : _self_events.fire('previewOpenedAndLoaded');
|
|
26060
26061
|
};
|
|
26061
|
-
|
|
26062
|
+
// An image that can't load is shown too,
|
|
26063
|
+
// broken with the file's name, rather
|
|
26064
|
+
// than the loader for good
|
|
26065
|
+
self.e.on(image, 'load error', onload);
|
|
26062
26066
|
if (image.complete) {
|
|
26063
26067
|
onload();
|
|
26064
26068
|
}
|
|
@@ -31600,11 +31604,25 @@ var ToolbarButton = /*#__PURE__*/ function(UIButton) {
|
|
|
31600
31604
|
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
31601
31605
|
}
|
|
31602
31606
|
},
|
|
31607
|
+
{
|
|
31608
|
+
key: "isToggle",
|
|
31609
|
+
get: /**
|
|
31610
|
+
* A button that its control can show as on is a toggle, and says whether
|
|
31611
|
+
* it's pressed
|
|
31612
|
+
*/ function get() {
|
|
31613
|
+
var _this_control = this.control, isActive = _this_control.isActive, tags = _this_control.tags, css = _this_control.css;
|
|
31614
|
+
return Boolean(isActive || tags || css);
|
|
31615
|
+
}
|
|
31616
|
+
},
|
|
31603
31617
|
{
|
|
31604
31618
|
key: "onChangeActivated",
|
|
31605
|
-
value:
|
|
31606
|
-
|
|
31607
|
-
|
|
31619
|
+
value: /**
|
|
31620
|
+
* The pressed look comes from the mod, as any button looks pressed while
|
|
31621
|
+
* its list is open, and the container is a `listitem`, which can't have
|
|
31622
|
+
* `aria-pressed`
|
|
31623
|
+
*/ function onChangeActivated() {
|
|
31624
|
+
;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_28__.attr)(this.button, 'aria-pressed', this.isToggle ? this.state.activated : null);
|
|
31625
|
+
this.setMod('activated', this.state.activated || null);
|
|
31608
31626
|
}
|
|
31609
31627
|
},
|
|
31610
31628
|
{
|
|
@@ -31688,6 +31706,8 @@ var ToolbarButton = /*#__PURE__*/ function(UIButton) {
|
|
|
31688
31706
|
state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_21__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
|
|
31689
31707
|
}
|
|
31690
31708
|
state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
|
|
31709
|
+
// UIButton's template makes every button a toggle
|
|
31710
|
+
this.onChangeActivated();
|
|
31691
31711
|
}
|
|
31692
31712
|
},
|
|
31693
31713
|
{
|
|
@@ -32344,7 +32364,8 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
|
|
|
32344
32364
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(84839);
|
|
32345
32365
|
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(62101);
|
|
32346
32366
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85932);
|
|
32347
|
-
/* harmony import */ var
|
|
32367
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7909);
|
|
32368
|
+
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(22533);
|
|
32348
32369
|
/*!
|
|
32349
32370
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32350
32371
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32363,6 +32384,7 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
|
|
|
32363
32384
|
|
|
32364
32385
|
|
|
32365
32386
|
|
|
32387
|
+
|
|
32366
32388
|
var ToolbarSelect = /*#__PURE__*/ function(ToolbarButton) {
|
|
32367
32389
|
"use strict";
|
|
32368
32390
|
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__._)(ToolbarSelect, ToolbarButton);
|
|
@@ -32377,6 +32399,13 @@ var ToolbarSelect = /*#__PURE__*/ function(ToolbarButton) {
|
|
|
32377
32399
|
return 'ToolbarSelect';
|
|
32378
32400
|
}
|
|
32379
32401
|
},
|
|
32402
|
+
{
|
|
32403
|
+
key: "isToggle",
|
|
32404
|
+
get: // It shows its value, rather than being on or off
|
|
32405
|
+
function get() {
|
|
32406
|
+
return false;
|
|
32407
|
+
}
|
|
32408
|
+
},
|
|
32380
32409
|
{
|
|
32381
32410
|
key: "update",
|
|
32382
32411
|
value: function update() {
|
|
@@ -32395,10 +32424,25 @@ var ToolbarSelect = /*#__PURE__*/ function(ToolbarButton) {
|
|
|
32395
32424
|
this.state.text = (_ref = (_this_control_textTemplate = (_this_control1 = this.control).textTemplate) === null || _this_control_textTemplate === void 0 ? void 0 : _this_control_textTemplate.call(_this_control1, this.jodit, text)) !== null && _ref !== void 0 ? _ref : text;
|
|
32396
32425
|
}
|
|
32397
32426
|
}
|
|
32427
|
+
},
|
|
32428
|
+
{
|
|
32429
|
+
key: "updateAriaLabel",
|
|
32430
|
+
value: /**
|
|
32431
|
+
* The button shows only the value, so its name says which control it
|
|
32432
|
+
* is too: "Font size, 16px"
|
|
32433
|
+
*/ function updateAriaLabel() {
|
|
32434
|
+
var _this_text_textContent;
|
|
32435
|
+
(0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_3__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_4__._)(ToolbarSelect.prototype), "updateAriaLabel", this).call(this);
|
|
32436
|
+
var tooltip = this.state.tooltip;
|
|
32437
|
+
var value = (_this_text_textContent = this.text.textContent) === null || _this_text_textContent === void 0 ? void 0 : _this_text_textContent.trim();
|
|
32438
|
+
if (tooltip && value) {
|
|
32439
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', "".concat(this.jodit.i18n(tooltip), ", ").concat(value));
|
|
32440
|
+
}
|
|
32441
|
+
}
|
|
32398
32442
|
}
|
|
32399
32443
|
]);
|
|
32400
32444
|
return ToolbarSelect;
|
|
32401
|
-
}(
|
|
32445
|
+
}(_button__WEBPACK_IMPORTED_MODULE_11__.ToolbarButton);
|
|
32402
32446
|
ToolbarSelect = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__._)([
|
|
32403
32447
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.component
|
|
32404
32448
|
], ToolbarSelect);
|
|
@@ -32862,7 +32906,9 @@ ToolbarEditorCollection = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7
|
|
|
32862
32906
|
function makeSelect(view, control) {
|
|
32863
32907
|
var target = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
32864
32908
|
var ToolbarSelect = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_0__.getComponentClass)('ToolbarSelect');
|
|
32865
|
-
|
|
32909
|
+
var select = new ToolbarSelect(view, control, target);
|
|
32910
|
+
select.state.tabIndex = view.o.allowTabNavigation ? 0 : -1;
|
|
32911
|
+
return select;
|
|
32866
32912
|
}
|
|
32867
32913
|
|
|
32868
32914
|
|
|
@@ -33942,11 +33988,13 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
33942
33988
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33943
33989
|
/* harmony export */ ColorPickerWidget: function() { return /* binding */ ColorPickerWidget; }
|
|
33944
33990
|
/* harmony export */ });
|
|
33945
|
-
/* harmony import */ var
|
|
33946
|
-
/* harmony import */ var
|
|
33947
|
-
/* harmony import */ var
|
|
33948
|
-
/* harmony import */ var
|
|
33949
|
-
/* harmony import */ var
|
|
33991
|
+
/* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42395);
|
|
33992
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
|
|
33993
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27795);
|
|
33994
|
+
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
|
|
33995
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4099);
|
|
33996
|
+
/* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54522);
|
|
33997
|
+
/* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_palette_svg__WEBPACK_IMPORTED_MODULE_5__);
|
|
33950
33998
|
/*!
|
|
33951
33999
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33952
34000
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -33956,11 +34004,14 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
33956
34004
|
* @packageDocumentation
|
|
33957
34005
|
* @module modules/widget/color-picker
|
|
33958
34006
|
*/
|
|
34007
|
+
var _this = undefined;
|
|
34008
|
+
|
|
34009
|
+
|
|
33959
34010
|
|
|
33960
34011
|
|
|
33961
34012
|
|
|
33962
34013
|
|
|
33963
|
-
|
|
34014
|
+
jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__.Icon.set('palette', (_palette_svg__WEBPACK_IMPORTED_MODULE_5___default()));
|
|
33964
34015
|
/**
|
|
33965
34016
|
* Build color picker
|
|
33966
34017
|
*
|
|
@@ -33978,29 +34029,66 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
33978
34029
|
* });
|
|
33979
34030
|
* ```
|
|
33980
34031
|
*/ var ColorPickerWidget = function ColorPickerWidget(editor, callback, coldColor) {
|
|
33981
|
-
var
|
|
34032
|
+
var _items_find;
|
|
34033
|
+
var cn = 'jodit-color-picker', valueHex = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.normalizeColor)(coldColor), form = editor.c.div(cn), iconPalette = editor.o.textIcons ? "<span>".concat(editor.i18n('palette'), "</span>") : jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__.Icon.get('palette'), eachColor = function eachColor1(colors) {
|
|
33982
34034
|
var stack = [];
|
|
33983
|
-
if ((0,
|
|
34035
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isPlainObject)(colors)) {
|
|
33984
34036
|
Object.keys(colors).forEach(function(key) {
|
|
33985
34037
|
stack.push('<div class="'.concat(cn, "__group ").concat(cn, "__group-").concat(key, '">'));
|
|
33986
34038
|
stack.push(eachColor(colors[key]));
|
|
33987
34039
|
stack.push('</div>');
|
|
33988
34040
|
});
|
|
33989
|
-
} else if ((0,
|
|
34041
|
+
} else if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isArray)(colors)) {
|
|
33990
34042
|
colors.forEach(function(color) {
|
|
33991
|
-
|
|
34043
|
+
var active = valueHex === color;
|
|
34044
|
+
stack.push('<button type="button" class=\''.concat(cn, "__color-item ").concat(active ? cn + '__color-item_active_true' : '', "' title=\"").concat(color, '" aria-pressed="').concat(active, '" tabindex="-1" style="background-color:').concat(color, '" data-color="').concat(color, '"></button>'));
|
|
33992
34045
|
});
|
|
33993
34046
|
}
|
|
33994
34047
|
return stack.join('');
|
|
33995
34048
|
};
|
|
33996
34049
|
// The group wrapper lays the colors out in rows, so a flat list needs one
|
|
33997
34050
|
// too. See #1487
|
|
33998
|
-
var groups = (0,
|
|
33999
|
-
|
|
34000
|
-
|
|
34001
|
-
|
|
34002
|
-
|
|
34003
|
-
var
|
|
34051
|
+
var groups = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isArray)(editor.o.colors) ? '<div class="'.concat(cn, '__group">').concat(eachColor(editor.o.colors), "</div>") : eachColor(editor.o.colors);
|
|
34052
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(form, editor.c.fromHTML('<div class="'.concat(cn, '__groups">').concat(groups, "</div>")));
|
|
34053
|
+
var items = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.toArray)(form.querySelectorAll(".".concat(cn, "__color-item")));
|
|
34054
|
+
// Tab stops at one color, the current one or the first, and the arrow
|
|
34055
|
+
// keys move from it
|
|
34056
|
+
var tabStop = (_items_find = items.find(function(item) {
|
|
34057
|
+
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(item, 'aria-pressed') === 'true';
|
|
34058
|
+
})) !== null && _items_find !== void 0 ? _items_find : items[0];
|
|
34059
|
+
if (tabStop) {
|
|
34060
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(tabStop, 'tabindex', 0);
|
|
34061
|
+
}
|
|
34062
|
+
// Along a row, or to the nearest color in the row above or below, as the
|
|
34063
|
+
// palette is laid out
|
|
34064
|
+
var nextItem = function nextItem(item, key) {
|
|
34065
|
+
var index = items.indexOf(item);
|
|
34066
|
+
if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT) {
|
|
34067
|
+
var step = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT ? -1 : 1;
|
|
34068
|
+
var rtl = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.css)(item, 'direction') === 'rtl';
|
|
34069
|
+
return items[index + (rtl ? -step : step)];
|
|
34070
|
+
}
|
|
34071
|
+
var down = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_DOWN, rows = items.filter(function(other) {
|
|
34072
|
+
return down ? other.offsetTop > item.offsetTop : other.offsetTop < item.offsetTop;
|
|
34073
|
+
});
|
|
34074
|
+
if (!rows.length) {
|
|
34075
|
+
return;
|
|
34076
|
+
}
|
|
34077
|
+
var top = (down ? Math.min : Math.max).apply(_this, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(rows.map(function(other) {
|
|
34078
|
+
return other.offsetTop;
|
|
34079
|
+
}))), distance = function distance(other) {
|
|
34080
|
+
return Math.abs(other.offsetLeft - item.offsetLeft);
|
|
34081
|
+
};
|
|
34082
|
+
return rows.filter(function(other) {
|
|
34083
|
+
return other.offsetTop === top;
|
|
34084
|
+
}).reduce(function(nearest, other) {
|
|
34085
|
+
return distance(other) < distance(nearest) ? other : nearest;
|
|
34086
|
+
});
|
|
34087
|
+
};
|
|
34088
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(form, editor.c.fromHTML('<div data-ref="extra" class="'.concat(cn, '__extra"></div>')));
|
|
34089
|
+
var extra = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.refs)(form).extra;
|
|
34090
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(extra, editor.c.fromHTML('<div class="'.concat(cn, '__hex"><input data-ref="hexInput" type="text" spellcheck="false" aria-label="HEX" placeholder="#FF0000" value="').concat(valueHex || '', '"/></div>')));
|
|
34091
|
+
var hexInput = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.refs)(form).hexInput;
|
|
34004
34092
|
// Enter applies the value and closes the popup; removing the focused
|
|
34005
34093
|
// input then makes Chrome fire `change` on it, which would apply the
|
|
34006
34094
|
// same color a second time and toggle it off again. See #1459
|
|
@@ -34015,8 +34103,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
34015
34103
|
if (!isHex && !isRgb) {
|
|
34016
34104
|
return;
|
|
34017
34105
|
}
|
|
34018
|
-
var color = (0,
|
|
34019
|
-
if (color && (0,
|
|
34106
|
+
var color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.normalizeColor)(isHex && !raw.startsWith('#') ? '#' + raw : raw);
|
|
34107
|
+
if (color && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isFunction)(callback)) {
|
|
34020
34108
|
appliedHexValue = raw;
|
|
34021
34109
|
callback(color);
|
|
34022
34110
|
}
|
|
@@ -34031,40 +34119,79 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
34031
34119
|
e.stopPropagation();
|
|
34032
34120
|
applyHexInput();
|
|
34033
34121
|
});
|
|
34034
|
-
|
|
34035
|
-
if (editor.o.showBrowserColorPicker && (0,
|
|
34036
|
-
|
|
34122
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(extra, editor.c.fromHTML('<button type="button" class="'.concat(cn, '__remove" data-color="" title="').concat(editor.i18n('Remove'), '">').concat(editor.o.textIcons ? editor.i18n('Remove') : jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__.Icon.get('eraser'), "</button>")));
|
|
34123
|
+
if (editor.o.showBrowserColorPicker && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.hasBrowserColorPicker)()) {
|
|
34124
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(extra, editor.c.fromHTML('<div class="'.concat(cn, '__native">').concat(iconPalette, '<input type="color" value="#ffffff"/></div>')));
|
|
34037
34125
|
editor.e.on(form, 'change', function(e) {
|
|
34038
34126
|
e.stopPropagation();
|
|
34039
34127
|
var target = e.target;
|
|
34040
|
-
if (!target || !target.tagName || !
|
|
34128
|
+
if (!target || !target.tagName || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(target, 'input') || target.type !== 'color') {
|
|
34041
34129
|
return;
|
|
34042
34130
|
}
|
|
34043
34131
|
var color = target.value || '';
|
|
34044
|
-
if ((0,
|
|
34132
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isFunction)(callback)) {
|
|
34045
34133
|
callback(color);
|
|
34046
34134
|
}
|
|
34047
34135
|
e.preventDefault();
|
|
34048
34136
|
});
|
|
34049
34137
|
}
|
|
34138
|
+
// The color of a swatch, or '' for Remove, from an event on it or its icon
|
|
34139
|
+
var colorOf = function colorOf(node) {
|
|
34140
|
+
var button = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, function(elm) {
|
|
34141
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isHTMLElement(elm) && (elm.classList.contains(cn + '__color-item') || elm.classList.contains(cn + '__remove'));
|
|
34142
|
+
}, form);
|
|
34143
|
+
return button ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(button, '-color') || '' : undefined;
|
|
34144
|
+
};
|
|
34145
|
+
var apply = function apply(color) {
|
|
34146
|
+
if (callback && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isFunction)(callback)) {
|
|
34147
|
+
callback(color);
|
|
34148
|
+
}
|
|
34149
|
+
};
|
|
34150
|
+
// A pointer applies the color on `mousedown`, which keeps the selection.
|
|
34151
|
+
// The keyboard and screen readers press the button, which sends only
|
|
34152
|
+
// `click`, so a click after the pointer's `mousedown` is skipped
|
|
34153
|
+
var pointerPressed = false;
|
|
34050
34154
|
editor.e.on(form, 'mousedown touchend', function(e) {
|
|
34051
34155
|
// let the hex/native inputs receive focus and clicks
|
|
34052
|
-
if (
|
|
34156
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(e.target, 'input')) {
|
|
34053
34157
|
e.stopPropagation();
|
|
34054
34158
|
return;
|
|
34055
34159
|
}
|
|
34056
34160
|
e.stopPropagation();
|
|
34057
34161
|
e.preventDefault();
|
|
34058
|
-
var
|
|
34059
|
-
if (
|
|
34060
|
-
|
|
34162
|
+
var color = colorOf(e.target);
|
|
34163
|
+
if (color !== undefined) {
|
|
34164
|
+
pointerPressed = e.type === 'mousedown';
|
|
34165
|
+
apply(color);
|
|
34061
34166
|
}
|
|
34062
|
-
|
|
34167
|
+
});
|
|
34168
|
+
editor.e.on(form, 'click', function(e) {
|
|
34169
|
+
var color = colorOf(e.target);
|
|
34170
|
+
if (color !== undefined && !pointerPressed) {
|
|
34171
|
+
apply(color);
|
|
34172
|
+
}
|
|
34173
|
+
pointerPressed = false;
|
|
34174
|
+
}).on(form, 'keydown', function(e) {
|
|
34175
|
+
var _nextItem;
|
|
34176
|
+
pointerPressed = false;
|
|
34177
|
+
var item = e.target;
|
|
34178
|
+
if (!items.includes(item) || ![
|
|
34179
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT,
|
|
34180
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT,
|
|
34181
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_UP,
|
|
34182
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_DOWN
|
|
34183
|
+
].includes(e.key)) {
|
|
34063
34184
|
return;
|
|
34064
34185
|
}
|
|
34065
|
-
|
|
34066
|
-
|
|
34067
|
-
|
|
34186
|
+
// The toolbar's dropdown would walk every color one by one
|
|
34187
|
+
e.preventDefault();
|
|
34188
|
+
e.stopPropagation();
|
|
34189
|
+
(_nextItem = nextItem(item, e.key)) === null || _nextItem === void 0 ? void 0 : _nextItem.focus();
|
|
34190
|
+
}).on(form, 'focusin', function(e) {
|
|
34191
|
+
if (items.includes(e.target)) {
|
|
34192
|
+
items.forEach(function(item) {
|
|
34193
|
+
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(item, 'tabindex', item === e.target ? 0 : -1);
|
|
34194
|
+
});
|
|
34068
34195
|
}
|
|
34069
34196
|
});
|
|
34070
34197
|
editor.e.fire('afterGenerateColorPicker', form, extra, callback, valueHex);
|
|
@@ -35442,7 +35569,8 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
|
35442
35569
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
|
|
35443
35570
|
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(59400);
|
|
35444
35571
|
/* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5658);
|
|
35445
|
-
/* harmony import */ var
|
|
35572
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(29434);
|
|
35573
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(95085);
|
|
35446
35574
|
/*!
|
|
35447
35575
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35448
35576
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35467,16 +35595,23 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
|
35467
35595
|
|
|
35468
35596
|
|
|
35469
35597
|
|
|
35470
|
-
|
|
35471
|
-
var MARKER = [
|
|
35472
|
-
'id',
|
|
35473
|
-
'name'
|
|
35474
|
-
].map(function(key) {
|
|
35475
|
-
return ".jodit-wysiwyg a[".concat(key, "]:not([href]):empty::before");
|
|
35476
|
-
}).join(',');
|
|
35598
|
+
|
|
35477
35599
|
/**
|
|
35478
|
-
*
|
|
35479
|
-
|
|
35600
|
+
* The editing area of an editor with the plugin, when it shares its document
|
|
35601
|
+
* with the page and so with any other editor on it
|
|
35602
|
+
*/ var WITH_ANCHORS = 'jodit-wysiwyg_anchors';
|
|
35603
|
+
/**
|
|
35604
|
+
* Each anchor's marker, in the editing areas `scope` picks out
|
|
35605
|
+
*/ function markerStyle(scope) {
|
|
35606
|
+
var marker = [
|
|
35607
|
+
'id',
|
|
35608
|
+
'name'
|
|
35609
|
+
].map(function(key) {
|
|
35610
|
+
return ".jodit-wysiwyg".concat(scope, " a[").concat(key, "]:not([href]):empty::before");
|
|
35611
|
+
}).join(',');
|
|
35612
|
+
var icon = 'url("data:image/svg+xml,'.concat(encodeURIComponent(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_15__.Icon.get('anchor')), '") center/contain no-repeat');
|
|
35613
|
+
return "".concat(marker, "{display:inline-block;width:.75em;height:1em;margin:0 .1em;vertical-align:-.15em;background-color:var(--jd-color-icon,#4c4c4c);-webkit-mask:").concat(icon, ";mask:").concat(icon, ";cursor:pointer;content:''}");
|
|
35614
|
+
}
|
|
35480
35615
|
/**
|
|
35481
35616
|
* The attribute `markAnchor` gives an anchor: an empty `<a>` with no `href`
|
|
35482
35617
|
*/ var MARK = ' contenteditable="false"';
|
|
@@ -35505,8 +35640,14 @@ var MARKER = [
|
|
|
35505
35640
|
{
|
|
35506
35641
|
key: "afterInit",
|
|
35507
35642
|
value: /** @override */ function afterInit(jodit) {
|
|
35643
|
+
// An iframe's document is the editor's alone, and its body is part of
|
|
35644
|
+
// the value with `editHTMLDocumentMode`, so it gets no class
|
|
35645
|
+
var shared = jodit.ed === jodit.od;
|
|
35646
|
+
if (shared) {
|
|
35647
|
+
jodit.editor.classList.add(WITH_ANCHORS);
|
|
35648
|
+
}
|
|
35508
35649
|
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
35509
|
-
;(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.getContainer)(jodit, 'anchor', 'style', true).textContent =
|
|
35650
|
+
;(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.getContainer)(jodit, 'anchor', 'style', true).textContent = markerStyle(shared ? '.' + WITH_ANCHORS : '');
|
|
35510
35651
|
jodit.e.on('generateAnchorForm.anchor', this.__generateForm).on('clickA touchstartA', this.__onClickA, {
|
|
35511
35652
|
top: true
|
|
35512
35653
|
});
|
|
@@ -35551,6 +35692,27 @@ var MARKER = [
|
|
|
35551
35692
|
data.value = unmarkAnchors(data.value);
|
|
35552
35693
|
}
|
|
35553
35694
|
},
|
|
35695
|
+
{
|
|
35696
|
+
key: "onBeforePasteInsert",
|
|
35697
|
+
value: /**
|
|
35698
|
+
* A pasted or dropped copy of an anchor the document already has gets the
|
|
35699
|
+
* next free name, as `fees-2`, and the links that came with it follow it
|
|
35700
|
+
*/ function onBeforePasteInsert(html) {
|
|
35701
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isElement(html) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isFragment(html)) {
|
|
35702
|
+
this.__renameCopies(html);
|
|
35703
|
+
return;
|
|
35704
|
+
}
|
|
35705
|
+
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(html) || !/<a\s/i.test(html)) {
|
|
35706
|
+
return;
|
|
35707
|
+
}
|
|
35708
|
+
// Inert, so nothing in it loads
|
|
35709
|
+
var template = this.j.createInside.element('template');
|
|
35710
|
+
template.innerHTML = html;
|
|
35711
|
+
if (this.__renameCopies(template.content)) {
|
|
35712
|
+
return template.innerHTML;
|
|
35713
|
+
}
|
|
35714
|
+
}
|
|
35715
|
+
},
|
|
35554
35716
|
{
|
|
35555
35717
|
key: "__generateForm",
|
|
35556
35718
|
value: /**
|
|
@@ -35710,10 +35872,60 @@ var MARKER = [
|
|
|
35710
35872
|
});
|
|
35711
35873
|
}
|
|
35712
35874
|
},
|
|
35875
|
+
{
|
|
35876
|
+
key: "__renameCopies",
|
|
35877
|
+
value: /**
|
|
35878
|
+
* Gives each anchor in `root` whose name the document already has the
|
|
35879
|
+
* next free one, avoiding the names in `root` too, and points the links
|
|
35880
|
+
* in `root` to it at the new name. Whether any was renamed
|
|
35881
|
+
*/ function __renameCopies(root) {
|
|
35882
|
+
var _this = this;
|
|
35883
|
+
var inRoot = new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.toArray)(root.querySelectorAll('[id], a[name]')).map(function(elm) {
|
|
35884
|
+
return elm.id || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(elm, 'name');
|
|
35885
|
+
}));
|
|
35886
|
+
var renamed = new Map();
|
|
35887
|
+
var anchors = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isAnchor)(root) ? [
|
|
35888
|
+
root
|
|
35889
|
+
] : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.getAnchors)(root);
|
|
35890
|
+
anchors.forEach(function(anchor) {
|
|
35891
|
+
var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.getAnchorName)(anchor);
|
|
35892
|
+
if (!_this.__isTaken(name, null)) {
|
|
35893
|
+
return;
|
|
35894
|
+
}
|
|
35895
|
+
var copy = name;
|
|
35896
|
+
for(var n = 2; inRoot.has(copy) || _this.__isTaken(copy, null); n += 1){
|
|
35897
|
+
copy = "".concat(name, "-").concat(n);
|
|
35898
|
+
}
|
|
35899
|
+
[
|
|
35900
|
+
'id',
|
|
35901
|
+
'name'
|
|
35902
|
+
].forEach(function(key) {
|
|
35903
|
+
if (anchor.hasAttribute(key)) {
|
|
35904
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(anchor, key, copy);
|
|
35905
|
+
}
|
|
35906
|
+
});
|
|
35907
|
+
inRoot.add(copy);
|
|
35908
|
+
renamed.set(name, copy);
|
|
35909
|
+
});
|
|
35910
|
+
if (!renamed.size) {
|
|
35911
|
+
return false;
|
|
35912
|
+
}
|
|
35913
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.toArray)(root.querySelectorAll('a[href]')).forEach(function(link) {
|
|
35914
|
+
var _attr;
|
|
35915
|
+
var href = (_attr = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(link, 'href')) !== null && _attr !== void 0 ? _attr : '';
|
|
35916
|
+
var copy = href[0] === '#' && renamed.get(href.slice(1));
|
|
35917
|
+
if (copy) {
|
|
35918
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(link, 'href', '#' + copy);
|
|
35919
|
+
}
|
|
35920
|
+
});
|
|
35921
|
+
return true;
|
|
35922
|
+
}
|
|
35923
|
+
},
|
|
35713
35924
|
{
|
|
35714
35925
|
key: "beforeDestruct",
|
|
35715
35926
|
value: /** @override */ function beforeDestruct(jodit) {
|
|
35716
35927
|
this.__dropForm();
|
|
35928
|
+
jodit.editor.classList.remove(WITH_ANCHORS);
|
|
35717
35929
|
jodit.e.off('generateAnchorForm.anchor', this.__generateForm).off('clickA touchstartA', this.__onClickA);
|
|
35718
35930
|
}
|
|
35719
35931
|
}
|
|
@@ -35734,6 +35946,9 @@ var MARKER = [
|
|
|
35734
35946
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
35735
35947
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':afterGetValueFromEditor')
|
|
35736
35948
|
], anchor.prototype, "onAfterGetValueFromEditor", null);
|
|
35949
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
35950
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':beforePasteInsert')
|
|
35951
|
+
], anchor.prototype, "onBeforePasteInsert", null);
|
|
35737
35952
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
35738
35953
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
35739
35954
|
], anchor.prototype, "__generateForm", null);
|
|
@@ -36563,7 +36778,7 @@ function moveContentAndRemoveEmpty(jodit, mainClosestBox, sibling, backspace) {
|
|
|
36563
36778
|
* @private
|
|
36564
36779
|
*/ function checkNotCollapsed(jodit) {
|
|
36565
36780
|
if (!jodit.s.isCollapsed()) {
|
|
36566
|
-
jodit.execCommand('
|
|
36781
|
+
jodit.execCommand('delete', false, true);
|
|
36567
36782
|
return true;
|
|
36568
36783
|
}
|
|
36569
36784
|
return false;
|
|
@@ -40250,6 +40465,13 @@ var KEEPS_SPACES = new Set([
|
|
|
40250
40465
|
'pre-wrap',
|
|
40251
40466
|
'break-spaces'
|
|
40252
40467
|
]);
|
|
40468
|
+
/**
|
|
40469
|
+
* Formatting that the next letter keeps once all of the text in it is
|
|
40470
|
+
* deleted with a key: a formatting tag, or a span with styles of its own.
|
|
40471
|
+
* Not a link, which new text isn't added to, or a wrapper such as a video's
|
|
40472
|
+
*/ function keepsFormat(node) {
|
|
40473
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isHTMLElement(node) && !node.hasAttribute('contenteditable') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTemporary(node) && (/^(STRONG|B|EM|I|U|S|SUB|SUP)$/.test(node.nodeName) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(node, 'span') && node.hasAttribute('style'));
|
|
40474
|
+
}
|
|
40253
40475
|
/**
|
|
40254
40476
|
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
40255
40477
|
* line break, a block or text starting (or ending) with a plain space
|
|
@@ -40319,7 +40541,7 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
40319
40541
|
},
|
|
40320
40542
|
{
|
|
40321
40543
|
key: "__onDeleteCommand",
|
|
40322
|
-
value: function __onDeleteCommand() {
|
|
40544
|
+
value: function __onDeleteCommand(command, showUI, keepFormat) {
|
|
40323
40545
|
var jodit = this.jodit;
|
|
40324
40546
|
if (jodit.s.isCollapsed()) {
|
|
40325
40547
|
return;
|
|
@@ -40327,6 +40549,7 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
40327
40549
|
jodit.s.expandSelection();
|
|
40328
40550
|
var range = jodit.s.range;
|
|
40329
40551
|
this.__moveEdgesIntoCells(range);
|
|
40552
|
+
var format = keepFormat === true ? this.__formatTakenWhole(range) : [];
|
|
40330
40553
|
var caret = this.__clearSelectedCells(range);
|
|
40331
40554
|
if (caret && range.collapsed) {
|
|
40332
40555
|
jodit.s.selectRange(caret);
|
|
@@ -40342,8 +40565,12 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
40342
40565
|
this.__keepSpacesVisibleBesideTable(fake);
|
|
40343
40566
|
range.setStartBefore(fake);
|
|
40344
40567
|
range.collapse(true);
|
|
40345
|
-
|
|
40346
|
-
|
|
40568
|
+
if (format.length && !caret) {
|
|
40569
|
+
this.__keepFormat(format, fake, range);
|
|
40570
|
+
} else {
|
|
40571
|
+
this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
|
|
40572
|
+
this.__addBrInEmptyBlock(fake, range);
|
|
40573
|
+
}
|
|
40347
40574
|
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(fake);
|
|
40348
40575
|
jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
|
|
40349
40576
|
return false;
|
|
@@ -40368,6 +40595,56 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
|
|
|
40368
40595
|
}
|
|
40369
40596
|
}
|
|
40370
40597
|
},
|
|
40598
|
+
{
|
|
40599
|
+
key: "__formatTakenWhole",
|
|
40600
|
+
value: /**
|
|
40601
|
+
* The formatting elements the deletion takes whole from its start,
|
|
40602
|
+
* outermost first: `<strong>` and `<em>` for all of the text in
|
|
40603
|
+
* `<strong><em>cd</em></strong>`
|
|
40604
|
+
*/ function __formatTakenWhole(range) {
|
|
40605
|
+
var format = [];
|
|
40606
|
+
var whole = this.jodit.s.createRange();
|
|
40607
|
+
var startContainer = range.startContainer, startOffset = range.startOffset;
|
|
40608
|
+
var node = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(startContainer) ? null : startContainer.childNodes[startOffset];
|
|
40609
|
+
// Through a block taken whole, as a line holding only the word is
|
|
40610
|
+
while(jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isHTMLElement(node)){
|
|
40611
|
+
whole.selectNode(node);
|
|
40612
|
+
if (range.compareBoundaryPoints(Range.END_TO_END, whole) < 0) {
|
|
40613
|
+
break;
|
|
40614
|
+
}
|
|
40615
|
+
if (keepsFormat(node)) {
|
|
40616
|
+
format.push(node);
|
|
40617
|
+
} else if (format.length || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(node)) {
|
|
40618
|
+
break;
|
|
40619
|
+
}
|
|
40620
|
+
node = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.toArray)(node.childNodes).find(function(child) {
|
|
40621
|
+
var _child_nodeValue;
|
|
40622
|
+
return !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(child) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.trimInv)((_child_nodeValue = child.nodeValue) !== null && _child_nodeValue !== void 0 ? _child_nodeValue : '');
|
|
40623
|
+
});
|
|
40624
|
+
}
|
|
40625
|
+
return format;
|
|
40626
|
+
}
|
|
40627
|
+
},
|
|
40628
|
+
{
|
|
40629
|
+
key: "__keepFormat",
|
|
40630
|
+
value: /**
|
|
40631
|
+
* As the browsers do, the next letter typed keeps the formatting that was
|
|
40632
|
+
* deleted whole: empty copies go where it was, round an invisible space,
|
|
40633
|
+
* as Bold does at a collapsed caret, and the caret goes inside (#1784)
|
|
40634
|
+
*/ function __keepFormat(format, fake, range) {
|
|
40635
|
+
var copies = format.map(function(element) {
|
|
40636
|
+
return element.cloneNode(false);
|
|
40637
|
+
});
|
|
40638
|
+
for(var i = 1; i < copies.length; i += 1){
|
|
40639
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(copies[i - 1], copies[i]);
|
|
40640
|
+
}
|
|
40641
|
+
var text = this.jodit.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INVISIBLE_SPACE);
|
|
40642
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(copies[copies.length - 1], text);
|
|
40643
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.before(fake, copies[0]);
|
|
40644
|
+
range.setStartAfter(text);
|
|
40645
|
+
range.collapse(true);
|
|
40646
|
+
}
|
|
40647
|
+
},
|
|
40371
40648
|
{
|
|
40372
40649
|
key: "__clearSelectedCells",
|
|
40373
40650
|
value: /**
|
|
@@ -41263,7 +41540,13 @@ var brBoxes = new Set([
|
|
|
41263
41540
|
// text; moving it before the `<br>` would put it on a line of its own
|
|
41264
41541
|
// below the block (#1315)
|
|
41265
41542
|
if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(node, jodit.s.range.startContainer)) {
|
|
41266
|
-
|
|
41543
|
+
// Not with setCursorBefore: the text node it adds for the caret
|
|
41544
|
+
// stays after the inserted element once the `<br>` has gone, and
|
|
41545
|
+
// Right or End then take the caret into it, out of the element
|
|
41546
|
+
var range = jodit.s.createRange();
|
|
41547
|
+
range.setStartBefore(br);
|
|
41548
|
+
range.collapse(true);
|
|
41549
|
+
jodit.s.selectRange(range);
|
|
41267
41550
|
}
|
|
41268
41551
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(br);
|
|
41269
41552
|
}
|
|
@@ -43540,6 +43823,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.fullsize = {
|
|
|
43540
43823
|
exec: function exec(editor) {
|
|
43541
43824
|
editor.toggleFullSize();
|
|
43542
43825
|
},
|
|
43826
|
+
// Makes it a toggle. `update` sets the state, which holds while the editor doesn't have the focus
|
|
43827
|
+
isActive: function isActive(editor) {
|
|
43828
|
+
return editor.isFullSize;
|
|
43829
|
+
},
|
|
43543
43830
|
update: function update(editor, button) {
|
|
43544
43831
|
var mode = editor.isFullSize ? 'shrink' : 'fullsize';
|
|
43545
43832
|
button.state.activated = editor.isFullSize;
|
|
@@ -43935,9 +44222,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_7__.pluginSystem.add('hotkeys', hotke
|
|
|
43935
44222
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__.Icon.set('hr', (_hr_svg__WEBPACK_IMPORTED_MODULE_4___default()));
|
|
43936
44223
|
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.hr = {
|
|
43937
44224
|
command: 'insertHorizontalRule',
|
|
43938
|
-
tags: [
|
|
43939
|
-
'hr'
|
|
43940
|
-
],
|
|
43941
44225
|
tooltip: 'Insert Horizontal Line'
|
|
43942
44226
|
};
|
|
43943
44227
|
function hr(editor) {
|
|
@@ -49439,9 +49723,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.defaultLineHeight = n
|
|
|
49439
49723
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('line-height', (_line_height_svg__WEBPACK_IMPORTED_MODULE_3___default()));
|
|
49440
49724
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.lineHeight = {
|
|
49441
49725
|
command: 'applyLineHeight',
|
|
49442
|
-
tags: [
|
|
49443
|
-
'ol'
|
|
49444
|
-
],
|
|
49445
49726
|
tooltip: 'Line height',
|
|
49446
49727
|
list: [
|
|
49447
49728
|
1,
|
|
@@ -52848,10 +53129,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
52848
53129
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23211);
|
|
52849
53130
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
|
|
52850
53131
|
/* harmony import */ var jodit_core_helpers_checker_is_marker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(23175);
|
|
52851
|
-
/* harmony import */ var
|
|
52852
|
-
/* harmony import */ var
|
|
52853
|
-
/* harmony import */ var
|
|
52854
|
-
/* harmony import */ var
|
|
53132
|
+
/* harmony import */ var jodit_core_helpers_utils_anchor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85371);
|
|
53133
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7909);
|
|
53134
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(80991);
|
|
53135
|
+
/* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(18855);
|
|
53136
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(8257);
|
|
52855
53137
|
/*!
|
|
52856
53138
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
52857
53139
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -52878,6 +53160,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
|
|
|
52878
53160
|
|
|
52879
53161
|
|
|
52880
53162
|
|
|
53163
|
+
|
|
52881
53164
|
/**
|
|
52882
53165
|
* Check if root node is empty
|
|
52883
53166
|
* @private
|
|
@@ -52906,8 +53189,9 @@ function isBlank(root) {
|
|
|
52906
53189
|
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isText(first) && !next) {
|
|
52907
53190
|
return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isEmptyTextNode(first);
|
|
52908
53191
|
}
|
|
53192
|
+
// An anchor has no text, but it's content, shown as a marker
|
|
52909
53193
|
return !next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.each(first, function(elm) {
|
|
52910
|
-
return !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isLeaf(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isList(elm)) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isEmpty(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(elm, 'br'));
|
|
53194
|
+
return !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isLeaf(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isList(elm) || (0,jodit_core_helpers_utils_anchor__WEBPACK_IMPORTED_MODULE_12__.isAnchor)(elm)) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isEmpty(elm) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(elm, 'br'));
|
|
52911
53195
|
});
|
|
52912
53196
|
}
|
|
52913
53197
|
/**
|
|
@@ -52923,7 +53207,7 @@ function isBlank(root) {
|
|
|
52923
53207
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "addEvents", function() {
|
|
52924
53208
|
var editor = _this.j;
|
|
52925
53209
|
if (editor.o.useInputsPlaceholder && editor.element.hasAttribute('placeholder')) {
|
|
52926
|
-
_this.placeholderElm.innerHTML = (0,
|
|
53210
|
+
_this.placeholderElm.innerHTML = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_13__.attr)(editor.element, 'placeholder') || '';
|
|
52927
53211
|
}
|
|
52928
53212
|
editor.e.fire('placeholder', _this.placeholderElm.innerHTML);
|
|
52929
53213
|
editor.e.off('.placeholder').on('changePlace.placeholder', _this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder resize.placeholder', _this.toggle).on(window, 'load', _this.toggle);
|
|
@@ -52942,7 +53226,7 @@ function isBlank(root) {
|
|
|
52942
53226
|
}
|
|
52943
53227
|
this.placeholderElm = editor.c.fromHTML('<span data-ref="placeholder" style="display: none;" class="jodit-placeholder">'.concat(editor.i18n(editor.o.placeholder), "</span>"));
|
|
52944
53228
|
if (editor.o.direction === 'rtl') {
|
|
52945
|
-
(0,
|
|
53229
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.placeholderElm, {
|
|
52946
53230
|
right: 0,
|
|
52947
53231
|
direction: 'rtl'
|
|
52948
53232
|
});
|
|
@@ -52974,19 +53258,19 @@ function isBlank(root) {
|
|
|
52974
53258
|
var style2 = editor.ew.getComputedStyle(firstChild);
|
|
52975
53259
|
marginTop = parseInt(style2.getPropertyValue('margin-top'), 10);
|
|
52976
53260
|
marginLeft = parseInt(style2.getPropertyValue('margin-left'), 10);
|
|
52977
|
-
(0,
|
|
53261
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.placeholderElm, {
|
|
52978
53262
|
fontFamily: style2.getPropertyValue('font-family'),
|
|
52979
53263
|
fontSize: parseInt(style2.getPropertyValue('font-size'), 10),
|
|
52980
53264
|
lineHeight: style2.getPropertyValue('line-height')
|
|
52981
53265
|
});
|
|
52982
53266
|
} else {
|
|
52983
|
-
(0,
|
|
53267
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.placeholderElm, {
|
|
52984
53268
|
fontFamily: style.getPropertyValue('font-family'),
|
|
52985
53269
|
fontSize: parseInt(style.getPropertyValue('font-size'), 10),
|
|
52986
53270
|
lineHeight: style.getPropertyValue('line-height')
|
|
52987
53271
|
});
|
|
52988
53272
|
}
|
|
52989
|
-
;(0,
|
|
53273
|
+
;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.placeholderElm, {
|
|
52990
53274
|
display: 'block',
|
|
52991
53275
|
textAlign: style.getPropertyValue('text-align'),
|
|
52992
53276
|
paddingTop: parseInt(styleEditor.paddingTop, 10) + 'px',
|
|
@@ -53030,7 +53314,7 @@ function isBlank(root) {
|
|
|
53030
53314
|
}
|
|
53031
53315
|
]);
|
|
53032
53316
|
return placeholder;
|
|
53033
|
-
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(
|
|
53317
|
+
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_15__.Plugin));
|
|
53034
53318
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
53035
53319
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.debounce)(function(ctx) {
|
|
53036
53320
|
return ctx.defaultTimeout / 10;
|