jodit 4.13.17 → 4.13.19

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 (58) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +4 -4
  4. package/es2015/jodit.js +191 -109
  5. package/es2015/jodit.min.js +4 -4
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +9 -9
  13. package/es2018/jodit.min.js +4 -4
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +15 -15
  18. package/es2021/jodit.js +187 -105
  19. package/es2021/jodit.min.js +8 -8
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +8 -8
  28. package/es2021.en/jodit.js +187 -105
  29. package/es2021.en/jodit.min.js +8 -8
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +477 -401
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +6 -6
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +13 -19
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/helpers/utils/scroll-into-view.d.ts +0 -3
  52. package/esm/core/helpers/utils/scroll-into-view.js +12 -2
  53. package/esm/modules/toolbar/button/button.d.ts +1 -0
  54. package/esm/modules/toolbar/button/button.js +13 -0
  55. package/esm/plugins/table/config.js +79 -19
  56. package/package.json +1 -1
  57. package/types/core/helpers/utils/scroll-into-view.d.ts +0 -3
  58. package/types/modules/toolbar/button/button.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.13.17
4
+ * Version: v4.13.19
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1843,7 +1843,7 @@ __webpack_require__.r(__webpack_exports__);
1843
1843
  * ```
1844
1844
  * @packageDocumentation
1845
1845
  * @module constants
1846
- */ const APP_VERSION = "4.13.17";
1846
+ */ const APP_VERSION = "4.13.19";
1847
1847
  // prettier-ignore
1848
1848
  const ES = "es2021";
1849
1849
  const IS_ES_MODERN = true;
@@ -9060,6 +9060,14 @@ const map = {};
9060
9060
  /**
9061
9061
  * @module helpers/utils
9062
9062
  */ /**
9063
+ * `getBoundingClientRect` returns fractional values while `scrollTop`,
9064
+ * `offsetTop` and `clientHeight` are rounded to integers, so a container
9065
+ * scrolled right up to its limit can still appear to clip the element by a
9066
+ * fraction of a pixel. Treat anything clipped by less than a pixel as
9067
+ * visible — otherwise `scrollIntoViewIfNeeded` falls through to
9068
+ * `elm.scrollIntoView()` and needlessly scrolls the whole page.
9069
+ */ const SUBPIXEL_TOLERANCE = 1;
9070
+ /**
9063
9071
  * Check if element is in view
9064
9072
  */ function inView(elm, root, doc) {
9065
9073
  let rect = elm.getBoundingClientRect(), el = elm;
@@ -9072,7 +9080,7 @@ const map = {};
9072
9080
  // view even though its top still fits. The `top > rect.top` guard keeps
9073
9081
  // elements taller than the container (which can never fully fit) from
9074
9082
  // being treated as always out of view. See #1300
9075
- if (top + height > rect.bottom && top > rect.top) {
9083
+ if (top + height > rect.bottom + SUBPIXEL_TOLERANCE && top > rect.top) {
9076
9084
  return false;
9077
9085
  }
9078
9086
  // Check if the element is out of view due to a container scrolling
@@ -9086,7 +9094,7 @@ const map = {};
9086
9094
  // element scrolled above the top was wrongly reported as visible and never
9087
9095
  // scrolled to. See #1279
9088
9096
  const clientHeight = doc.documentElement && doc.documentElement.clientHeight || 0;
9089
- return (top + height <= clientHeight || top <= 0) && top + height >= 0;
9097
+ return (top + height <= clientHeight + SUBPIXEL_TOLERANCE || top <= 0) && top + height >= 0;
9090
9098
  }
9091
9099
  /**
9092
9100
  * Scroll element into view if it is not in view
@@ -23713,27 +23721,28 @@ const instance = (j)=>j.getInstance('Table', j.o);
23713
23721
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
23714
23722
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
23715
23723
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69364);
23716
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
23717
- /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51676);
23718
- /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91672);
23719
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68616);
23720
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(23211);
23721
- /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17312);
23722
- /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91565);
23723
- /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(24497);
23724
- /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62101);
23725
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85932);
23726
- /* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(86878);
23727
- /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57821);
23728
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28712);
23729
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__);
23730
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7909);
23731
- /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(71125);
23732
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(59400);
23733
- /* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(15982);
23734
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(29434);
23735
- /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(51116);
23736
- /* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(4274);
23724
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81937);
23725
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49574);
23726
+ /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51676);
23727
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91672);
23728
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68616);
23729
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23211);
23730
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(17312);
23731
+ /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91565);
23732
+ /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24497);
23733
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62101);
23734
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85932);
23735
+ /* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(86878);
23736
+ /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(57821);
23737
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(28712);
23738
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__);
23739
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7909);
23740
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(71125);
23741
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(59400);
23742
+ /* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(15982);
23743
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(29434);
23744
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(51116);
23745
+ /* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(4274);
23737
23746
  /*!
23738
23747
  * Jodit Editor (https://xdsoft.net/jodit/)
23739
23748
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -23766,7 +23775,8 @@ const instance = (j)=>j.getInstance('Table', j.o);
23766
23775
 
23767
23776
 
23768
23777
 
23769
- class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButton {
23778
+
23779
+ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButton {
23770
23780
  className() {
23771
23781
  return 'ToolbarButton';
23772
23782
  }
@@ -23777,13 +23787,13 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23777
23787
  super.updateAriaLabel();
23778
23788
  if (this.trigger) {
23779
23789
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
23780
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'aria-label', i8nTooltip);
23790
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-label', i8nTooltip);
23781
23791
  }
23782
23792
  }
23783
23793
  /**
23784
23794
  * Get parent toolbar
23785
23795
  */ get toolbar() {
23786
- const ToolbarCollection = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__.getComponentClass)('ToolbarCollection');
23796
+ const ToolbarCollection = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.getComponentClass)('ToolbarCollection');
23787
23797
  return this.closest(ToolbarCollection);
23788
23798
  }
23789
23799
  update() {
@@ -23803,7 +23813,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23803
23813
  /**
23804
23814
  * Calculates whether the button is active
23805
23815
  */ __calculateActivatedStatus(tc) {
23806
- if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_10__.isJoditObject)(this.j) && !this.j.editorIsActive) {
23816
+ if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__.isJoditObject)(this.j) && !this.j.editorIsActive) {
23807
23817
  return false;
23808
23818
  }
23809
23819
  if (this.control.isActive?.(this.j, this)) {
@@ -23826,11 +23836,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23826
23836
  return Boolean(tc && tc.shouldBeDisabled(this));
23827
23837
  }
23828
23838
  onChangeActivated() {
23829
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'aria-pressed', this.state.activated);
23839
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'aria-pressed', this.state.activated);
23830
23840
  super.onChangeActivated();
23831
23841
  }
23832
23842
  onChangeText() {
23833
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(this.control.template)) {
23843
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(this.control.template)) {
23834
23844
  this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
23835
23845
  } else {
23836
23846
  super.onChangeText();
@@ -23838,7 +23848,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23838
23848
  this.setMod('text-icons', Boolean(this.text.innerText.trim().length));
23839
23849
  }
23840
23850
  onChangeTabIndex() {
23841
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'tabindex', this.state.tabIndex);
23851
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'tabindex', this.state.tabIndex);
23852
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'tabindex', this.state.tabIndex);
23842
23853
  }
23843
23854
  createContainer() {
23844
23855
  const cn = this.componentName;
@@ -23851,7 +23862,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23851
23862
  configurable: true
23852
23863
  });
23853
23864
  container.appendChild(button);
23854
- const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.get('chevron')}</span>`);
23865
+ const trigger = this.j.c.fromHTML(`<span role="button" aria-haspopup="true" aria-expanded="false" class="${cn}__trigger">${jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__.Icon.get('chevron')}</span>`);
23855
23866
  // For caching
