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.
Files changed (69) hide show
  1. package/CHANGELOG.md +12 -5
  2. package/es2015/jodit.css +47 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +75 -63
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +47 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +75 -63
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +47 -1
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +75 -63
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +47 -1
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +75 -63
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/jodit.css +77 -2
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +78 -62
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/core/constants.js +1 -1
  58. package/esm/core/ui/button/button/button.d.ts +1 -0
  59. package/esm/core/ui/button/button/button.js +7 -0
  60. package/esm/core/ui/button/tooltip/tooltip.d.ts +3 -4
  61. package/esm/core/ui/button/tooltip/tooltip.js +44 -44
  62. package/esm/modules/toolbar/button/button.d.ts +1 -0
  63. package/esm/modules/widget/tabs/tabs.js +21 -16
  64. package/esm/types/ui.d.ts +1 -0
  65. package/package.json +1 -1
  66. package/types/core/ui/button/button/button.d.ts +1 -0
  67. package/types/core/ui/button/tooltip/tooltip.d.ts +3 -4
  68. package/types/modules/toolbar/button/button.d.ts +1 -0
  69. package/types/types/ui.d.ts +1 -0
package/es2021/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.19
4
+ * Version: v4.2.21
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1737,7 +1737,7 @@ __webpack_require__.r(__webpack_exports__);
1737
1737
  * Released under MIT see LICENSE.txt in the project root for license information.
1738
1738
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1739
1739
  */
1740
- const APP_VERSION = "4.2.19";
1740
+ const APP_VERSION = "4.2.21";
1741
1741
  // prettier-ignore
1742
1742
  const ES = "es2021";
1743
1743
  const IS_ES_MODERN = true;
@@ -12957,6 +12957,7 @@ class Mods {
12957
12957
  const UIButtonState = () => ({
12958
12958
  size: 'middle',
12959
12959
  type: 'button',
12960
+ role: 'button',
12960
12961
  name: '',
12961
12962
  value: '',
12962
12963
  variant: 'initial',
@@ -13005,6 +13006,9 @@ let UIButton = class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MO
13005
13006
  onChangeType() {
13006
13007
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(this.container, 'type', this.state.type);
13007
13008
  }
13009
+ onChangeRole() {
13010
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(this.container, 'role', this.state.role);
13011
+ }
13008
13012
  /**
13009
13013
  * Set size from a parent list
13010
13014
  */
@@ -13134,6 +13138,9 @@ let UIButton = class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MO
13134
13138
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
13135
13139
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('state.type', { immediately: false })
13136
13140
  ], UIButton.prototype, "onChangeType", null);
13141
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
13142
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('state.role', { immediately: false })
13143
+ ], UIButton.prototype, "onChangeRole", null);
13137
13144
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
13138
13145
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('parentElement')
13139
13146
  ], UIButton.prototype, "updateSize", null);
@@ -13343,6 +13350,19 @@ var UITooltip_1;
13343
13350
 
13344
13351
 
13345
13352
 
13353
+ const WINDOW_EVENTS_ON_HIDE = [
13354
+ 'scroll.tooltip',
13355
+ 'joditCloseDialog',
13356
+ 'mouseleave.tooltip'
13357
+ ];
13358
+ const JODIT_EVENTS_ON_HIDE = [
13359
+ 'escape.tooltip',
13360
+ 'change.tooltip',
13361
+ 'changePlace.tooltip',
13362
+ 'afterOpenPopup.tooltip',
13363
+ 'hidePopup.tooltip',
13364
+ 'closeAllPopups.tooltip'
13365
+ ];
13346
13366
  let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_5__/* .UIElement */ .D {
13347
13367
  className() {
13348
13368
  return 'UITooltip';
@@ -13361,7 +13381,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13361
13381
  view.o.showTooltip &&
13362
13382
  !view.o.useNativeTooltip) {
13363
13383
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13364
- // TODO Move it inside __open method. Now it is here because testcase failed with capturing
13384
+ // TODO Move it inside __show method. Now it is here because testcase failed with capturing
13365
13385
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13366
13386
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13367
13387
  capture: true
@@ -13369,44 +13389,28 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13369
13389
  });
13370
13390
  }
13371
13391
  }
