jodit 4.20.0 → 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 +20 -0
- package/es2015/jodit.css +68 -9
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +11 -11
- package/es2015/jodit.js +238 -54
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +8 -8
- 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 +11 -11
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +8 -8
- 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 +12 -12
- package/es2021/jodit.js +234 -54
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +8 -8
- 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 +234 -54
- 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 +285 -56
- 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/core/ui/form/inputs/input/input.js +2 -0
- package/esm/modules/toolbar/button/button.d.ts +10 -0
- package/esm/modules/toolbar/button/button.js +19 -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/plugins/link/template.js +3 -1
- package/esm/plugins/resizer/resizer.d.ts +6 -0
- package/esm/plugins/resizer/resizer.js +11 -0
- 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/resizer/resizer.d.ts +6 -0
- package/types/types/toolbar.d.ts +2 -0
package/es2015/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
|
*/
|
|
@@ -1830,7 +1830,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1830
1830
|
* ```
|
|
1831
1831
|
* @packageDocumentation
|
|
1832
1832
|
* @module constants
|
|
1833
|
-
*/ const APP_VERSION = "4.20.
|
|
1833
|
+
*/ const APP_VERSION = "4.20.2";
|
|
1834
1834
|
// prettier-ignore
|
|
1835
1835
|
const ES = "es2015";
|
|
1836
1836
|
const IS_ES_MODERN = true;
|
|
@@ -17060,6 +17060,8 @@ class UIInput extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_7__.UIEleme
|
|
|
17060
17060
|
if (label) {
|
|
17061
17061
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(this.wrapper, this.label);
|
|
17062
17062
|
this.label.innerText = this.j.i18n(label);
|
|
17063
|
+
// The label is a span, so it names the input only this way
|
|
17064
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_6__.attr)(input, 'aria-label', this.j.i18n(label));
|
|
17063
17065
|
} else {
|
|
17064
17066
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.label);
|
|
17065
17067
|
}
|
|
@@ -26356,13 +26358,26 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_22__.U
|
|
|
26356
26358
|
}
|
|
26357
26359
|
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
26358
26360
|
}
|
|
26359
|
-
|
|
26360
|
-
|
|
26361
|
-
|
|
26361
|
+
/**
|
|
26362
|
+
* A button that its control can show as on is a toggle, and says whether
|
|
26363
|
+
* it's pressed
|
|
26364
|
+
*/ get isToggle() {
|
|
26365
|
+
const { isActive, tags, css } = this.control;
|
|
26366
|
+
return Boolean(isActive || tags || css);
|
|
26367
|
+
}
|
|
26368
|
+
/**
|
|
26369
|
+
* The pressed look comes from the mod, as any button looks pressed while
|
|
26370
|
+
* its list is open, and the container is a `listitem`, which can't have
|
|
26371
|
+
* `aria-pressed`
|
|
26372
|
+
*/ onChangeActivated() {
|
|
26373
|
+
;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_20__.attr)(this.button, 'aria-pressed', this.isToggle ? this.state.activated : null);
|
|
26374
|
+
this.setMod('activated', this.state.activated || null);
|
|
26362
26375
|
}
|
|
26363
26376
|
onChangeText() {
|
|
26364
26377
|
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_13__.isFunction)(this.control.template)) {
|
|
26365
26378
|
this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
|
|
26379
|
+
// The name given before the text came would otherwise stay
|
|
26380
|
+
this.updateAriaLabel();
|
|
26366
26381
|
} else {
|
|
26367
26382
|
super.onChangeText();
|
|
26368
26383
|
}
|
|
@@ -26417,6 +26432,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_22__.U
|
|
|
26417
26432
|
state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_13__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
|
|
26418
26433
|
}
|
|
26419
26434
|
state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
|
|
26435
|
+
// UIButton's template makes every button a toggle
|
|
26436
|
+
this.onChangeActivated();
|
|
26420
26437
|
}
|
|
26421
26438
|
__initIconFromControl() {
|
|
26422
26439
|
const { control: ctr, state } = this;
|
|
@@ -26987,7 +27004,8 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
|
26987
27004
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84839);
|
|
26988
27005
|
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62101);
|
|
26989
27006
|
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85932);
|
|
26990
|
-
/* harmony import */ var
|
|
27007
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
|
|
27008
|
+
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(22533);
|
|
26991
27009
|
/*!
|
|
26992
27010
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
26993
27011
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -27000,10 +27018,15 @@ ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
|
27000
27018
|
|
|
27001
27019
|
|
|
27002
27020
|
|
|
27003
|
-
|
|
27021
|
+
|
|
27022
|
+
class ToolbarSelect extends _button__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton {
|
|
27004
27023
|
className() {
|
|
27005
27024
|
return 'ToolbarSelect';
|
|
27006
27025
|
}
|
|
27026
|
+
// It shows its value, rather than being on or off
|
|
27027
|
+
get isToggle() {
|
|
27028
|
+
return false;
|
|
27029
|
+
}
|
|
27007
27030
|
update() {
|
|
27008
27031
|
super.update();
|
|
27009
27032
|
this.state.icon.name = '';
|
|
@@ -27020,6 +27043,18 @@ class ToolbarSelect extends _button__WEBPACK_IMPORTED_MODULE_4__.ToolbarButton {
|
|
|
27020
27043
|
this.state.text = (_ref = (_this_control_textTemplate = (_this_control = this.control).textTemplate) === null || _this_control_textTemplate === void 0 ? void 0 : _this_control_textTemplate.call(_this_control, this.jodit, text)) !== null && _ref !== void 0 ? _ref : text;
|
|
27021
27044
|
}
|
|
27022
27045
|
}
|
|
27046
|
+
/**
|
|
27047
|
+
* The button shows only the value, so its name says which control it
|
|
27048
|
+
* is too: "Font size, 16px"
|
|
27049
|
+
*/ updateAriaLabel() {
|
|
27050
|
+
var _this_text_textContent;
|
|
27051
|
+
super.updateAriaLabel();
|
|
27052
|
+
const { tooltip } = this.state;
|
|
27053
|
+
const value = (_this_text_textContent = this.text.textContent) === null || _this_text_textContent === void 0 ? void 0 : _this_text_textContent.trim();
|
|
27054
|
+
if (tooltip && value) {
|
|
27055
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(this.button, 'aria-label', `${this.jodit.i18n(tooltip)}, ${value}`);
|
|
27056
|
+
}
|
|
27057
|
+
}
|
|
27023
27058
|
}
|
|
27024
27059
|
ToolbarSelect = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__._)([
|
|
27025
27060
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.component
|
|
@@ -28296,11 +28331,12 @@ class Uploader extends jodit_core_component___WEBPACK_IMPORTED_MODULE_1__.ViewCo
|
|
|
28296
28331
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
28297
28332
|
|
|
28298
28333
|
"use strict";
|
|
28299
|
-
/* harmony import */ var
|
|
28300
|
-
/* harmony import */ var
|
|
28301
|
-
/* harmony import */ var
|
|
28302
|
-
/* harmony import */ var
|
|
28303
|
-
/* harmony import */ var
|
|
28334
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
28335
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
|
|
28336
|
+
/* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
|
|
28337
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4099);
|
|
28338
|
+
/* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(54522);
|
|
28339
|
+
/* harmony import */ var _palette_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_palette_svg__WEBPACK_IMPORTED_MODULE_4__);
|
|
28304
28340
|
/*!
|
|
28305
28341
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
28306
28342
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -28314,7 +28350,8 @@ class Uploader extends jodit_core_component___WEBPACK_IMPORTED_MODULE_1__.ViewCo
|
|
|
28314
28350
|
|
|
28315
28351
|
|
|
28316
28352
|
|
|
28317
|
-
|
|
28353
|
+
|
|
28354
|
+
jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__.Icon.set('palette', (_palette_svg__WEBPACK_IMPORTED_MODULE_4___default()));
|
|
28318
28355
|
/**
|
|
28319
28356
|
* Build color picker
|
|
28320
28357
|
*
|
|
@@ -28332,29 +28369,54 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
28332
28369
|
* });
|
|
28333
28370
|
* ```
|
|
28334
28371
|
*/ const ColorPickerWidget = (editor, callback, coldColor)=>{
|
|
28335
|
-
|
|
28372
|
+
var _items_find;
|
|
28373
|
+
const cn = 'jodit-color-picker', valueHex = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.normalizeColor)(coldColor), form = editor.c.div(cn), iconPalette = editor.o.textIcons ? `<span>${editor.i18n('palette')}</span>` : jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__.Icon.get('palette'), eachColor = (colors)=>{
|
|
28336
28374
|
const stack = [];
|
|
28337
|
-
if ((0,
|
|
28375
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isPlainObject)(colors)) {
|
|
28338
28376
|
Object.keys(colors).forEach((key)=>{
|
|
28339
28377
|
stack.push(`<div class="${cn}__group ${cn}__group-${key}">`);
|
|
28340
28378
|
stack.push(eachColor(colors[key]));
|
|
28341
28379
|
stack.push('</div>');
|
|
28342
28380
|
});
|
|
28343
|
-
} else if ((0,
|
|
28381
|
+
} else if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isArray)(colors)) {
|
|
28344
28382
|
colors.forEach((color)=>{
|
|
28345
|
-
|
|
28383
|
+
const active = valueHex === color;
|
|
28384
|
+
stack.push(`<button type="button" class='${cn}__color-item ${active ? cn + '__color-item_active_true' : ''}' title="${color}" aria-pressed="${active}" tabindex="-1" style="background-color:${color}" data-color="${color}"></button>`);
|
|
28346
28385
|
});
|
|
28347
28386
|
}
|
|
28348
28387
|
return stack.join('');
|
|
28349
28388
|
};
|
|
28350
28389
|
// The group wrapper lays the colors out in rows, so a flat list needs one
|
|
28351
28390
|
// too. See #1487
|
|
28352
|
-
const groups = (0,
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
const
|
|
28391
|
+
const groups = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isArray)(editor.o.colors) ? `<div class="${cn}__group">${eachColor(editor.o.colors)}</div>` : eachColor(editor.o.colors);
|
|
28392
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(form, editor.c.fromHTML(`<div class="${cn}__groups">${groups}</div>`));
|
|
28393
|
+
const items = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.toArray)(form.querySelectorAll(`.${cn}__color-item`));
|
|
28394
|
+
// Tab stops at one color, the current one or the first, and the arrow
|
|
28395
|
+
// keys move from it
|
|
28396
|
+
const tabStop = (_items_find = items.find((item)=>(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(item, 'aria-pressed') === 'true')) !== null && _items_find !== void 0 ? _items_find : items[0];
|
|
28397
|
+
if (tabStop) {
|
|
28398
|
+
(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(tabStop, 'tabindex', 0);
|
|
28399
|
+
}
|
|
28400
|
+
// Along a row, or to the nearest color in the row above or below, as the
|
|
28401
|
+
// palette is laid out
|
|
28402
|
+
const nextItem = (item, key)=>{
|
|
28403
|
+
const index = items.indexOf(item);
|
|
28404
|
+
if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT) {
|
|
28405
|
+
const step = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT ? -1 : 1;
|
|
28406
|
+
const rtl = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.css)(item, 'direction') === 'rtl';
|
|
28407
|
+
return items[index + (rtl ? -step : step)];
|
|
28408
|
+
}
|
|
28409
|
+
const down = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN, rows = items.filter((other)=>down ? other.offsetTop > item.offsetTop : other.offsetTop < item.offsetTop);
|
|
28410
|
+
if (!rows.length) {
|
|
28411
|
+
return;
|
|
28412
|
+
}
|
|
28413
|
+
const top = (down ? Math.min : Math.max)(...rows.map((other)=>other.offsetTop)), distance = (other)=>Math.abs(other.offsetLeft - item.offsetLeft);
|
|
28414
|
+
return rows.filter((other)=>other.offsetTop === top).reduce((nearest, other)=>distance(other) < distance(nearest) ? other : nearest);
|
|
28415
|
+
};
|
|
28416
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(form, editor.c.fromHTML(`<div data-ref="extra" class="${cn}__extra"></div>`));
|
|
28417
|
+
const { extra } = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.refs)(form);
|
|
28418
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(extra, editor.c.fromHTML(`<div class="${cn}__hex"><input data-ref="hexInput" type="text" spellcheck="false" aria-label="HEX" placeholder="#FF0000" value="${valueHex || ''}"/></div>`));
|
|
28419
|
+
const { hexInput } = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.refs)(form);
|
|
28358
28420
|
// Enter applies the value and closes the popup; removing the focused
|
|
28359
28421
|
// input then makes Chrome fire `change` on it, which would apply the
|
|
28360
28422
|
// same color a second time and toggle it off again. See #1459
|
|
@@ -28369,8 +28431,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
28369
28431
|
if (!isHex && !isRgb) {
|
|
28370
28432
|
return;
|
|
28371
28433
|
}
|
|
28372
|
-
const color = (0,
|
|
28373
|
-
if (color && (0,
|
|
28434
|
+
const color = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.normalizeColor)(isHex && !raw.startsWith('#') ? '#' + raw : raw);
|
|
28435
|
+
if (color && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isFunction)(callback)) {
|
|
28374
28436
|
appliedHexValue = raw;
|
|
28375
28437
|
callback(color);
|
|
28376
28438
|
}
|
|
@@ -28385,40 +28447,75 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
|
|
|
28385
28447
|
e.stopPropagation();
|
|
28386
28448
|
applyHexInput();
|
|
28387
28449
|
});
|
|
28388
|
-
|
|
28389
|
-
if (editor.o.showBrowserColorPicker && (0,
|
|
28390
|
-
|
|
28450
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(extra, editor.c.fromHTML(`<button type="button" class="${cn}__remove" data-color="" title="${editor.i18n('Remove')}">${editor.o.textIcons ? editor.i18n('Remove') : jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__.Icon.get('eraser')}</button>`));
|
|
28451
|
+
if (editor.o.showBrowserColorPicker && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.hasBrowserColorPicker)()) {
|
|
28452
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(extra, editor.c.fromHTML(`<div class="${cn}__native">${iconPalette}<input type="color" value="#ffffff"/></div>`));
|
|
28391
28453
|
editor.e.on(form, 'change', (e)=>{
|
|
28392
28454
|
e.stopPropagation();
|
|
28393
28455
|
const target = e.target;
|
|
28394
|
-
if (!target || !target.tagName || !
|
|
28456
|
+
if (!target || !target.tagName || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(target, 'input') || target.type !== 'color') {
|
|
28395
28457
|
return;
|
|
28396
28458
|
}
|
|
28397
28459
|
const color = target.value || '';
|
|
28398
|
-
if ((0,
|
|
28460
|
+
if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isFunction)(callback)) {
|
|
28399
28461
|
callback(color);
|
|
28400
28462
|
}
|
|
28401
28463
|
e.preventDefault();
|
|
28402
28464
|
});
|
|
28403
28465
|
}
|
|
28466
|
+
// The color of a swatch, or '' for Remove, from an event on it or its icon
|
|
28467
|
+
const colorOf = (node)=>{
|
|
28468
|
+
const button = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(node, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isHTMLElement(elm) && (elm.classList.contains(cn + '__color-item') || elm.classList.contains(cn + '__remove')), form);
|
|
28469
|
+
return button ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(button, '-color') || '' : undefined;
|
|
28470
|
+
};
|
|
28471
|
+
const apply = (color)=>{
|
|
28472
|
+
if (callback && (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.isFunction)(callback)) {
|
|
28473
|
+
callback(color);
|
|
28474
|
+
}
|
|
28475
|
+
};
|
|
28476
|
+
// A pointer applies the color on `mousedown`, which keeps the selection.
|
|
28477
|
+
// The keyboard and screen readers press the button, which sends only
|
|
28478
|
+
// `click`, so a click after the pointer's `mousedown` is skipped
|
|
28479
|
+
let pointerPressed = false;
|
|
28404
28480
|
editor.e.on(form, 'mousedown touchend', (e)=>{
|
|
28405
28481
|
// let the hex/native inputs receive focus and clicks
|
|
28406
|
-
if (
|
|
28482
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'input')) {
|
|
28407
28483
|
e.stopPropagation();
|
|
28408
28484
|
return;
|
|
28409
28485
|
}
|
|
28410
28486
|
e.stopPropagation();
|
|
28411
28487
|
e.preventDefault();
|
|
28412
|
-
|
|
28413
|
-
if (
|
|
28414
|
-
|
|
28488
|
+
const color = colorOf(e.target);
|
|
28489
|
+
if (color !== undefined) {
|
|
28490
|
+
pointerPressed = e.type === 'mousedown';
|
|
28491
|
+
apply(color);
|
|
28415
28492
|
}
|
|
28416
|
-
|
|
28493
|
+
});
|
|
28494
|
+
editor.e.on(form, 'click', (e)=>{
|
|
28495
|
+
const color = colorOf(e.target);
|
|
28496
|
+
if (color !== undefined && !pointerPressed) {
|
|
28497
|
+
apply(color);
|
|
28498
|
+
}
|
|
28499
|
+
pointerPressed = false;
|
|
28500
|
+
}).on(form, 'keydown', (e)=>{
|
|
28501
|
+
var _nextItem;
|
|
28502
|
+
pointerPressed = false;
|
|
28503
|
+
const item = e.target;
|
|
28504
|
+
if (!items.includes(item) || ![
|
|
28505
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT,
|
|
28506
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT,
|
|
28507
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP,
|
|
28508
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
|
|
28509
|
+
].includes(e.key)) {
|
|
28417
28510
|
return;
|
|
28418
28511
|
}
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28512
|
+
// The toolbar's dropdown would walk every color one by one
|
|
28513
|
+
e.preventDefault();
|
|
28514
|
+
e.stopPropagation();
|
|
28515
|
+
(_nextItem = nextItem(item, e.key)) === null || _nextItem === void 0 ? void 0 : _nextItem.focus();
|
|
28516
|
+
}).on(form, 'focusin', (e)=>{
|
|
28517
|
+
if (items.includes(e.target)) {
|
|
28518
|
+
items.forEach((item)=>(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_2__.attr)(item, 'tabindex', item === e.target ? 0 : -1));
|
|
28422
28519
|
}
|
|
28423
28520
|
});
|
|
28424
28521
|
editor.e.fire('afterGenerateColorPicker', form, extra, callback, valueHex);
|
|
@@ -29635,7 +29732,8 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
|
29635
29732
|
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
|
|
29636
29733
|
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(59400);
|
|
29637
29734
|
/* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5658);
|
|
29638
|
-
/* harmony import */ var
|
|
29735
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29434);
|
|
29736
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(95085);
|
|
29639
29737
|
/*!
|
|
29640
29738
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
29641
29739
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -29655,14 +29753,21 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
|
29655
29753
|
|
|
29656
29754
|
|
|
29657
29755
|
|
|
29658
|
-
|
|
29659
|
-
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29756
|
+
|
|
29757
|
+
/**
|
|
29758
|
+
* The editing area of an editor with the plugin, when it shares its document
|
|
29759
|
+
* with the page and so with any other editor on it
|
|
29760
|
+
*/ const WITH_ANCHORS = 'jodit-wysiwyg_anchors';
|
|
29663
29761
|
/**
|
|
29664
|
-
* Each anchor's marker, in the editing
|
|
29665
|
-
*/
|
|
29762
|
+
* Each anchor's marker, in the editing areas `scope` picks out
|
|
29763
|
+
*/ function markerStyle(scope) {
|
|
29764
|
+
const marker = [
|
|
29765
|
+
'id',
|
|
29766
|
+
'name'
|
|
29767
|
+
].map((key)=>`.jodit-wysiwyg${scope} a[${key}]:not([href]):empty::before`).join(',');
|
|
29768
|
+
const icon = `url("data:image/svg+xml,${encodeURIComponent(jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.get('anchor'))}") center/contain no-repeat`;
|
|
29769
|
+
return `${marker}{display:inline-block;width:.75em;height:1em;margin:0 .1em;vertical-align:-.15em;background-color:var(--jd-color-icon,#4c4c4c);-webkit-mask:${icon};mask:${icon};cursor:pointer;content:''}`;
|
|
29770
|
+
}
|
|
29666
29771
|
/**
|
|
29667
29772
|
* The attribute `markAnchor` gives an anchor: an empty `<a>` with no `href`
|
|
29668
29773
|
*/ const MARK = ' contenteditable="false"';
|
|
@@ -29671,8 +29776,14 @@ const MARKER = [
|
|
|
29671
29776
|
* `#name`, and renames and removes them
|
|
29672
29777
|
*/ class anchor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
|
|
29673
29778
|
/** @override */ afterInit(jodit) {
|
|
29779
|
+
// An iframe's document is the editor's alone, and its body is part of
|
|
29780
|
+
// the value with `editHTMLDocumentMode`, so it gets no class
|
|
29781
|
+
const shared = jodit.ed === jodit.od;
|
|
29782
|
+
if (shared) {
|
|
29783
|
+
jodit.editor.classList.add(WITH_ANCHORS);
|
|
29784
|
+
}
|
|
29674
29785
|
// It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
|
|
29675
|
-
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(jodit, 'anchor', 'style', true).textContent =
|
|
29786
|
+
;(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(jodit, 'anchor', 'style', true).textContent = markerStyle(shared ? '.' + WITH_ANCHORS : '');
|
|
29676
29787
|
jodit.e.on('generateAnchorForm.anchor', this.__generateForm).on('clickA touchstartA', this.__onClickA, {
|
|
29677
29788
|
top: true
|
|
29678
29789
|
});
|
|
@@ -29705,6 +29816,24 @@ const MARKER = [
|
|
|
29705
29816
|
*/ onAfterGetValueFromEditor(data) {
|
|
29706
29817
|
data.value = unmarkAnchors(data.value);
|
|
29707
29818
|
}
|
|
29819
|
+
/**
|
|
29820
|
+
* A pasted or dropped copy of an anchor the document already has gets the
|
|
29821
|
+
* next free name, as `fees-2`, and the links that came with it follow it
|
|
29822
|
+
*/ onBeforePasteInsert(html) {
|
|
29823
|
+
if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(html) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isFragment(html)) {
|
|
29824
|
+
this.__renameCopies(html);
|
|
29825
|
+
return;
|
|
29826
|
+
}
|
|
29827
|
+
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isString)(html) || !/<a\s/i.test(html)) {
|
|
29828
|
+
return;
|
|
29829
|
+
}
|
|
29830
|
+
// Inert, so nothing in it loads
|
|
29831
|
+
const template = this.j.createInside.element('template');
|
|
29832
|
+
template.innerHTML = html;
|
|
29833
|
+
if (this.__renameCopies(template.content)) {
|
|
29834
|
+
return template.innerHTML;
|
|
29835
|
+
}
|
|
29836
|
+
}
|
|
29708
29837
|
/**
|
|
29709
29838
|
* The form that names a new anchor, or renames or removes `target`
|
|
29710
29839
|
*/ __generateForm(target, close) {
|
|
@@ -29844,8 +29973,52 @@ const MARKER = [
|
|
|
29844
29973
|
}
|
|
29845
29974
|
});
|
|
29846
29975
|
}
|
|
29976
|
+
/**
|
|
29977
|
+
* Gives each anchor in `root` whose name the document already has the
|
|
29978
|
+
* next free one, avoiding the names in `root` too, and points the links
|
|
29979
|
+
* in `root` to it at the new name. Whether any was renamed
|
|
29980
|
+
*/ __renameCopies(root) {
|
|
29981
|
+
const inRoot = new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(root.querySelectorAll('[id], a[name]')).map((elm)=>elm.id || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(elm, 'name')));
|
|
29982
|
+
const renamed = new Map();
|
|
29983
|
+
const anchors = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.isAnchor)(root) ? [
|
|
29984
|
+
root
|
|
29985
|
+
] : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAnchors)(root);
|
|
29986
|
+
anchors.forEach((anchor)=>{
|
|
29987
|
+
const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getAnchorName)(anchor);
|
|
29988
|
+
if (!this.__isTaken(name, null)) {
|
|
29989
|
+
return;
|
|
29990
|
+
}
|
|
29991
|
+
let copy = name;
|
|
29992
|
+
for(let n = 2; inRoot.has(copy) || this.__isTaken(copy, null); n += 1){
|
|
29993
|
+
copy = `${name}-${n}`;
|
|
29994
|
+
}
|
|
29995
|
+
[
|
|
29996
|
+
'id',
|
|
29997
|
+
'name'
|
|
29998
|
+
].forEach((key)=>{
|
|
29999
|
+
if (anchor.hasAttribute(key)) {
|
|
30000
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(anchor, key, copy);
|
|
30001
|
+
}
|
|
30002
|
+
});
|
|
30003
|
+
inRoot.add(copy);
|
|
30004
|
+
renamed.set(name, copy);
|
|
30005
|
+
});
|
|
30006
|
+
if (!renamed.size) {
|
|
30007
|
+
return false;
|
|
30008
|
+
}
|
|
30009
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(root.querySelectorAll('a[href]')).forEach((link)=>{
|
|
30010
|
+
var _attr;
|
|
30011
|
+
const href = (_attr = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(link, 'href')) !== null && _attr !== void 0 ? _attr : '';
|
|
30012
|
+
const copy = href[0] === '#' && renamed.get(href.slice(1));
|
|
30013
|
+
if (copy) {
|
|
30014
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(link, 'href', '#' + copy);
|
|
30015
|
+
}
|
|
30016
|
+
});
|
|
30017
|
+
return true;
|
|
30018
|
+
}
|
|
29847
30019
|
/** @override */ beforeDestruct(jodit) {
|
|
29848
30020
|
this.__dropForm();
|
|
30021
|
+
jodit.editor.classList.remove(WITH_ANCHORS);
|
|
29849
30022
|
jodit.e.off('generateAnchorForm.anchor', this.__generateForm).off('clickA touchstartA', this.__onClickA);
|
|
29850
30023
|
}
|
|
29851
30024
|
constructor(...args){
|
|
@@ -29875,6 +30048,9 @@ const MARKER = [
|
|
|
29875
30048
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
29876
30049
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':afterGetValueFromEditor')
|
|
29877
30050
|
], anchor.prototype, "onAfterGetValueFromEditor", null);
|
|
30051
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
30052
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforePasteInsert')
|
|
30053
|
+
], anchor.prototype, "onBeforePasteInsert", null);
|
|
29878
30054
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
29879
30055
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
29880
30056
|
], anchor.prototype, "__generateForm", null);
|
|
@@ -36901,6 +37077,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.fullsize = {
|
|
|
36901
37077
|
exec: (editor)=>{
|
|
36902
37078
|
editor.toggleFullSize();
|
|
36903
37079
|
},
|
|
37080
|
+
// Makes it a toggle. `update` sets the state, which holds while the editor doesn't have the focus
|
|
37081
|
+
isActive: (editor)=>editor.isFullSize,
|
|
36904
37082
|
update (editor, button) {
|
|
36905
37083
|
const mode = editor.isFullSize ? 'shrink' : 'fullsize';
|
|
36906
37084
|
button.state.activated = editor.isFullSize;
|
|
@@ -37271,9 +37449,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('hotkeys', hotke
|
|
|
37271
37449
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__.Icon.set('hr', (_hr_svg__WEBPACK_IMPORTED_MODULE_4___default()));
|
|
37272
37450
|
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.hr = {
|
|
37273
37451
|
command: 'insertHorizontalRule',
|
|
37274
|
-
tags: [
|
|
37275
|
-
'hr'
|
|
37276
|
-
],
|
|
37277
37452
|
tooltip: 'Insert Horizontal Line'
|
|
37278
37453
|
};
|
|
37279
37454
|
function hr(editor) {
|
|
@@ -41954,9 +42129,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.defaultLineHeight = n
|
|
|
41954
42129
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('line-height', (_line_height_svg__WEBPACK_IMPORTED_MODULE_3___default()));
|
|
41955
42130
|
jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.lineHeight = {
|
|
41956
42131
|
command: 'applyLineHeight',
|
|
41957
|
-
tags: [
|
|
41958
|
-
'ol'
|
|
41959
|
-
],
|
|
41960
42132
|
tooltip: 'Line height',
|
|
41961
42133
|
list: [
|
|
41962
42134
|
1,
|
|
@@ -43272,7 +43444,9 @@ const formTemplate = (editor)=>{
|
|
|
43272
43444
|
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_1__.UIBlock(editor, [
|
|
43273
43445
|
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_1__.UIInput(editor, {
|
|
43274
43446
|
name: 'url',
|
|
43275
|
-
|
|
43447
|
+
// Touch keyboards leave a URL field as typed, with no capital or
|
|
43448
|
+
// correction. The form is `novalidate`, so any address still goes in
|
|
43449
|
+
type: 'url',
|
|
43276
43450
|
ref: 'url_input',
|
|
43277
43451
|
label: 'URL',
|
|
43278
43452
|
placeholder: 'http://',
|
|
@@ -46321,6 +46495,13 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
46321
46495
|
this.addEventListeners();
|
|
46322
46496
|
this.__onChangeEditor();
|
|
46323
46497
|
}
|
|
46498
|
+
/**
|
|
46499
|
+
* A tap that selects an image sends no `click` (iPadOS), so `touchend`
|
|
46500
|
+
* stands in for it. A tick later, after `onClickOutside` has had the same
|
|
46501
|
+
* `touchend`, as `click` comes after `mouseup`
|
|
46502
|
+
*/ onEditorTouchEnd(e) {
|
|
46503
|
+
this.j.async.setTimeout(()=>this.onEditorClick(e), 1);
|
|
46504
|
+
}
|
|
46324
46505
|
/**
|
|
46325
46506
|
* Click in the editor area
|
|
46326
46507
|
*/ onEditorClick(e) {
|
|
@@ -46747,6 +46928,9 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
|
|
|
46747
46928
|
}
|
|
46748
46929
|
}
|
|
46749
46930
|
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
46931
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':touchend')
|
|
46932
|
+
], resizer.prototype, "onEditorTouchEnd", null);
|
|
46933
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|
|
46750
46934
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':click')
|
|
46751
46935
|
], resizer.prototype, "onEditorClick", null);
|
|
46752
46936
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__._)([
|