jodit 4.20.1 → 4.20.2
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 +12 -0
- package/es2015/jodit.css +68 -9
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +8 -8
- package/es2015/jodit.js +221 -53
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +5 -5
- 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 +8 -8
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +5 -5
- 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 +9 -9
- package/es2021/jodit.js +217 -53
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +5 -5
- 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 +17 -17
- package/es2021.en/jodit.js +217 -53
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +17 -17
- 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 +262 -55
- 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/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/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/fullsize/config.js +2 -0
- package/esm/plugins/hr/hr.js +0 -1
- package/esm/plugins/line-height/config.js +0 -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/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.2
|
|
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.2";
|
|
2159
2159
|
// prettier-ignore
|
|
2160
2160
|
var ES = "es5";
|
|
2161
2161
|
var IS_ES_MODERN = false;
|
|
@@ -31600,11 +31600,25 @@ var ToolbarButton = /*#__PURE__*/ function(UIButton) {
|
|
|
31600
31600
|
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
31601
31601
|
}
|
|
31602
31602
|
},
|
|
31603
|
+
{
|
|
31604
|
+
key: "isToggle",
|
|
31605
|
+
get: /**
|
|
31606
|
+
* A button that its control can show as on is a toggle, and says whether
|
|
31607
|
+
* it's pressed
|
|
31608
|
+
*/ function get() {
|
|
31609
|
+
var _this_control = this.control, isActive = _this_control.isActive, tags = _this_control.tags, css = _this_control.css;
|
|
31610
|
+
return Boolean(isActive || tags || css);
|
|
31611
|
+
}
|
|
31612
|
+
},
|
|
31603
31613
|
{
|
|
31604
31614
|
key: "onChangeActivated",
|
|
31605
|
-
value:
|
|
31606
|
-
|
|
31607
|
-
|
|
31615
|
+
value: /**
|
|
31616
|
+
* The pressed look comes from the mod, as any button looks pressed while
|
|
31617
|
+
* its list is open, and the container is a `listitem`, which can't have
|
|
31618
|
+
* `aria-pressed`
|
|
31619
|
+
*/ function onChangeActivated() {
|
|
31620
|
+
;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_28__.attr)(this.button, 'aria-pressed', this.isToggle ? this.state.activated : null);
|
|
31621
|
+
this.setMod('activated', this.state.activated || null);
|
|
31608
31622
|
}
|
|
31609
31623
|
},
|
|
31610
31624
|
{
|
|
@@ -31688,6 +31702,8 @@ var ToolbarButton = /*#__PURE__*/ function(UIButton) {
|
|
|
31688
31702
|
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
31703
|
}
|
|
31690
31704
|
state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
|
|
31705
|
+
// UIButton's template makes every button a toggle
|
|
31706
|
+
this.onChangeActivated();
|
|
31691
31707
|
}
|
|
31692
31708
|
},
|
|
31693
31709
|
{
|
|
@@ -32344,7 +32360,8 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
|
|
|
32344
32360
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(84839);
|
|
32345
32361
|
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(62101);
|
|
32346
32362
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85932);
|
|
32347
|
-
/* harmony import */ var
|
|
32363
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7909);
|
|
32364
|
+
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(22533);
|
|
32348
32365
|
/*!
|
|
32349
32366
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
32350
32367
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -32363,6 +32380,7 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
|
|
|
32363
32380
|
|
|
32364
32381
|
|
|
32365
32382
|
|
|
32383
|
+
|
|
32366
32384
|
var ToolbarSelect = /*#__PURE__*/ function(ToolbarButton) {
|
|
32367
32385
|
"use strict";
|
|
32368
32386
|
(0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__._)(ToolbarSelect, ToolbarButton);
|
|
@@ -32377,6 +32395,13 @@ var ToolbarSelect = /*#__PURE__*/ function(ToolbarButton) {
|
|
|
32377
32395
|
return 'ToolbarSelect';
|
|
32378
32396
|
}
|
|
32379
32397
|
},
|
|
32398
|
+
{
|
|
32399
|
+
key: "isToggle",
|
|
32400
|
+
get: // It shows its value, rather than being on or off
|
|
32401
|
+
function get() {
|
|
32402
|
+
return false;
|
|
32403
|
+
}
|
|
32404
|
+
},
|
|
32380
32405
|
{
|
|
32381
32406
|
key: "update",
|
|
32382
32407
|
value: function update() {
|
|
@@ -32395,10 +32420,25 @@ var ToolbarSelect = /*#__PURE__*/ function(ToolbarButton) {
|
|
|
32395
32420
|
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
32421
|
}
|
|
32397
32422
|
}
|
|
32423
|
+
},
|
|
32424
|
+
{
|
|
32425
|
+
key: "updateAriaLabel",
|
|
32426
|
+
value: /**
|
|
32427
|
+
* The button shows only the value, so its name says which control it
|
|
32428
|
+
* is too: "Font size, 16px"
|
|
32429
|
+
*/ function updateAriaLabel() {
|
|
32430
|
+
var _this_text_textContent;
|
|
32431
|
+
(0,_swc_helpers_get__WEBPACK_IMPORTED_MODULE_3__._)((0,_swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_4__._)(ToolbarSelect.prototype), "updateAriaLabel", this).call(this);
|
|
32432
|
+
var tooltip = this.state.tooltip;
|
|
32433
|
+
var value = (_this_text_textContent = this.text.textContent) === null || _this_text_textContent === void 0 ? void 0 : _this_text_textContent.trim();
|
|
32434
|
+
if (tooltip && value) {
|
|
32435
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', "".concat(this.jodit.i18n(tooltip), ", ").concat(value));
|
|
32436
|
+
}
|
|
32437
|
+
}
|
|
32398
32438
|
}
|
|
32399
32439
|
]);
|
|
32400
32440
|
return ToolbarSelect;
|
|
32401
|
-
}(
|
|
32441
|
+
}(_button__WEBPACK_IMPORTED_MODULE_11__.ToolbarButton);
|
|
32402
32442
|
ToolbarSelect = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__._)([
|
|
32403
32443
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.component
|
|
32404
32444
|
], ToolbarSelect);
|
|
@@ -33942,11 +33982,13 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
33942
33982
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33943
33983
|
/* harmony export */ ColorPickerWidget: function() { return /* binding */ ColorPickerWidget; }
|
|
33944
33984
|
/* harmony export */ });
|
|
33945
|
-
/* harmony import */ var
|
|
33946
|
-
/* harmony import */ var
|
|
33947
|
-
/* harmony import */ var
|
|
33948
|
-
/* harmony import */ var
|
|
33949
|
-
/* harmony import */ var
|
|
33985
|
+
/* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42395);
|
|
33986
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
|
|
33987
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27795);
|
|
33988
|
+
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65946);
|
|
33989
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4099);
|
|
33990
|
+
/* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54522);
|
|
33991
|
+
/* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_palette_svg__WEBPACK_IMPORTED_MODULE_5__);
|
|
33950
33992
|
/*!
|
|
33951
33993
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
33952
33994
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -33956,11 +33998,14 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
|
|
|
33956
33998
|
* @packageDocumentation
|
|
33957
33999
|
* @module modules/widget/color-picker
|
|
33958
34000
|
*/
|
|
34001
|
+
var _this = undefined;
|
|
34002
|
+
|
|
33959
34003
|
|
|
33960
34004
|
|
|
33961
34005
|
|
|
33962
34006
|
|
|
33963
|
-
|
|
34007
|
+
|
|
34008
|
+
jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__.Icon.set('palette', (_palette_svg__WEBPACK_IMPORTED_MODULE_5___default()));
|
|
33964
34009
|
/**
|
|
33965
34010
|
* Build color picker
|
|
33966
34011
|
*
|
|
@@ -33978,29 +34023,66 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
33978
34023
|
* });
|
|
33979
34024
|
* ```
|
|
33980
34025
|
*/ var ColorPickerWidget = function ColorPickerWidget(editor, callback, coldColor) {
|
|
33981
|
-
var
|
|
34026
|
+
var _items_find;
|
|
34027
|
+
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
34028
|
var stack = [];
|
|
33983
|
-
if ((0,
|
|
34029
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isPlainObject)(colors)) {
|
|
33984
34030
|
Object.keys(colors).forEach(function(key) {
|
|
33985
34031
|
stack.push('<div class="'.concat(cn, "__group ").concat(cn, "__group-").concat(key, '">'));
|
|
33986
34032
|
stack.push(eachColor(colors[key]));
|
|
33987
34033
|
stack.push('</div>');
|
|
33988
34034
|
});
|
|
33989
|
-
} else if ((0,
|
|
34035
|
+
} else if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isArray)(colors)) {
|
|
33990
34036
|
colors.forEach(function(color) {
|
|
33991
|
-
|
|
34037
|
+
var active = valueHex === color;
|
|
34038
|
+
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
34039
|
});
|
|
33993
34040
|
}
|
|
33994
34041
|
return stack.join('');
|
|
33995
34042
|
};
|
|
33996
34043
|
// The group wrapper lays the colors out in rows, so a flat list needs one
|
|
33997
34044
|
// too. See #1487
|
|
33998
|
-
var groups = (0,
|
|
33999
|
-
|
|
34000
|
-
|
|
34001
|
-
|
|
34002
|
-
|
|
34003
|
-
var
|
|
34045
|
+
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);
|
|
34046
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(form, editor.c.fromHTML('<div class="'.concat(cn, '__groups">').concat(groups, "</div>")));
|
|
34047
|
+
var items = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.toArray)(form.querySelectorAll(".".concat(cn, "__color-item")));
|
|
34048
|
+
// Tab stops at one color, the current one or the first, and the arrow
|
|
34049
|
+
// keys move from it
|
|
34050
|
+
var tabStop = (_items_find = items.find(function(item) {
|
|
34051
|
+
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(item, 'aria-pressed') === 'true';
|
|
34052
|
+
})) !== null && _items_find !== void 0 ? _items_find : items[0];
|
|
34053
|
+
if (tabStop) {
|
|
34054
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(tabStop, 'tabindex', 0);
|
|
34055
|
+
}
|
|
34056
|
+
// Along a row, or to the nearest color in the row above or below, as the
|
|
34057
|
+
// palette is laid out
|
|
34058
|
+
var nextItem = function nextItem(item, key) {
|
|
34059
|
+
var index = items.indexOf(item);
|
|
34060
|
+
if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT) {
|
|
34061
|
+
var step = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT ? -1 : 1;
|
|
34062
|
+
var rtl = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.css)(item, 'direction') === 'rtl';
|
|
34063
|
+
return items[index + (rtl ? -step : step)];
|
|
34064
|
+
}
|
|
34065
|
+
var down = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_DOWN, rows = items.filter(function(other) {
|
|
34066
|
+
return down ? other.offsetTop > item.offsetTop : other.offsetTop < item.offsetTop;
|
|
34067
|
+
});
|
|
34068
|
+
if (!rows.length) {
|
|
34069
|
+
return;
|
|
34070
|
+
}
|
|
34071
|
+
var top = (down ? Math.min : Math.max).apply(_this, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(rows.map(function(other) {
|
|
34072
|
+
return other.offsetTop;
|
|
34073
|
+
}))), distance = function distance(other) {
|
|
34074
|
+
return Math.abs(other.offsetLeft - item.offsetLeft);
|
|
34075
|
+
};
|
|
34076
|
+
return rows.filter(function(other) {
|
|
34077
|
+
return other.offsetTop === top;
|
|
34078
|
+
}).reduce(function(nearest, other) {
|
|
34079
|
+
return distance(other) < distance(nearest) ? other : nearest;
|
|
34080
|
+
});
|
|
34081
|
+
};
|
|
34082
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(form, editor.c.fromHTML('<div data-ref="extra" class="'.concat(cn, '__extra"></div>')));
|
|
34083
|
+
var extra = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.refs)(form).extra;
|
|
34084
|
+
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>')));
|
|
34085
|
+
var hexInput = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.refs)(form).hexInput;
|
|
34004
34086
|
// Enter applies the value and closes the popup; removing the focused
|
|
34005
34087
|
// input then makes Chrome fire `change` on it, which would apply the
|
|
34006
34088
|
// same color a second time and toggle it off again. See #1459
|
|
@@ -34015,8 +34097,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
34015
34097
|
if (!isHex && !isRgb) {
|
|
34016
34098
|
return;
|
|
34017
34099
|
}
|
|
34018
|
-
var color = (0,
|
|
34019
|
-
if (color && (0,
|
|
34100
|
+
var color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.normalizeColor)(isHex && !raw.startsWith('#') ? '#' + raw : raw);
|
|
34101
|
+
if (color && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isFunction)(callback)) {
|
|
34020
34102
|
appliedHexValue = raw;
|
|
34021
34103
|
callback(color);
|
|
34022
34104
|
}
|
|
@@ -34031,40 +34113,79 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
34031
34113
|
e.stopPropagation();
|
|
34032
34114
|
applyHexInput();
|
|
34033
34115
|
});
|
|
34034
|
-
|
|
34035
|
-
if (editor.o.showBrowserColorPicker && (0,
|
|
34036
|
-
|
|
34116
|
+
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>")));
|
|
34117
|
+
if (editor.o.showBrowserColorPicker && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.hasBrowserColorPicker)()) {
|
|
34118
|
+
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
34119
|
editor.e.on(form, 'change', function(e) {
|
|
34038
34120
|
e.stopPropagation();
|
|
34039
34121
|
var target = e.target;
|
|
34040
|
-
if (!target || !target.tagName || !
|
|
34122
|
+
if (!target || !target.tagName || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(target, 'input') || target.type !== 'color') {
|
|
34041
34123
|
return;
|
|
34042
34124
|
}
|
|
34043
34125
|
var color = target.value || '';
|
|
34044
|
-
if ((0,
|
|
34126
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isFunction)(callback)) {
|
|
34045
34127
|
callback(color);
|
|
34046
34128
|
}
|
|
34047
34129
|
e.preventDefault();
|
|
34048
34130
|
});
|
|
34049
34131
|
}
|
|
34132
|
+
// The color of a swatch, or '' for Remove, from an event on it or its icon
|
|
34133
|
+
var colorOf = function colorOf(node) {
|
|
34134
|
+
var button = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, function(elm) {
|
|
34135
|
+
return jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isHTMLElement(elm) && (elm.classList.contains(cn + '__color-item') || elm.classList.contains(cn + '__remove'));
|
|
34136
|
+
}, form);
|
|
34137
|
+
return button ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(button, '-color') || '' : undefined;
|
|
34138
|
+
};
|
|
34139
|
+
var apply = function apply(color) {
|
|
34140
|
+
if (callback && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.isFunction)(callback)) {
|
|
34141
|
+
callback(color);
|
|
34142
|
+
}
|
|
34143
|
+
};
|
|
34144
|
+
// A pointer applies the color on `mousedown`, which keeps the selection.
|
|
34145
|
+
// The keyboard and screen readers press the button, which sends only
|
|
34146
|
+
// `click`, so a click after the pointer's `mousedown` is skipped
|
|
34147
|
+
var pointerPressed = false;
|
|
34050
34148
|
editor.e.on(form, 'mousedown touchend', function(e) {
|
|
34051
34149
|
// let the hex/native inputs receive focus and clicks
|
|
34052
|
-
if (
|
|
34150
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(e.target, 'input')) {
|
|
34053
34151
|
e.stopPropagation();
|
|
34054
34152
|
return;
|
|
34055
34153
|
}
|
|
34056
34154
|
e.stopPropagation();
|
|
34057
34155
|
e.preventDefault();
|
|
34058
|
-
var
|
|
34059
|
-
if (
|
|
34060
|
-
|
|
34156
|
+
var color = colorOf(e.target);
|
|
34157
|
+
if (color !== undefined) {
|
|
34158
|
+
pointerPressed = e.type === 'mousedown';
|
|
34159
|
+
apply(color);
|
|
34061
34160
|
}
|
|
34062
|
-
|
|
34161
|
+
});
|
|
34162
|
+
editor.e.on(form, 'click', function(e) {
|
|
34163
|
+
var color = colorOf(e.target);
|
|
34164
|
+
if (color !== undefined && !pointerPressed) {
|
|
34165
|
+
apply(color);
|
|
34166
|
+
}
|
|
34167
|
+
pointerPressed = false;
|
|
34168
|
+
}).on(form, 'keydown', function(e) {
|
|
34169
|
+
var _nextItem;
|
|
34170
|
+
pointerPressed = false;
|
|
34171
|
+
var item = e.target;
|
|
34172
|
+
if (!items.includes(item) || ![
|
|
34173
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT,
|
|
34174
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT,
|
|
34175
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_UP,
|
|
34176
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_DOWN
|
|
34177
|
+
].includes(e.key)) {
|
|
34063
34178
|
return;
|
|
34064
34179
|
}
|
|
34065
|
-
|
|
34066
|
-
|
|
34067
|
-
|
|
34180
|
+
// The toolbar's dropdown would walk every color one by one
|
|
34181
|
+
e.preventDefault();
|
|
34182
|
+
e.stopPropagation();
|
|
34183
|
+
(_nextItem = nextItem(item, e.key)) === null || _nextItem === void 0 ? void 0 : _nextItem.focus();
|
|
34184
|
+
}).on(form, 'focusin', function(e) {
|
|
34185
|
+
if (items.includes(e.target)) {
|
|
34186
|
+
items.forEach(function(item) {
|
|
34187
|
+
return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_3__.attr)(item, 'tabindex', item === e.target ? 0 : -1);
|
|
34188
|
+
});
|
|
34068
34189
|
}
|
|
34069
34190
|
});
|
|
34070
34191
|
editor.e.fire('afterGenerateColorPicker', form, extra, callback, valueHex);
|
|
@@ -35442,7 +35563,8 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
|
35442
35563
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
|
|
35443
35564
|
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(59400);
|
|
35444
35565
|
/* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5658);
|
|
35445
|
-
/* harmony import */ var
|
|
35566
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(29434);
|
|
35567
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(95085);
|
|
35446
35568
|
/*!
|
|
35447
35569
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35448
35570
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -35467,16 +35589,23 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
|
35467
35589
|
|
|
35468
35590
|
|
|
35469
35591
|
|
|
35470
|
-
|
|
35471
|
-
|
|
35472
|
-
|
|
35473
|
-
|
|
35474
|
-
|
|
35475
|
-
return ".jodit-wysiwyg a[".concat(key, "]:not([href]):empty::before");
|
|
35476
|
-
}).join(',');
|
|
35592
|
+
|
|
35593
|
+
/**
|
|
35594
|
+
* The editing area of an editor with the plugin, when it shares its document
|
|
35595
|
+
* with the page and so with any other editor on it
|
|
35596
|
+
*/ var WITH_ANCHORS = 'jodit-wysiwyg_anchors';
|
|
35477
35597
|
/**
|
|
35478
|
-
* Each anchor's marker, in the editing
|
|
35479
|
-
*/
|
|
35598
|
+
* Each anchor's marker, in the editing areas `scope` picks out
|
|
35599
|
+
*/ function markerStyle(scope) {
|
|
35600
|
+
var marker = [
|
|
35601
|
+
'id',
|
|
35602
|
+
'name'
|
|
35603
|
+
].map(function(key) {
|
|
35604
|
+
return ".jodit-wysiwyg".concat(scope, " a[").concat(key, "]:not([href]):empty::before");
|
|
35605
|
+
}).join(',');
|
|
35606
|
+
var icon = 'url("data:image/svg+xml,'.concat(encodeURIComponent(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_15__.Icon.get('anchor')), '") center/contain no-repeat');
|
|
35607
|
+
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:''}");
|
|
35608
|
+
}
|
|
35480
35609
|
/**
|
|
35481
35610
|
* The attribute `markAnchor` gives an anchor: an empty `<a>` with no `href`
|
|
35482
35611
|
*/ var MARK = ' contenteditable="false"';
|
|
@@ -35505,8 +35634,14 @@ var MARKER = [
|
|
|
35505
35634
|
{
|
|
35506
35635
|
key: "afterInit",
|
|
35507
35636
|
value: /** @override */ function afterInit(jodit) {
|
|
35637
|
+
// An iframe's document is the editor's alone, and its body is part of
|
|
35638
|
+
// the value with `editHTMLDocumentMode`, so it gets no class
|
|
35639
|
+
var shared = jodit.ed === jodit.od;
|
|
35640
|
+
if (shared) {
|
|
35641
|
+
jodit.editor.classList.add(WITH_ANCHORS);
|
|
35642
|
+
}
|
|
35508
35643
|
// 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 =
|
|
35644
|
+
;(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.getContainer)(jodit, 'anchor', 'style', true).textContent = markerStyle(shared ? '.' + WITH_ANCHORS : '');
|
|
35510
35645
|
jodit.e.on('generateAnchorForm.anchor', this.__generateForm).on('clickA touchstartA', this.__onClickA, {
|
|
35511
35646
|
top: true
|
|
35512
35647
|
});
|
|
@@ -35551,6 +35686,27 @@ var MARKER = [
|
|
|
35551
35686
|
data.value = unmarkAnchors(data.value);
|
|
35552
35687
|
}
|
|
35553
35688
|
},
|
|
35689
|
+
{
|
|
35690
|
+
key: "onBeforePasteInsert",
|
|
35691
|
+
value: /**
|
|
35692
|
+
* A pasted or dropped copy of an anchor the document already has gets the
|
|
35693
|
+
* next free name, as `fees-2`, and the links that came with it follow it
|
|
35694
|
+
*/ function onBeforePasteInsert(html) {
|
|
35695
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isElement(html) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isFragment(html)) {
|
|
35696
|
+
this.__renameCopies(html);
|
|
35697
|
+
return;
|
|
35698
|
+
}
|
|
35699
|
+
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(html) || !/<a\s/i.test(html)) {
|
|
35700
|
+
return;
|
|
35701
|
+
}
|
|
35702
|
+
// Inert, so nothing in it loads
|
|
35703
|
+
var template = this.j.createInside.element('template');
|
|
35704
|
+
template.innerHTML = html;
|
|
35705
|
+
if (this.__renameCopies(template.content)) {
|
|
35706
|
+
return template.innerHTML;
|
|
35707
|
+
}
|
|
35708
|
+
}
|
|
35709
|
+
},
|
|
35554
35710
|
{
|
|
35555
35711
|
key: "__generateForm",
|
|
35556
35712
|
value: /**
|
|
@@ -35710,10 +35866,60 @@ var MARKER = [
|
|
|
35710
35866
|
});
|
|
35711
35867
|
}
|
|
35712
35868
|
},
|
|
35869
|
+
{
|
|
35870
|
+
key: "__renameCopies",
|
|
35871
|
+
value: /**
|
|
35872
|
+
* Gives each anchor in `root` whose name the document already has the
|
|
35873
|
+
* next free one, avoiding the names in `root` too, and points the links
|
|
35874
|
+
* in `root` to it at the new name. Whether any was renamed
|
|
35875
|
+
*/ function __renameCopies(root) {
|
|
35876
|
+
var _this = this;
|
|
35877
|
+
var inRoot = new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.toArray)(root.querySelectorAll('[id], a[name]')).map(function(elm) {
|
|
35878
|
+
return elm.id || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(elm, 'name');
|
|
35879
|
+
}));
|
|
35880
|
+
var renamed = new Map();
|
|
35881
|
+
var anchors = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isAnchor)(root) ? [
|
|
35882
|
+
root
|
|
35883
|
+
] : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.getAnchors)(root);
|
|
35884
|
+
anchors.forEach(function(anchor) {
|
|
35885
|
+
var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.getAnchorName)(anchor);
|
|
35886
|
+
if (!_this.__isTaken(name, null)) {
|
|
35887
|
+
return;
|
|
35888
|
+
}
|
|
35889
|
+
var copy = name;
|
|
35890
|
+
for(var n = 2; inRoot.has(copy) || _this.__isTaken(copy, null); n += 1){
|
|
35891
|
+
copy = "".concat(name, "-").concat(n);
|
|
35892
|
+
}
|
|
35893
|
+
[
|
|
35894
|
+
'id',
|
|
35895
|
+
'name'
|
|
35896
|
+
].forEach(function(key) {
|
|
35897
|
+
if (anchor.hasAttribute(key)) {
|
|
35898
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(anchor, key, copy);
|
|
35899
|
+
}
|
|
35900
|
+
});
|
|
35901
|
+
inRoot.add(copy);
|
|
35902
|
+
renamed.set(name, copy);
|
|
35903
|
+
});
|
|
35904
|
+
if (!renamed.size) {
|
|
35905
|
+
return false;
|
|
35906
|
+
}
|
|
35907
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.toArray)(root.querySelectorAll('a[href]')).forEach(function(link) {
|
|
35908
|
+
var _attr;
|
|
35909
|
+
var href = (_attr = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(link, 'href')) !== null && _attr !== void 0 ? _attr : '';
|
|
35910
|
+
var copy = href[0] === '#' && renamed.get(href.slice(1));
|
|
35911
|
+
if (copy) {
|
|
35912
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(link, 'href', '#' + copy);
|
|
35913
|
+
}
|
|
35914
|
+
});
|
|
35915
|
+
return true;
|
|
35916
|
+
}
|
|
35917
|
+
},
|
|
35713
35918
|
{
|
|
35714
35919
|
key: "beforeDestruct",
|
|
35715
35920
|
value: /** @override */ function beforeDestruct(jodit) {
|
|
35716
35921
|
this.__dropForm();
|
|
35922
|
+
jodit.editor.classList.remove(WITH_ANCHORS);
|
|
35717
35923
|
jodit.e.off('generateAnchorForm.anchor', this.__generateForm).off('clickA touchstartA', this.__onClickA);
|
|
35718
35924
|
}
|
|
35719
35925
|
}
|
|
@@ -35734,6 +35940,9 @@ var MARKER = [
|
|
|
35734
35940
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
35735
35941
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':afterGetValueFromEditor')
|
|
35736
35942
|
], anchor.prototype, "onAfterGetValueFromEditor", null);
|
|
35943
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
35944
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':beforePasteInsert')
|
|
35945
|
+
], anchor.prototype, "onBeforePasteInsert", null);
|
|
35737
35946
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
|
|
35738
35947
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
|
|
35739
35948
|
], anchor.prototype, "__generateForm", null);
|
|
@@ -43540,6 +43749,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.fullsize = {
|
|
|
43540
43749
|
exec: function exec(editor) {
|
|
43541
43750
|
editor.toggleFullSize();
|
|
43542
43751
|
},
|
|
43752
|
+
// Makes it a toggle. `update` sets the state, which holds while the editor doesn't have the focus
|
|
43753
|
+
isActive: function isActive(editor) {
|
|
43754
|
+
return editor.isFullSize;
|
|
43755
|
+
},
|
|
43543
43756
|
update: function update(editor, button) {
|
|
43544
43757
|
var mode = editor.isFullSize ? 'shrink' : 'fullsize';
|
|
43545
43758
|
button.state.activated = editor.isFullSize;
|
|
@@ -43935,9 +44148,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_7__.pluginSystem.add('hotkeys', hotke
|
|
|
43935
44148
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__.Icon.set('hr', (_hr_svg__WEBPACK_IMPORTED_MODULE_4___default()));
|
|
43936
44149
|
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.hr = {
|
|
43937
44150
|
command: 'insertHorizontalRule',
|
|
43938
|
-
tags: [
|
|
43939
|
-
'hr'
|
|
43940
|
-
],
|
|
43941
44151
|
tooltip: 'Insert Horizontal Line'
|
|
43942
44152
|
};
|
|
43943
44153
|
function hr(editor) {
|
|
@@ -49439,9 +49649,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.defaultLineHeight = n
|
|
|
49439
49649
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('line-height', (_line_height_svg__WEBPACK_IMPORTED_MODULE_3___default()));
|
|
49440
49650
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.lineHeight = {
|
|
49441
49651
|
command: 'applyLineHeight',
|
|
49442
|
-
tags: [
|
|
49443
|
-
'ol'
|
|
49444
|
-
],
|
|
49445
49652
|
tooltip: 'Line height',
|
|
49446
49653
|
list: [
|
|
49447
49654
|
1,
|