13372
- __addListenersOnClose() {
13392
+ __addListenersOnEnter() {
13373
13393
  if (this.__listenClose) {
13374
13394
  return;
13375
13395
  }
13376
13396
  this.__listenClose = true;
13377
13397
  const view = this.j;
13378
13398
  view.e
13379
- .on(view.ow, 'scroll.tooltip', this.__hide)
13380
- .on(view.ow, 'joditCloseDialog', this.__hide)
13381
- .on(view.container, 'mouseleave.tooltip', this.__hide)
13382
- .on([
13383
- 'escape.tooltip',
13384
- 'change.tooltip',
13385
- 'changePlace.tooltip',
13386
- 'afterOpenPopup.tooltip',
13387
- 'hidePopup.tooltip',
13388
- 'closeAllPopups.tooltip'
13389
- ], this.__hide)
13390
- .on(view.container, 'mouseleave', this.__onMouseLeave, {
13399
+ .on(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
13400
+ .on(JODIT_EVENTS_ON_HIDE, this.__hide)
13401
+ .on(view.container, 'mouseleave.tooltip', this.__onMouseLeave, {
13391
13402
  capture: true
13392
13403
  });
13393
13404
  }
13394
- __removeListenersOnClose() {
13405
+ __removeListenersOnLeave() {
13395
13406
  if (!this.__listenClose) {
13396
13407
  return;
13397
13408
  }
13398
13409
  this.__listenClose = false;
13399
13410
  const view = this.j;
13400
13411
  view.e
13401
- .off(view.ow, 'scroll.tooltip', this.__hide)
13402
- .off([
13403
- 'escape.tooltip',
13404
- 'change.tooltip',
13405
- 'changePlace.tooltip',
13406
- 'afterOpenPopup.tooltip',
13407
- 'hidePopup.tooltip',
13408
- 'closeAllPopups.tooltip'
13409
- ], this.__hide)
13412
+ .off(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
13413
+ .off(JODIT_EVENTS_ON_HIDE, this.__hide)
13410
13414
  .off(view.container, 'mouseleave.tooltip', this.__onMouseLeave);
13411
13415
  }
13412
13416
  __onMouseLeave(e) {
@@ -13432,29 +13436,30 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13432
13436
  return;
13433
13437
  }
13434
13438
  this.__currentTarget = e.target;
13435
- const pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__/* .position */ .G)(e.target);
13436
- this.__addListenersOnClose();
13437
- this.__delayOpen(() => ({
13438
- x: pos.left + pos.width / 2,
13439
- y: pos.top + pos.height
13440
- }), tooltip);
13441
- }
13442
- __delayOpen(getPoint, content) {
13443
- const to = this.j.o.showTooltipDelay || this.j.defaultTimeout;
13439
+ const target = e.target;
13440
+ this.__open(() => {
13441
+ const pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__/* .position */ .G)(target);
13442
+ return {
13443
+ x: pos.left + pos.width / 2,
13444
+ y: pos.top + pos.height
13445
+ };
13446
+ }, tooltip);
13447
+ }
13448
+ __open(getPoint, content) {
13449
+ this.__addListenersOnEnter();
13450
+ this.__isOpened = true;
13444
13451
  this.j.async.clearTimeout(this.__hideTimeout);
13445
13452
  this.j.async.clearTimeout(this.__delayShowTimeout);
13446
- this.__delayShowTimeout = this.j.async.setTimeout(() => this.__open(getPoint, content), {
13447
- timeout: to,
13448
- label: 'tooltip'
13449
- });
13453
+ const to = this.j.o.showTooltipDelay || this.j.defaultTimeout;
13454
+ if (!to) {
13455
+ this.__show(getPoint, content);
13456
+ return;
13457
+ }
13458
+ this.__delayShowTimeout = this.j.async.setTimeout(() => this.__show(getPoint, content), to);
13450
13459
  }
13451
- __open(getPoint, content) {
13460
+ __show(getPoint, content) {
13452
13461
  this.setMod('visible', true);
13453
13462
  this.getElm('content').innerHTML = content;
13454
- this.__isOpened = true;
13455
- this.__setPosition(getPoint);
13456
- }
13457
- __setPosition(getPoint) {
13458
13463
  const point = getPoint();
13459
13464
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.container, {
13460
13465
  left: point.x,
@@ -13464,24 +13469,26 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13464
13469
  __hide() {
13465
13470
  this.j.async.clearTimeout(this.__delayShowTimeout);
13466
13471
  this.j.async.clearTimeout(this.__hideTimeout);
13467
- this.__removeListenersOnClose();
13472
+ this.__removeListenersOnLeave();
13468
13473
  if (this.__isOpened) {
13469
13474
  this.__isOpened = false;
13470
13475
  this.setMod('visible', false);
13476
+ this.getElm('content').innerHTML = '';
13471
13477
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.container, {
13472
13478
  left: -5000
13473
13479
  });
13474
13480
  }
13475
13481
  }
13476
13482
  __hideDelay() {
13483
+ this.j.async.clearTimeout(this.__delayShowTimeout);
13484
+ this.j.async.clearTimeout(this.__hideTimeout);
13477
13485
  if (!this.__isOpened) {
13478
13486
  return;
13479
13487
  }
13480
- this.j.async.clearTimeout(this.__delayShowTimeout);
13481
13488
  this.__hideTimeout = this.async.setTimeout(this.__hide, this.j.defaultTimeout);
13482
13489
  }
13483
13490
  destruct() {
13484
- this.j.e.off(this.j.container, 'mouseenter', this.__onMouseEnter);
13491
+ this.j.e.off(this.j.container, 'mouseenter.tooltip', this.__onMouseEnter);
13485
13492
  this.__hide();
13486
13493
  super.destruct();
13487
13494
  }
@@ -24736,8 +24743,8 @@ function val(elm, selector, value) {
24736
24743
  /* harmony export */ });
24737
24744
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
24738
24745
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
24739
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
24740
24746
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69052);
24747
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26150);
24741
24748
  /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53048);
24742
24749
  /*!
24743
24750
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -24779,8 +24786,16 @@ function val(elm, selector, value) {
24779
24786
  * ```
24780
24787
  */
24781
24788
  const TabsWidget = (jodit, tabs, state) => {
24782
- const box = jodit.c.div('jodit-tabs'), tabBox = jodit.c.div('jodit-tabs__wrapper'), buttons = jodit.c.div('jodit-tabs__buttons'), nameToTab = {}, buttonList = [];
24783
- let firstTab = '', tabCount = 0;
24789
+ const box = jodit.c.div('jodit-tabs');
24790
+ const tabBox = jodit.c.div('jodit-tabs__wrapper');
24791
+ const buttons = jodit.c.div('jodit-tabs__buttons');
24792
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(buttons, {
24793
+ role: 'tablist',
24794
+ 'aria-orientation': 'horizontal'
24795
+ });
24796
+ const nameToTab = {};
24797
+ const buttonList = [];
24798
+ let firstTab = '';
24784
24799
  box.appendChild(buttons);
24785
24800
  box.appendChild(tabBox);
24786
24801
  const setActive = (tab) => {
@@ -24788,20 +24803,21 @@ const TabsWidget = (jodit, tabs, state) => {
24788
24803
  return;
24789
24804
  }
24790
24805
  buttonList.forEach(b => {
24791
- b.state.variant = 'initial';
24792
24806
  b.state.activated = false;
24793
24807
  });
24794
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24795
- a.classList.remove('jodit-tab_active');
24796
- });
24797
- nameToTab[tab].button.state.variant = 'outline';
24808
+ Object.values(nameToTab).forEach(({ tab }) => tab.classList.remove('jodit-tab_active'));
24798
24809
  nameToTab[tab].button.state.activated = true;
24799
24810
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24800
24811
  };
24801
24812
  tabs.forEach(({ icon, name, content }) => {
24802
- const tab = jodit.c.div('jodit-tab'), button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
24813
+ const tab = jodit.c.div('jodit-tab');
24814
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(tab, {
24815
+ role: 'tabpanel'
24816
+ });
24817
+ const button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
24818
+ button.state.role = 'tab';
24803
24819
  // Stop lose the focus
24804
- jodit.e.on(button.container, 'mousedown', (e) => e.preventDefault());
24820
+ jodit.e.on(button.container, 'pointerdown', (e) => e.preventDefault());
24805
24821
  if (!firstTab) {
24806
24822
  firstTab = name;
24807
24823
  }
@@ -24831,13 +24847,9 @@ const TabsWidget = (jodit, tabs, state) => {
24831
24847
  button,
24832
24848
  tab
24833
24849
  };
24834
- tabCount += 1;
24835
24850
  });
24836
- if (!tabCount) {
24837
- return box;
24838
- }
24839
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24840
- a.style.width = (100 / tabCount).toFixed(10) + '%';
24851
+ Object.values(nameToTab).forEach(({ button }) => {
24852
+ button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
24841
24853
  });
24842
24854
  const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24843
24855
  ? firstTab