23856
23867
  button.appendChild(trigger);
23857
23868
  return container;
@@ -23863,15 +23874,15 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23863
23874
  if (this.state.hasTrigger) {
23864
23875
  this.container.appendChild(this.trigger);
23865
23876
  } else {
23866
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(this.trigger);
23877
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(this.trigger);
23867
23878
  }
23868
23879
  this.setMod('with-trigger', this.state.hasTrigger || null);
23869
23880
  }
23870
23881
  /** @override */ onChangeDisabled() {
23871
23882
  const disabled = this.state.disabled ? 'disabled' : null;
23872
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'disabled', disabled);
23873
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'disabled', disabled);
23874
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.container, 'disabled', disabled);
23883
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'disabled', disabled);
23884
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'disabled', disabled);
23885
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.container, 'disabled', disabled);
23875
23886
  }
23876
23887
  /**
23877
23888
  * Init constant data from control
@@ -23881,19 +23892,19 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23881
23892
  state.name = ctr.name;
23882
23893
  this.__initIconFromControl();
23883
23894
  if (ctr.tooltip) {
23884
- state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
23895
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
23885
23896
  }
23886
23897
  state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
23887
23898
  }
23888
23899
  __initIconFromControl() {
23889
23900
  const { control: ctr, state } = this;
23890
23901
  const { textIcons } = this.j.o;
23891
- if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
23892
- state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)().icon;
23902
+ if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
23903
+ state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)().icon;
23893
23904
  state.text = ctr.text || ctr.name;
23894
23905
  return;
23895
23906
  }
23896
- if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(ctr.icon) && ctr.icon != null) {
23907
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(ctr.icon) && ctr.icon != null) {
23897
23908
  state.icon = {
23898
23909
  name: ctr.icon.name || ctr.name,
23899
23910
  iconURL: ctr.icon.iconURL || '',
@@ -23906,7 +23917,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23906
23917
  state.icon.iconURL = ctr.iconURL;
23907
23918
  } else {
23908
23919
  const name = ctr.icon || ctr.name;
23909
- state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
23920
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
23910
23921
  }
23911
23922
  if (!ctr.iconURL && !state.icon.name) {
23912
23923
  state.text = ctr.text || ctr.name;
@@ -23920,22 +23931,22 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23920
23931
  return;
23921
23932
  }
23922
23933
  const { control: ctr } = this;
23923
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'aria-expanded', true);
23934
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', true);
23924
23935
  e.buffer = {
23925
23936
  actionTrigger: this
23926
23937
  };
23927
23938
  if (ctr.list) {
23928
23939
  return this.__openControlList(ctr);
23929
23940
  }
23930
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.popup)) {
23941
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.popup)) {
23931
23942
  const popup = this.openPopup();
23932
23943
  popup.parentElement = this;
23933
23944
  try {
23934
- if (this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_14__.camelCase)(`before-${ctr.name}-open-popup`), this.target, ctr, popup) !== false) {
23945
+ if (this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__.camelCase)(`before-${ctr.name}-open-popup`), this.target, ctr, popup) !== false) {
23935
23946
  const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
23936
23947
  const elm = ctr.popup(this.j, target, this.__closePopup, this);
23937
23948
  if (elm) {
23938
- popup.setContent((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(elm) ? this.j.c.fromHTML(elm) : elm).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_13__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
23949
+ popup.setContent((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(elm) ? this.j.c.fromHTML(elm) : elm).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
23939
23950
  } else {
23940
23951
  this.__closePopup();
23941
23952
  }
@@ -23948,28 +23959,39 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23948
23959
  * Fired after the popup was opened for some control button
23949
23960
  */ /**
23950
23961
  * Close all opened popups
23951
- */ this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_14__.camelCase)(`after-${ctr.name}-open-popup`), popup.container);
23962
+ */ this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__.camelCase)(`after-${ctr.name}-open-popup`), popup.container);
23952
23963
  }
