jodit 4.2.19 → 4.2.22

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 (85) hide show
  1. package/CHANGELOG.md +16 -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 +3 -2
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +98 -77
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.css +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  14. package/es2018/jodit.css +47 -1
  15. package/es2018/jodit.fat.min.css +1 -1
  16. package/es2018/jodit.fat.min.js +2 -2
  17. package/es2018/jodit.js +75 -63
  18. package/es2018/jodit.min.css +1 -1
  19. package/es2018/jodit.min.js +2 -2
  20. package/es2018/plugins/debug/debug.js +1 -1
  21. package/es2018/plugins/debug/debug.min.js +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.css +3 -2
  23. package/es2018/plugins/speech-recognize/speech-recognize.js +98 -77
  24. package/es2018/plugins/speech-recognize/speech-recognize.min.css +1 -1
  25. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  26. package/es2021/jodit.css +47 -1
  27. package/es2021/jodit.fat.min.css +1 -1
  28. package/es2021/jodit.fat.min.js +2 -2
  29. package/es2021/jodit.js +75 -63
  30. package/es2021/jodit.min.css +1 -1
  31. package/es2021/jodit.min.js +2 -2
  32. package/es2021/plugins/debug/debug.js +1 -1
  33. package/es2021/plugins/debug/debug.min.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.css +3 -2
  35. package/es2021/plugins/speech-recognize/speech-recognize.js +98 -77
  36. package/es2021/plugins/speech-recognize/speech-recognize.min.css +1 -1
  37. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  38. package/es2021.en/jodit.css +47 -1
  39. package/es2021.en/jodit.fat.min.css +1 -1
  40. package/es2021.en/jodit.fat.min.js +2 -2
  41. package/es2021.en/jodit.js +75 -63
  42. package/es2021.en/jodit.min.css +1 -1
  43. package/es2021.en/jodit.min.js +2 -2
  44. package/es2021.en/plugins/debug/debug.js +1 -1
  45. package/es2021.en/plugins/debug/debug.min.js +1 -1
  46. package/es2021.en/plugins/speech-recognize/speech-recognize.css +3 -2
  47. package/es2021.en/plugins/speech-recognize/speech-recognize.js +98 -77
  48. package/es2021.en/plugins/speech-recognize/speech-recognize.min.css +1 -1
  49. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  50. package/es5/jodit.css +77 -2
  51. package/es5/jodit.fat.min.css +1 -1
  52. package/es5/jodit.fat.min.js +2 -2
  53. package/es5/jodit.js +78 -62
  54. package/es5/jodit.min.css +3 -3
  55. package/es5/jodit.min.js +2 -2
  56. package/es5/plugins/debug/debug.js +1 -1
  57. package/es5/plugins/debug/debug.min.js +1 -1
  58. package/es5/plugins/speech-recognize/speech-recognize.css +3 -2
  59. package/es5/plugins/speech-recognize/speech-recognize.js +99 -79
  60. package/es5/plugins/speech-recognize/speech-recognize.min.css +1 -1
  61. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  62. package/esm/core/constants.js +1 -1
  63. package/esm/core/ui/button/button/button.d.ts +1 -0
  64. package/esm/core/ui/button/button/button.js +7 -0
  65. package/esm/core/ui/button/tooltip/tooltip.d.ts +3 -4
  66. package/esm/core/ui/button/tooltip/tooltip.js +44 -44
  67. package/esm/modules/toolbar/button/button.d.ts +1 -0
  68. package/esm/modules/widget/tabs/tabs.js +21 -16
  69. package/esm/plugins/speech-recognize/config.d.ts +1 -1
  70. package/esm/plugins/speech-recognize/config.js +13 -5
  71. package/esm/plugins/speech-recognize/helpers/recognize-manager.d.ts +3 -2
  72. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +45 -31
  73. package/esm/plugins/speech-recognize/interface.d.ts +1 -0
  74. package/esm/plugins/speech-recognize/speech-recognize.d.ts +5 -1
  75. package/esm/plugins/speech-recognize/speech-recognize.js +17 -17
  76. package/esm/types/ui.d.ts +1 -0
  77. package/package.json +1 -1
  78. package/types/core/ui/button/button/button.d.ts +1 -0
  79. package/types/core/ui/button/tooltip/tooltip.d.ts +3 -4
  80. package/types/modules/toolbar/button/button.d.ts +1 -0
  81. package/types/plugins/speech-recognize/config.d.ts +1 -1
  82. package/types/plugins/speech-recognize/helpers/recognize-manager.d.ts +3 -2
  83. package/types/plugins/speech-recognize/interface.d.ts +1 -0
  84. package/types/plugins/speech-recognize/speech-recognize.d.ts +5 -1
  85. package/types/types/ui.d.ts +1 -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.2.19
