jodit 4.2.18 → 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 (70) hide show
  1. package/CHANGELOG.md +18 -7
  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 +76 -64
  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 +76 -64
  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 +76 -64
  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 +76 -64
  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 +79 -63
  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/toolbar/collection/collection.js +1 -1
  64. package/esm/modules/widget/tabs/tabs.js +21 -16
  65. package/esm/types/ui.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/types/core/ui/button/button/button.d.ts +1 -0
  68. package/types/core/ui/button/tooltip/tooltip.d.ts +3 -4
  69. package/types/modules/toolbar/button/button.d.ts +1 -0
  70. package/types/types/ui.d.ts +1 -0
@@ -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.18
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.18";
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
  }
@@ -23540,7 +23547,7 @@ let ToolbarCollection = class ToolbarCollection extends jodit_core_ui__WEBPACK_I
23540
23547
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
23541
23548
  ], ToolbarCollection.prototype, "__immediateUpdate", null);
23542
23549
  (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
23543
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)()
23550
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.debounce)(ctx => ctx.j.defaultTimeout, true)
23544
23551
  ], ToolbarCollection.prototype, "update", null);
23545
23552
  (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__decorate */ .Cg)([
23546
23553
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.hook)('ready')
@@ -24718,8 +24725,8 @@ function val(elm, selector, value) {
24718
24725
  /* harmony export */ });
24719
24726
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
24720
24727
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
24721
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
24722
24728
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69052);
24729
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26150);
24723
24730
  /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53048);
24724
24731
  /*!
24725
24732
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -24761,8 +24768,16 @@ function val(elm, selector, value) {
24761
24768
  * ```
24762
24769
  */
24763
24770
  const TabsWidget = (jodit, tabs, state) => {
24764
- const box = jodit.c.div('jodit-tabs'), tabBox = jodit.c.div('jodit-tabs__wrapper'), buttons = jodit.c.div('jodit-tabs__buttons'), nameToTab = {}, buttonList = [];
24765
- let firstTab = '', tabCount = 0;
24771
+ const box = jodit.c.div('jodit-tabs');
24772
+ const tabBox = jodit.c.div('jodit-tabs__wrapper');
24773
+ const buttons = jodit.c.div('jodit-tabs__buttons');
24774
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(buttons, {
24775
+ role: 'tablist',
24776
+ 'aria-orientation': 'horizontal'
24777
+ });
24778
+ const nameToTab = {};
24779
+ const buttonList = [];
24780
+ let firstTab = '';
24766
24781
  box.appendChild(buttons);
24767
24782
  box.appendChild(tabBox);
24768
24783
  const setActive = (tab) => {
@@ -24770,20 +24785,21 @@ const TabsWidget = (jodit, tabs, state) => {
24770
24785
  return;
24771
24786
  }
24772
24787
  buttonList.forEach(b => {
24773
- b.state.variant = 'initial';
24774
24788
  b.state.activated = false;
24775
24789
  });
24776
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(a => {
24777
- a.classList.remove('jodit-tab_active');
24778
- });
24779
- nameToTab[tab].button.state.variant = 'outline';
24790
+ Object.values(nameToTab).forEach(({ tab }) => tab.classList.remove('jodit-tab_active'));
24780
24791
  nameToTab[tab].button.state.activated = true;
24781
24792
  nameToTab[tab].tab.classList.add('jodit-tab_active');
24782
24793
  };
24783
24794
  tabs.forEach(({ icon, name, content }) => {
24784
- const tab = jodit.c.div('jodit-tab'), button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
24795
+ const tab = jodit.c.div('jodit-tab');
24796
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(tab, {
24797
+ role: 'tabpanel'
24798
+ });
24799
+ const button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
24800
+ button.state.role = 'tab';
24785
24801
  // Stop lose the focus
24786
- jodit.e.on(button.container, 'mousedown', (e) => e.preventDefault());
24802
+ jodit.e.on(button.container, 'pointerdown', (e) => e.preventDefault());
24787
24803
  if (!firstTab) {
24788
24804
  firstTab = name;
24789
24805
  }
@@ -24813,13 +24829,9 @@ const TabsWidget = (jodit, tabs, state) => {
24813
24829
  button,
24814
24830
  tab
24815
24831
  };
24816
- tabCount += 1;
24817
24832
  });
24818
- if (!tabCount) {
24819
- return box;
24820
- }
24821
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(a => {
24822
- a.style.width = (100 / tabCount).toFixed(10) + '%';
24833
+ Object.values(nameToTab).forEach(({ button }) => {
24834
+ button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
24823
24835
  });
24824
24836
  const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
24825
24837
  ? firstTab