23953
23964
  }
23965
+ onTriggerKeyDown(e) {
23966
+ if (this.state.disabled || ![
23967
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_ENTER,
23968
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_SPACE,
23969
+ ' '
23970
+ ].includes(e.key)) {
23971
+ return;
23972
+ }
23973
+ e.preventDefault();
23974
+ this.trigger.click();
23975
+ }
23954
23976
  /**
23955
23977
  * Create an open popup list
23956
23978
  */ __openControlList(control) {
23957
- const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_19__.findControlType)(key, controls);
23979
+ const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__.findControlType)(key, controls);
23958
23980
  const list = control.list;
23959
23981
  const menu = this.openPopup();
23960
- const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_22__.makeCollection)(this.j);
23982
+ const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
23961
23983
  menu.parentElement = this;
23962
23984
  toolbar.parentElement = menu;
23963
23985
  toolbar.mode = 'vertical';
23964
- const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_11__.isPlainObject)(key) && 'title' in key && 'value' in key;
23986
+ const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
23965
23987
  const getButton = (key, value)=>{
23966
- if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(value) && getControl(value)) {
23988
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(value) && getControl(value)) {
23967
23989
  return {
23968
23990
  name: value.toString(),
23969
23991
  ...getControl(value)
23970
23992
  };
23971
23993
  }
23972
- if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(key) && getControl(key)) {
23994
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(key) && getControl(key)) {
23973
23995
  return {
23974
23996
  name: key.toString(),
23975
23997
  ...getControl(key),
@@ -24000,26 +24022,26 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24000
24022
  value
24001
24023
  ]
24002
24024
  };
24003
- if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(value)) {
24025
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(value)) {
24004
24026
  childControl.text = value;
24005
24027
  }