4
+ * Version: v4.2.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3127,7 +3127,7 @@ __webpack_require__.r(__webpack_exports__);
3127
3127
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3128
3128
  */
3129
3129
 
3130
- var APP_VERSION = "4.2.19";
3130
+ var APP_VERSION = "4.2.22";
3131
3131
  // prettier-ignore
3132
3132
  var ES = "es5";
3133
3133
  var IS_ES_MODERN = false;
@@ -14877,6 +14877,7 @@ var Mods = /** @class */ (function () {
14877
14877
  var UIButtonState = function () { return ({
14878
14878
  size: 'middle',
14879
14879
  type: 'button',
14880
+ role: 'button',
14880
14881
  name: '',
14881
14882
  value: '',
14882
14883
  variant: 'initial',
@@ -14953,6 +14954,9 @@ var UIButton = /** @class */ (function (_super) {
14953
14954
  UIButton.prototype.onChangeType = function () {
14954
14955
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(this.container, 'type', this.state.type);
14955
14956
  };
14957
+ UIButton.prototype.onChangeRole = function () {
14958
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(this.container, 'role', this.state.role);
14959
+ };
14956
14960
  /**
14957
14961
  * Set size from a parent list
14958
14962
  */
@@ -15064,6 +15068,9 @@ var UIButton = /** @class */ (function (_super) {
15064
15068
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
15065
15069
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('state.type', { immediately: false })
15066
15070
  ], UIButton.prototype, "onChangeType", null);
15071
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
15072
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('state.role', { immediately: false })
15073
+ ], UIButton.prototype, "onChangeRole", null);
15067
15074
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
15068
15075
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('parentElement')
15069
15076
  ], UIButton.prototype, "updateSize", null);
@@ -15278,6 +15285,19 @@ var UIButtonGroup = /** @class */ (function (_super) {
15278
15285
 
15279
15286
 
15280
15287
 
15288
+ var WINDOW_EVENTS_ON_HIDE = [
15289
+ 'scroll.tooltip',
15290
+ 'joditCloseDialog',
15291
+ 'mouseleave.tooltip'
15292
+ ];
15293
+ var JODIT_EVENTS_ON_HIDE = [
15294
+ 'escape.tooltip',
15295
+ 'change.tooltip',
15296
+ 'changePlace.tooltip',
15297
+ 'afterOpenPopup.tooltip',
15298
+ 'hidePopup.tooltip',
15299
+ 'closeAllPopups.tooltip'
15300
+ ];
15281
15301
  var UITooltip = /** @class */ (function (_super) {
15282
15302
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(UITooltip, _super);
15283
15303
  function UITooltip(view) {
@@ -15291,7 +15311,7 @@ var UITooltip = /** @class */ (function (_super) {
15291
15311
  view.o.showTooltip &&
15292
15312
  !view.o.useNativeTooltip) {
15293
15313
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, function () {
15294
- // TODO Move it inside __open method. Now it is here because testcase failed with capturing
15314
+ // TODO Move it inside __show method. Now it is here because testcase failed with capturing
15295
15315
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(_this.j, UITooltip_1).appendChild(_this.container);
15296
15316
  view.e.on(view.container, 'mouseenter.tooltip', _this.__onMouseEnter, {
15297
15317
  capture: true
@@ -15307,44 +15327,28 @@ var UITooltip = /** @class */ (function (_super) {
15307
15327
  UITooltip.prototype.render = function () {
15308
15328
  return '<div><div class="&__content"></div></div>';
15309
15329
  };
15310
- UITooltip.prototype.__addListenersOnClose = function () {
15330
+ UITooltip.prototype.__addListenersOnEnter = function () {
15311
15331
  if (this.__listenClose) {
15312
15332
  return;
15313
15333
  }
15314
15334
  this.__listenClose = true;
15315
15335
  var view = this.j;
15316
15336
  view.e
15317
- .on(view.ow, 'scroll.tooltip', this.__hide)
15318
- .on(view.ow, 'joditCloseDialog', this.__hide)
15319
- .on(view.container, 'mouseleave.tooltip', this.__hide)
15320
- .on([
15321
- 'escape.tooltip',
15322
- 'change.tooltip',
15323
- 'changePlace.tooltip',
15324
- 'afterOpenPopup.tooltip',
15325
- 'hidePopup.tooltip',
15326
- 'closeAllPopups.tooltip'
15327
- ], this.__hide)
15328
- .on(view.container, 'mouseleave', this.__onMouseLeave, {
15337
+ .on(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
15338
+ .on(JODIT_EVENTS_ON_HIDE, this.__hide)
15339
+ .on(view.container, 'mouseleave.tooltip', this.__onMouseLeave, {
15329
15340
  capture: true
15330
15341
  });
15331
15342
  };
15332
- UITooltip.prototype.__removeListenersOnClose = function () {
15343
+ UITooltip.prototype.__removeListenersOnLeave = function () {
15333
15344
  if (!this.__listenClose) {
15334
15345
  return;
15335
15346
  }
15336
15347
  this.__listenClose = false;
15337
15348
  var view = this.j;
15338
15349
  view.e
15339
- .off(view.ow, 'scroll.tooltip', this.__hide)
15340
- .off([
15341
- 'escape.tooltip',
15342
- 'change.tooltip',
15343
- 'changePlace.tooltip',
15344
- 'afterOpenPopup.tooltip',
15345
- 'hidePopup.tooltip',
15346
- 'closeAllPopups.tooltip'
15347
- ], this.__hide)
15350
+ .off(view.ow, WINDOW_EVENTS_ON_HIDE, this.__hide)
15351
+ .off(JODIT_EVENTS_ON_HIDE, this.__hide)
15348
15352
  .off(view.container, 'mouseleave.tooltip', this.__onMouseLeave);
15349
15353
  };
15350
15354
  UITooltip.prototype.__onMouseLeave = function (e) {
@@ -15370,30 +15374,31 @@ var UITooltip = /** @class */ (function (_super) {
15370
15374
  return;
15371
15375
  }
15372
15376
  this.__currentTarget = e.target;
15373
- var pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_7__/* .position */ .G)(e.target);
15374
- this.__addListenersOnClose();
15375
- this.__delayOpen(function () { return ({
15376
- x: pos.left + pos.width / 2,
15377
- y: pos.top + pos.height
15378
- }); }, tooltip);
15379
- };
15380
- UITooltip.prototype.__delayOpen = function (getPoint, content) {
15377
+ var target = e.target;
15378
+ this.__open(function () {
15379
+ var pos = (0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_7__/* .position */ .G)(target);
15380
+ return {
15381
+ x: pos.left + pos.width / 2,
15382
+ y: pos.top + pos.height
15383
+ };
15384
+ }, tooltip);
15385
+ };
15386
+ UITooltip.prototype.__open = function (getPoint, content) {
15381
15387
  var _this = this;
15382
- var to = this.j.o.showTooltipDelay || this.j.defaultTimeout;
15388
+ this.__addListenersOnEnter();
15389
+ this.__isOpened = true;
15383
15390
  this.j.async.clearTimeout(this.__hideTimeout);
15384
15391
  this.j.async.clearTimeout(this.__delayShowTimeout);
15385
- this.__delayShowTimeout = this.j.async.setTimeout(function () { return _this.__open(getPoint, content); }, {
15386
- timeout: to,
15387
- label: 'tooltip'
15388
- });
15392
+ var to = this.j.o.showTooltipDelay || this.j.defaultTimeout;
15393
+ if (!to) {
15394
+ this.__show(getPoint, content);
15395
+ return;
15396
+ }
15397
+ this.__delayShowTimeout = this.j.async.setTimeout(function () { return _this.__show(getPoint, content); }, to);
15389
15398
  };
15390
- UITooltip.prototype.__open = function (getPoint, content) {
15399
+ UITooltip.prototype.__show = function (getPoint, content) {
15391
15400
  this.setMod('visible', true);
15392
15401
  this.getElm('content').innerHTML = content;
15393
- this.__isOpened = true;
15394
- this.__setPosition(getPoint);
15395
- };
15396
- UITooltip.prototype.__setPosition = function (getPoint) {
15397
15402
  var point = getPoint();
15398
15403
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.container, {
15399
15404
  left: point.x,
@@ -15403,24 +15408,26 @@ var UITooltip = /** @class */ (function (_super) {
15403
15408
  UITooltip.prototype.__hide = function () {
15404
15409
  this.j.async.clearTimeout(this.__delayShowTimeout);
15405
15410
  this.j.async.clearTimeout(this.__hideTimeout);
15406
- this.__removeListenersOnClose();
15411
+ this.__removeListenersOnLeave();
15407
15412
  if (this.__isOpened) {
15408
15413
  this.__isOpened = false;
15409
15414
  this.setMod('visible', false);
15415
+ this.getElm('content').innerHTML = '';
15410
15416
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.css)(this.container, {
15411
15417
  left: -5000
15412
15418
  });
15413
15419
  }
15414
15420
  };
15415
15421
  UITooltip.prototype.__hideDelay = function () {
15422
+ this.j.async.clearTimeout(this.__delayShowTimeout);
15423
+ this.j.async.clearTimeout(this.__hideTimeout);
15416
15424
  if (!this.__isOpened) {
15417
15425
  return;
15418
15426
  }
15419
- this.j.async.clearTimeout(this.__delayShowTimeout);
15420
15427
  this.__hideTimeout = this.async.setTimeout(this.__hide, this.j.defaultTimeout);
15421
15428
  };
15422
15429
  UITooltip.prototype.destruct = function () {
15423
- this.j.e.off(this.j.container, 'mouseenter', this.__onMouseEnter);
15430
+ this.j.e.off(this.j.container, 'mouseenter.tooltip', this.__onMouseEnter);
15424
15431
  this.__hide();
15425
15432
  _super.prototype.destruct.call(this);
15426
15433
  };
@@ -27211,8 +27218,8 @@ function val(elm, selector, value) {
27211
27218
  /* harmony export */ });
27212
27219
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
27213
27220
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
27214
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65147);
27215
27221
  /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69052);
27222
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26150);
27216
27223
  /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53048);
27217
27224
  /*!
27218
27225
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -27254,8 +27261,16 @@ function val(elm, selector, value) {
27254
27261
  * ```
27255
27262
  */
27256
27263
  var TabsWidget = function (jodit, tabs, state) {
27257
- var box = jodit.c.div('jodit-tabs'), tabBox = jodit.c.div('jodit-tabs__wrapper'), buttons = jodit.c.div('jodit-tabs__buttons'), nameToTab = {}, buttonList = [];
27258
- var firstTab = '', tabCount = 0;
27264
+ var box = jodit.c.div('jodit-tabs');
27265
+ var tabBox = jodit.c.div('jodit-tabs__wrapper');
27266
+ var buttons = jodit.c.div('jodit-tabs__buttons');
27267
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(buttons, {
27268
+ role: 'tablist',
27269
+ 'aria-orientation': 'horizontal'
27270
+ });
27271
+ var nameToTab = {};
27272
+ var buttonList = [];
27273
+ var firstTab = '';
27259
27274
  box.appendChild(buttons);
27260
27275
  box.appendChild(tabBox);
27261
27276
  var setActive = function (tab) {
@@ -27263,21 +27278,25 @@ var TabsWidget = function (jodit, tabs, state) {
27263
27278
  return;
27264
27279
  }
27265
27280
  buttonList.forEach(function (b) {
27266
- b.state.variant = 'initial';
27267
27281
  b.state.activated = false;
27268
27282
  });
27269
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('.jodit-tab', tabBox).forEach(function (a) {
27270
- a.classList.remove('jodit-tab_active');
27283
+ Object.values(nameToTab).forEach(function (_a) {
27284
+ var tab = _a.tab;
27285
+ return tab.classList.remove('jodit-tab_active');
27271
27286
  });
27272
- nameToTab[tab].button.state.variant = 'outline';
27273
27287
  nameToTab[tab].button.state.activated = true;
27274
27288
  nameToTab[tab].tab.classList.add('jodit-tab_active');
27275
27289
  };
27276
27290
  tabs.forEach(function (_a) {
27277
27291
  var icon = _a.icon, name = _a.name, content = _a.content;
27278
- var tab = jodit.c.div('jodit-tab'), button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
27292
+ var tab = jodit.c.div('jodit-tab');
27293
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(tab, {
27294
+ role: 'tabpanel'
27295
+ });
27296
+ var button = (0,jodit_core_ui__WEBPACK_IMPORTED_MODULE_3__/* .Button */ .$n)(jodit, icon || name, name);
27297
+ button.state.role = 'tab';
27279
27298
  // Stop lose the focus
27280
- jodit.e.on(button.container, 'mousedown', function (e) {
27299
+ jodit.e.on(button.container, 'pointerdown', function (e) {
27281
27300
  return e.preventDefault();
27282
27301
  });
27283
27302
  if (!firstTab) {
@@ -27309,13 +27328,10 @@ var TabsWidget = function (jodit, tabs, state) {
27309
27328
  button: button,
27310
27329
  tab: tab
27311
27330
  };
27312
- tabCount += 1;
27313
27331
  });
27314
- if (!tabCount) {
27315
- return box;
27316
- }
27317
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('a', buttons).forEach(function (a) {
27318
- a.style.width = (100 / tabCount).toFixed(10) + '%';
27332
+ Object.values(nameToTab).forEach(function (_a) {
27333
+ var button = _a.button;
27334
+ button.container.style.width = (100 / tabs.length).toFixed(10) + '%';
27319
27335
  });
27320
27336
  var tab = !state || !state.activeTab || !nameToTab[state.activeTab]
27321
27337
  ? firstTab