jodit 4.2.19 → 4.2.21
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 -5
- package/es2015/jodit.css +47 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +75 -63
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- 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.css +47 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +75 -63
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +47 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +75 -63
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- 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 +47 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +75 -63
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- 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 +77 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +78 -62
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- 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/esm/core/constants.js +1 -1
- package/esm/core/ui/button/button/button.d.ts +1 -0
- package/esm/core/ui/button/button/button.js +7 -0
- package/esm/core/ui/button/tooltip/tooltip.d.ts +3 -4
- package/esm/core/ui/button/tooltip/tooltip.js +44 -44
- package/esm/modules/toolbar/button/button.d.ts +1 -0
- package/esm/modules/widget/tabs/tabs.js +21 -16
- package/esm/types/ui.d.ts +1 -0
- package/package.json +1 -1
- package/types/core/ui/button/button/button.d.ts +1 -0
- package/types/core/ui/button/tooltip/tooltip.d.ts +3 -4
- package/types/modules/toolbar/button/button.d.ts +1 -0
- package/types/types/ui.d.ts +1 -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.2.
|
|
4
|
+
* Version: v4.2.21
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1736
1736
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1737
1737
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1738
1738
|
*/
|
|
1739
|
-
const APP_VERSION = "4.2.
|
|
1739
|
+
const APP_VERSION = "4.2.21";
|
|
1740
1740
|
// prettier-ignore
|
|
1741
1741
|
const ES = "es2015";
|
|
1742
1742
|
const IS_ES_MODERN = true;
|
|
@@ -12972,6 +12972,7 @@ class Mods {
|
|
|
12972
12972
|
const UIButtonState = () => ({
|
|
12973
12973
|
size: 'middle',
|
|
12974
12974
|
type: 'button',
|
|
12975
|
+
role: 'button',
|
|
12975
12976
|
name: '',
|
|
12976
12977
|
value: '',
|
|
12977
12978
|
variant: 'initial',
|
|
@@ -13020,6 +13021,9 @@ let UIButton = class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MO
|
|
|
13020
13021
|
onChangeType() {
|
|
13021
13022
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(this.container, 'type', this.state.type);
|
|
13022
13023
|
}
|
|
13024
|
+
onChangeRole() {
|
|
13025
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(this.container, 'role', this.state.role);
|
|
13026
|
+
}
|
|
13023
13027
|
/**
|
|
13024
13028
|
* Set size from a parent list
|
|
13025
13029
|
*/
|
|
@@ -13149,6 +13153,9 @@ let UIButton = class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MO
|
|
|
13149
13153
|
(0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
|
|
13150
13154
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('state.type', { immediately: false })
|
|
13151
13155
|
], UIButton.prototype, "onChangeType", null);
|
|
13156
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
|
|
13157
|
+
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('state.role', { immediately: false })
|
|
13158
|
+
], UIButton.prototype, "onChangeRole", null);
|
|
13152
13159
|
(0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
|
|
13153
13160
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('parentElement')
|
|
13154
13161
|
], UIButton.prototype, "updateSize", null);
|
|
@@ -13360,6 +13367,19 @@ var UITooltip_1;
|
|
|
13360
13367
|
|
|
13361
13368
|
|
|
13362
13369
|
|
|
13370
|
+
const WINDOW_EVENTS_ON_HIDE = [
|
|
13371
|
+
'scroll.tooltip',
|
|
13372
|
+
'joditCloseDialog',
|
|
13373
|
+
'mouseleave.tooltip'
|
|
13374
|
+
];
|
|
13375
|
+
const JODIT_EVENTS_ON_HIDE = [
|
|
13376
|
+
'escape.tooltip',
|
|
13377
|
+
'change.tooltip',
|
|
13378
|
+
'changePlace.tooltip',
|
|
13379
|
+
'afterOpenPopup.tooltip',
|
|
13380
|
+
'hidePopup.tooltip',
|
|
13381
|
+
'closeAllPopups.tooltip'
|
|
13382
|
+
];
|
|
13363
13383
|
let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__/* .UIElement */ .D {
|
|
13364
13384
|
className() {
|
|
13365
13385
|
return 'UITooltip';
|
|
@@ -13378,7 +13398,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
|
|
|
13378
13398
|
view.o.showTooltip &&
|
|
13379
13399
|
!view.o.useNativeTooltip) {
|
|
13380
13400
|
view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
|
|
13381
|
-
// TODO Move it inside
|
|
13401
|
+
// TODO Move it inside __show method. Now it is here because testcase failed with capturing
|
|
13382
13402
|
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
|
|
13383
13403
|
view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
|
|
13384
13404
|
capture: true
|
|
@@ -13386,44 +13406,28 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
|
|
|
13386
13406
|
});
|
|
13387
13407
|
}
|
|
13388
13408
|
}
|
|
13389
|
-
|
|
13409
|
+
__addListenersOnEnter() {
|
|
13390
13410
|
if (this.__listenClose) {
|
|
13391
13411
|
return;
|
|
13392
13412
|
}
|
|
13393
13413
|
this.__listenClose = true;
|
|
13394
13414
|
const view = this.j;
|
|
13395
13415
|
view.e
|
|
13396
|
-
.on(view.ow,
|
|
13397
|
-
.on(
|
|
13398
|
-
.on(view.container, 'mouseleave.tooltip', this.
|
|
13399
|
-
.on([
|
|
13400
|
-
'escape.tooltip',
|
|
13401
|
-
'change.tooltip',
|
|
13402
|
-
'changePlace.tooltip',
|
|
13403
|
-
'afterOpenPopup.tooltip',
|
|
13404
|
-
'hidePopup.tooltip',
|
|
13405
|
-
'closeAllPopups.tooltip'
|
|
13406
|
-
], this.__hide)
|
|
13407
|
-
.on(view.container, 'mouseleave', this.__onMouseLeave, {
|
|
13416
|
+
.on(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
|
|
13417
|
+
.on(JODIT_EVENTS_ON_HIDE, this.__hide)
|
|
13418
|
+
.on(view.container, 'mouseleave.tooltip', this.__onMouseLeave, {
|
|
13408
13419
|
capture: true
|
|
13409
13420
|
});
|
|
13410
13421
|
}
|
|
13411
|
-
|
|
13422
|
+
__removeListenersOnLeave() {
|
|
13412
13423
|
if (!this.__listenClose) {
|
|
13413
13424
|
return;
|
|
13414
13425
|
}
|
|
13415
13426
|
this.__listenClose = false;
|
|
13416
13427
|
const view = this.j;
|
|
13417
13428
|
view.e
|
|
13418
|
-
.off(view.ow,
|
|
13419
|
-
.off(
|
|
13420
|
-
'escape.tooltip',
|
|
13421
|
-
'change.tooltip',
|
|
13422
|
-
'changePlace.tooltip',
|
|
13423
|
-
'afterOpenPopup.tooltip',
|
|
13424
|
-
'hidePopup.tooltip',
|
|
13425
|
-
'closeAllPopups.tooltip'
|
|
13426
|
-
], this.__hide)
|
|
13429
|
+
.off(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
|
|
13430
|
+
.off(JODIT_EVENTS_ON_HIDE, this.__hide)
|
|
13427
13431
|
.off(view.container, 'mouseleave.tooltip', this.__onMouseLeave);
|
|
13428
13432
|
}
|
|
13429
13433
|
__onMouseLeave(e) {
|
|
@@ -13449,29 +13453,30 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
|
|
|
13449
13453
|
return;
|
|
13450
13454
|
}
|
|
13451
13455
|
this.__currentTarget = e.target;
|
|
13452
|
-
const
|
|
13453
|
-
this.
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13456
|
+
const target = e.target;
|
|
13457
|
+
this.__open(() => {
|
|
13458
|
+
const pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__/* .position */ .G)(target);
|
|
13459
|
+
return {
|
|
13460
|
+
x: pos.left + pos.width / 2,
|
|
13461
|
+
y: pos.top + pos.height
|
|
13462
|
+
};
|
|
13463
|
+
}, tooltip);
|
|
13464
|
+
}
|
|
13465
|
+
__open(getPoint, content) {
|
|
13466
|
+
this.__addListenersOnEnter();
|
|
13467
|
+
this.__isOpened = true;
|
|
13461
13468
|
this.j.async.clearTimeout(this.__hideTimeout);
|
|
13462
13469
|
this.j.async.clearTimeout(this.__delayShowTimeout);
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13470
|
+
const to = this.j.o.showTooltipDelay || this.j.defaultTimeout;
|
|
13471
|
+
if (!to) {
|
|
13472
|
+
this.__show(getPoint, content);
|
|
13473
|
+
return;
|
|
13474
|
+
}
|
|
13475
|
+
this.__delayShowTimeout = this.j.async.setTimeout(() => this.__show(getPoint, content), to);
|
|
13467
13476
|
}
|
|
13468
|
-
|
|
13477
|
+
__show(getPoint, content) {
|
|
13469
13478
|
this.setMod('visible', true);
|
|
13470
13479
|
this.getElm('content').innerHTML = content;
|
|
13471
|
-
this.__isOpened = true;
|
|
13472
|
-
this.__setPosition(getPoint);
|
|
13473
|
-
}
|
|
13474
|
-
__setPosition(getPoint) {
|
|
13475
13480
|
const point = getPoint();
|
|
13476
13481
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.container, {
|
|
13477
13482
|
left: point.x,
|
|
@@ -13481,24 +13486,26 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
|
|
|
13481
13486
|
__hide() {
|
|
13482
13487
|
this.j.async.clearTimeout(this.__delayShowTimeout);
|
|
13483
13488
|
this.j.async.clearTimeout(this.__hideTimeout);
|
|
13484
|
-
this.
|
|
13489
|
+
this.__removeListenersOnLeave();
|
|
13485
13490
|
if (this.__isOpened) {
|
|
13486
13491
|
this.__isOpened = false;
|
|
13487
13492
|
this.setMod('visible', false);
|
|
13493
|
+
this.getElm('content').innerHTML = '';
|
|
13488
13494
|
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.container, {
|
|
13489
13495
|
left: -5000
|
|
13490
13496
|
});
|
|
13491
13497
|
}
|
|
13492
13498
|
}
|
|
13493
13499
|
__hideDelay() {
|
|
13500
|
+
this.j.async.clearTimeout(this.__delayShowTimeout);
|
|
13501
|
+
this.j.async.clearTimeout(this.__hideTimeout);
|
|
13494
13502
|
if (!this.__isOpened) {
|
|
13495
13503
|
return;
|
|
13496
13504
|
}
|
|
13497
|
-
this.j.async.clearTimeout(this.__delayShowTimeout);
|
|
13498
13505
|
this.__hideTimeout = this.async.setTimeout(this.__hide, this.j.defaultTimeout);
|
|
13499
13506
|
}
|
|
13500
13507
|
destruct() {
|
|
13501
|
-
this.j.e.off(this.j.container, 'mouseenter', this.__onMouseEnter);
|
|
13508
|
+
this.j.e.off(this.j.container, 'mouseenter.tooltip', this.__onMouseEnter);
|
|
13502
13509
|
this.__hide();
|
|
13503
13510
|
super.destruct();
|
|
13504
13511
|
}
|
|
@@ -24738,8 +24745,8 @@ function val(elm, selector, value) {
|
|
|
24738
24745
|
/* harmony export */ });
|
|
24739
24746
|
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
|
|
24740
24747
|
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
|
|
24741
|
-
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
|
|
24742
24748
|
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69052);
|
|
24749
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26150);
|
|
24743
24750
|
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53048);
|
|
24744
24751
|
/*!
|
|
24745
24752
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
@@ -24781,8 +24788,16 @@ function val(elm, selector, value) {
|
|
|
24781
24788
|
* ```
|
|
24782
24789
|
*/
|
|
24783
24790
|
const TabsWidget = (jodit, tabs, state) => {
|
|
24784
|
-
const box = jodit.c.div('jodit-tabs')
|
|
24785
|
-
|
|
24791
|
+
const box = jodit.c.div('jodit-tabs');
|
|
24792
|
+
const tabBox = jodit.c.div('jodit-tabs__wrapper');
|
|
24793
|
+
const buttons = jodit.c.div('jodit-tabs__buttons');
|
|
24794
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(buttons, {
|
|
24795
|
+
role: 'tablist',
|
|
24796
|
+
'aria-orientation': 'horizontal'
|
|
24797
|
+
});
|
|
24798
|
+
const nameToTab = {};
|
|
24799
|
+
const buttonList = [];
|
|
24800
|
+
let firstTab = '';
|
|
24786
24801
|
box.appendChild(buttons);
|
|
24787
24802
|
box.appendChild(tabBox);
|
|
24788
24803
|
const setActive = (tab) => {
|
|
@@ -24790,20 +24805,21 @@ const TabsWidget = (jodit, tabs, state) => {
|
|
|
24790
24805
|
return;
|
|
24791
24806
|
}
|
|
24792
24807
|
buttonList.forEach(b => {
|
|
24793
|
-
b.state.variant = 'initial';
|
|
24794
24808
|
b.state.activated = false;
|
|
24795
24809
|
});
|
|
24796
|
-
(
|
|
24797
|
-
a.classList.remove('jodit-tab_active');
|
|
24798
|
-
});
|
|
24799
|
-
nameToTab[tab].button.state.variant = 'outline';
|
|
24810
|
+
Object.values(nameToTab).forEach(({ tab }) => tab.classList.remove('jodit-tab_active'));
|
|
24800
24811
|
nameToTab[tab].button.state.activated = true;
|
|
24801
24812
|
nameToTab[tab].tab.classList.add('jodit-tab_active');
|
|
24802
24813
|
};
|
|
24803
24814
|
tabs.forEach(({ icon, name, content }) => {
|
|
24804
|
-
const tab = jodit.c.div('jodit-tab')
|
|
24815
|
+
const tab = jodit.c.div('jodit-tab');
|
|
24816
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(tab, {
|
|
24817
|
+
role: 'tabpanel'
|
|
24818
|
+
});
|
|
24819
|
+
const button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
|
|
24820
|
+
button.state.role = 'tab';
|
|
24805
24821
|
// Stop lose the focus
|
|
24806
|
-
jodit.e.on(button.container, '
|
|
24822
|
+
jodit.e.on(button.container, 'pointerdown', (e) => e.preventDefault());
|
|
24807
24823
|
if (!firstTab) {
|
|
24808
24824
|
firstTab = name;
|
|
24809
24825
|
}
|
|
@@ -24833,13 +24849,9 @@ const TabsWidget = (jodit, tabs, state) => {
|
|
|
24833
24849
|
button,
|
|
24834
24850
|
tab
|
|
24835
24851
|
};
|
|
24836
|
-
tabCount += 1;
|
|
24837
24852
|
});
|
|
24838
|
-
|
|
24839
|
-
|
|
24840
|
-
}
|
|
24841
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
|
|
24842
|
-
a.style.width = (100 / tabCount).toFixed(10) + '%';
|
|
24853
|
+
Object.values(nameToTab).forEach(({ button }) => {
|
|
24854
|
+
button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
|
|
24843
24855
|
});
|
|
24844
24856
|
const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
|
|
24845
24857
|
? firstTab
|