24006
24028
  return childControl;
24007
24029
  };
24008
- toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_8__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_17__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
24009
- menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_13__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
24030
+ toolbar.build((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__.isArray)(list) ? list.map(getButton) : (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__.keys)(list, false).map((key)=>getButton(key, list[key])), this.target);
24031
+ menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
24010
24032
  this.state.activated = true;
24011
24033
  }
24012
24034
  onOutsideClick(e) {
24013
24035
  if (!this.openedPopup) {
24014
24036
  return;
24015
24037
  }
24016
- if (!e || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isNode(e.target) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isOrContains(this.container, e.target) && !this.openedPopup.isOwnClick(e)) {
24038
+ if (!e || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isNode(e.target) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(this.container, e.target) && !this.openedPopup.isOwnClick(e)) {
24017
24039
  this.__closePopup();
24018
24040
  }
24019
24041
  }
24020
24042
  openPopup() {
24021
24043
  this.__closePopup();
24022
- this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_21__.Popup(this.j, false);
24044
+ this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__.Popup(this.j, false);
24023
24045
  this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick);
24024
24046
  return this.openedPopup;
24025
24047
  }
@@ -24031,7 +24053,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24031
24053
  this.openedPopup.destruct();
24032
24054
  this.openedPopup = null;
24033
24055
  if (this.trigger) {
24034
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'aria-expanded', false);
24056
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', false);
24035
24057
  }
24036
24058
  }
24037
24059
  }
@@ -24039,7 +24061,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24039
24061
  * Click handler
24040
24062
  */ onClick(originalEvent) {
24041
24063
  const { control: ctr } = this;
24042
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.exec)) {
24064
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.exec)) {
24043
24065
  const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
24044
24066
  const result = ctr.exec(this.j, target, {
24045
24067
  control: ctr,
@@ -24063,11 +24085,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24063
24085
  if (ctr.list) {
24064
24086
  return this.__openControlList(ctr);
24065
24087
  }
24066
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.popup)) {
24088
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.popup)) {
24067
24089
  return this.onTriggerClick(originalEvent);
24068
24090
  }
24069
24091
  if (ctr.command || ctr.name) {
24070
- (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_17__.call)((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_10__.isJoditObject)(this.j) ? this.j.execCommand.bind(this.j) : this.j.od.execCommand.bind(this.j.od), ctr.command || ctr.name, false, ctr.args && ctr.args[0]);
24092
+ (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__.call)((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__.isJoditObject)(this.j) ? this.j.execCommand.bind(this.j) : this.j.od.execCommand.bind(this.j.od), ctr.command || ctr.name, false, ctr.args && ctr.args[0]);
24071
24093
  this.j.e.fire('closeAllPopups');
24072
24094
  }
24073
24095
  }
@@ -24077,20 +24099,20 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24077
24099
  }
24078
24100
  constructor(jodit, control, target = null){
24079
24101
  super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "control", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "target", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "trigger", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "openedPopup", void 0), this.control = control, this.target = target, this.state = {
24080
- ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)(),
24102
+ ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)(),
24081
24103
  theme: 'toolbar',
24082
24104
  currentValue: '',
24083
24105
  hasTrigger: false
24084
24106
  }, this.openedPopup = null;
24085
24107
  const button = this.getElm('button');
24086
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__.assert)(button, 'Element button should exists');
24108
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(button, 'Element button should exists');
24087
24109
  this.button = button;
24088
24110
  Object.defineProperty(button, 'component', {
24089
24111
  value: this,
24090
24112
  configurable: true
24091
24113
  });
24092
24114
  const trigger = this.getElm('trigger');
24093
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__.assert)(trigger, 'Element trigger should exists');
24115
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(trigger, 'Element trigger should exists');
24094
24116
  this.trigger = trigger;
24095
24117
  trigger.remove();
24096
24118
  // Prevent lost focus
@@ -24111,24 +24133,27 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24111
24133
  }
24112
24134
  }
24113
24135
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24114
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__.cacheHTML
24136
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__.cacheHTML
24115
24137
  ], ToolbarButton.prototype, "createContainer", null);
24116
24138
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24117
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__.watch)('state.hasTrigger', {
24139
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('state.hasTrigger', {
24118
24140
  immediately: false
24119
24141
  })
24120
24142
  ], ToolbarButton.prototype, "onChangeHasTrigger", null);
24121
24143
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24122
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__.watch)('trigger:click')
24144
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:click')
24123
24145
  ], ToolbarButton.prototype, "onTriggerClick", null);
24124
24146
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24125
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
24147
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:keydown')
24148
+ ], ToolbarButton.prototype, "onTriggerKeyDown", null);
24149
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24150
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24126
24151
  ], ToolbarButton.prototype, "onOutsideClick", null);
24127
24152
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24128
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
24153
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24129
24154
  ], ToolbarButton.prototype, "__closePopup", null);
24130
24155
  ToolbarButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24131
- jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__.component
24156
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.component
24132
24157
  ], ToolbarButton);
24133
24158
 
24134
24159
 
@@ -43615,13 +43640,14 @@ function findCell(editor, key) {
43615
43640
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
43616
43641
 
43617
43642
  "use strict";
43618
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
43619
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
43620
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93640);
43621
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29434);
43622
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
43623
- /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67447);
43624
- /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_5__);
43643
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
43644
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
43645
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
43646
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
43647
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
43648
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
43649
+ /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67447);
43650
+ /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_6__);
43625
43651
  /*!
43626
43652
  * Jodit Editor (https://xdsoft.net/jodit/)
43627
43653
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43634,13 +43660,14 @@ function findCell(editor, key) {
43634
43660
 
43635
43661
 
43636
43662
 
43637
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.table = {
43663
+
43664
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
43638
43665
  splitBlockOnInsertTable: true,
43639
43666
  selectionCellStyle: 'border: 1px double #1e88e5 !important;',
43640
43667
  useExtraClassesOptions: false
43641
43668
  };
43642
- jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_5___default()));
43643
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43669
+ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
43670
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
43644
43671
  data: {
43645
43672
  cols: 10,
43646
43673
  rows: 10,
@@ -43670,19 +43697,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43670
43697
  };
43671
43698
  const form = editor.c.fromHTML('<form class="jodit-form jodit-form__inserter">' + '<div class="jodit-form__table-creator-box">' + '<div class="jodit-form__container"></div>' + '<div class="jodit-form__options">' + generateExtraClasses() + '</div>' + '</div>' + '<label class="jodit-form__center">' + '<span>1</span> &times; <span>1</span>' + '</label>' + '</form>'), rows = form.querySelectorAll('span')[0], cols = form.querySelectorAll('span')[1], blocksContainer = form.querySelector('.jodit-form__container'), options = form.querySelector('.jodit-form__options'), cells = [];
43672
43699
  const cnt = default_rows_count * default_cols_count;
43700
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(blocksContainer, {
43701
+ role: 'grid',
43702
+ ariaLabel: 'Table size',
43703
+ ariaRowcount: default_rows_count,
43704
+ ariaColcount: default_cols_count
43705
+ });
43673
43706
  for(let i = 0; i < cnt; i += 1){
43674
43707
  if (!cells[i]) {
43708
+ const row = Math.floor(i / default_cols_count) + 1, col = i % default_cols_count + 1;
43675
43709
  cells.push(editor.c.element('span', {
43676
- dataIndex: i
43710
+ dataIndex: i,
43711
+ role: 'gridcell',
43712
+ tabindex: i === 0 ? 0 : -1,
43713
+ ariaLabel: `${row} by ${col}`
43677
43714
  }));
43678
43715
  }
43679
43716
  }
43680
- const mouseenter = (e, index)=>{
43681
- const dv = e.target;
43682
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
43683
- return;
43684
- }
43685
- const k = index === undefined || isNaN(index) ? parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10) : index || 0;
43717
+ const highlightCell = (cell)=>{
43718
+ const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
43686
43719
  const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
43687
43720
  for(let i = 0; i < cells.length; i += 1){
43688
43721
  if (cols_count >= i % default_cols_count + 1 && rows_count >= Math.ceil((i + 1) / default_cols_count)) {
@@ -43694,14 +43727,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43694
43727
  cols.textContent = cols_count.toString();
43695
43728
  rows.textContent = rows_count.toString();
43696
43729
  };
43697
- editor.e.on(blocksContainer, 'mousemove', mouseenter).on(blocksContainer, 'touchstart mousedown', (e)=>{
43698
- const dv = e.target;
43699
- e.preventDefault();
43700
- e.stopImmediatePropagation();
43701
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
43702
- return;
43703
- }
43704
- const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10);
43730
+ const insertTable = (cell)=>{
43731
+ const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
43705
43732
  const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
43706
43733
  const crt = editor.createInside, tbody = crt.element('tbody'), table = crt.element('table');
43707
43734
  table.appendChild(tbody);
@@ -43713,7 +43740,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43713
43740
  if (!first_td) {
43714
43741
  first_td = td;
43715
43742
  }
43716
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
43743
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
43717
43744
  td.appendChild(crt.element('br'));
43718
43745
  tr.appendChild(crt.text('\n'));
43719
43746
  tr.appendChild(crt.text('\t'));
@@ -43722,7 +43749,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43722
43749
  tbody.appendChild(crt.text('\n'));
43723
43750
  tbody.appendChild(tr);
43724
43751
  }
43725
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
43752
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
43726
43753
  input.value.split(/[\s]+/).forEach((className)=>{
43727
43754
  table.classList.add(className);
43728
43755
  });
@@ -43731,15 +43758,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43731
43758
  editor.s.removeMarkers();
43732
43759
  editor.editor.normalize();
43733
43760
  editor.history.snapshot.restore(snapshot);
43734
- const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.furthest(editor.s.current(), jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor);
43735
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block)) {
43736
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(block, table, undefined, false, true);
43761
+ const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(editor.s.current(), jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
43762
+ if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
43763
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
43737
43764
  } else {
43738
43765
  if (block) {
43739
43766
  const fake = crt.text('\n');
43740
43767
  if (!editor.o.table.splitBlockOnInsertTable) {
43741
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, fake);
43742
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(fake, table);
43768
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, fake);
43769
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, table);
43743
43770
  } else {
43744
43771
  const range = editor.s.range;
43745
43772
  range.collapse(false);
@@ -43748,9 +43775,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43748
43775
  editor.s.selectRange(range);
43749
43776
  const firstPart = editor.s.splitSelection(block, fake);
43750
43777
  if (firstPart) {
43751
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(firstPart, table);
43778
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(firstPart, table);
43752
43779
  } else {
43753
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, table);
43780
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
43754
43781
  }
43755
43782
  }
43756
43783
  } else {
@@ -43759,13 +43786,68 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43759
43786
  }
43760
43787
  if (first_td) {
43761
43788
  editor.s.setCursorIn(first_td);
43762
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
43789
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
43763
43790
  }
43764
43791
  close();
43792
+ };
43793
+ editor.e.on(blocksContainer, 'mousemove', (e)=>{
43794
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
43795
+ highlightCell(e.target);
43796
+ }
43797
+ }).on(blocksContainer, 'touchstart mousedown', (e)=>{
43798
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
43799
+ return;
43800
+ }
43801
+ e.preventDefault();
43802
+ e.stopImmediatePropagation();
43803
+ insertTable(e.target);
43804
+ }).on(blocksContainer, 'keydown', (e)=>{
43805
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
43806
+ return;
43807
+ }
43808
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER) {
43809
+ e.preventDefault();
43810
+ e.stopImmediatePropagation();
43811
+ insertTable(e.target);
43812
+ return;
43813
+ }
43814
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ESC) {
43815
+ e.preventDefault();
43816
+ e.stopImmediatePropagation();
43817
+ close();
43818
+ return;
43819
+ }
43820
+ const index = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(e.target, '-index') || '0', 10), row = Math.floor(index / default_cols_count), col = index % default_cols_count;
43821
+ let nextIndex = index;
43822
+ switch(e.key){
43823
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
43824
+ nextIndex = col > 0 ? index - 1 : index;
43825
+ break;
43826
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT:
43827
+ nextIndex = col < default_cols_count - 1 ? index + 1 : index;
43828
+ break;
43829
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP:
43830
+ nextIndex = row > 0 ? index - default_cols_count : index;
43831
+ break;
43832
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
43833
+ nextIndex = row < default_rows_count - 1 ? index + default_cols_count : index;
43834
+ break;
43835
+ default:
43836
+ return;
43837
+ }
43838
+ e.preventDefault();
43839
+ e.stopImmediatePropagation();
43840
+ if (nextIndex !== index) {
43841
+ cells[index].tabIndex = -1;
43842
+ cells[nextIndex].tabIndex = 0;
43843
+ cells[nextIndex].focus();
43844
+ highlightCell(cells[nextIndex]);
43845
+ }
43765
43846
  });
43766
43847
  if (button && button.parentElement) {
43767
43848
  for(let i = 0; i < default_rows_count; i += 1){
43768
43849
  const row = editor.c.div();
43850
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(row, 'role', 'row');
43769
43851
  for(let j = 0; j < default_cols_count; j += 1){
43770
43852
  row.appendChild(cells[i * default_cols_count + j]);
43771
43853
  }