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
@@ -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
@@ -23690,27 +23698,28 @@ const instance = (j)=>j.getInstance('Table', j.o);
23690
23698
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
23691
23699
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
23692
23700
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69364);
23693
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
23694
- /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51676);
23695
- /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91672);
23696
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68616);
23697
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(23211);
23698
- /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17312);
23699
- /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91565);
23700
- /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(24497);
23701
- /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62101);
23702
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85932);
23703
- /* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(86878);
23704
- /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57821);
23705
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28712);
23706
- /* 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__);
23707
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7909);
23708
- /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(71125);
23709
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(59400);
23710
- /* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(15982);
23711
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(29434);
23712
- /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(51116);
23713
- /* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(4274);
23701
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81937);
23702
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49574);
23703
+ /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51676);
23704
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91672);
23705
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68616);
23706
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23211);
23707
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(17312);
23708
+ /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91565);
23709
+ /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24497);
23710
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62101);
23711
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(85932);
23712
+ /* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(86878);
23713
+ /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(57821);
23714
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(28712);
23715
+ /* 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__);
23716
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7909);
23717
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(71125);
23718
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(59400);
23719
+ /* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(15982);
23720
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(29434);
23721
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(51116);
23722
+ /* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(4274);
23714
23723
  /*!
23715
23724
  * Jodit Editor (https://xdsoft.net/jodit/)
23716
23725
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -23743,7 +23752,8 @@ const instance = (j)=>j.getInstance('Table', j.o);
23743
23752
 
23744
23753
 
23745
23754
 
23746
- class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButton {
23755
+
23756
+ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButton {
23747
23757
  className() {
23748
23758
  return 'ToolbarButton';
23749
23759
  }
@@ -23754,13 +23764,13 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23754
23764
  super.updateAriaLabel();
23755
23765
  if (this.trigger) {
23756
23766
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
23757
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'aria-label', i8nTooltip);
23767
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-label', i8nTooltip);
23758
23768
  }
23759
23769
  }
23760
23770
  /**
23761
23771
  * Get parent toolbar
23762
23772
  */ get toolbar() {
23763
- const ToolbarCollection = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__.getComponentClass)('ToolbarCollection');
23773
+ const ToolbarCollection = (0,jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.getComponentClass)('ToolbarCollection');
23764
23774
  return this.closest(ToolbarCollection);
23765
23775
  }
23766
23776
  update() {
@@ -23780,7 +23790,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23780
23790
  /**
23781
23791
  * Calculates whether the button is active
23782
23792
  */ __calculateActivatedStatus(tc) {
23783
- if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_10__.isJoditObject)(this.j) && !this.j.editorIsActive) {
23793
+ if ((0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_11__.isJoditObject)(this.j) && !this.j.editorIsActive) {
23784
23794
  return false;
23785
23795
  }
23786
23796
  if (this.control.isActive?.(this.j, this)) {
@@ -23803,11 +23813,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23803
23813
  return Boolean(tc && tc.shouldBeDisabled(this));
23804
23814
  }
23805
23815
  onChangeActivated() {
23806
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'aria-pressed', this.state.activated);
23816
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'aria-pressed', this.state.activated);
23807
23817
  super.onChangeActivated();
23808
23818
  }
23809
23819
  onChangeText() {
23810
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(this.control.template)) {
23820
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(this.control.template)) {
23811
23821
  this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
23812
23822
  } else {
23813
23823
  super.onChangeText();
@@ -23815,7 +23825,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23815
23825
  this.setMod('text-icons', Boolean(this.text.innerText.trim().length));
23816
23826
  }
23817
23827
  onChangeTabIndex() {
23818
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'tabindex', this.state.tabIndex);
23828
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'tabindex', this.state.tabIndex);
23829
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'tabindex', this.state.tabIndex);
23819
23830
  }
23820
23831
  createContainer() {
23821
23832
  const cn = this.componentName;
@@ -23828,7 +23839,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23828
23839
  configurable: true
23829
23840
  });
23830
23841
  container.appendChild(button);
23831
- 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>`);
23842
+ 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>`);
23832
23843
  // For caching
23833
23844
  button.appendChild(trigger);
23834
23845
  return container;
@@ -23840,15 +23851,15 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23840
23851
  if (this.state.hasTrigger) {
23841
23852
  this.container.appendChild(this.trigger);
23842
23853
  } else {
23843
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(this.trigger);
23854
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(this.trigger);
23844
23855
  }
23845
23856
  this.setMod('with-trigger', this.state.hasTrigger || null);
23846
23857
  }
23847
23858
  /** @override */ onChangeDisabled() {
23848
23859
  const disabled = this.state.disabled ? 'disabled' : null;
23849
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'disabled', disabled);
23850
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'disabled', disabled);
23851
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.container, 'disabled', disabled);
23860
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'disabled', disabled);
23861
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.button, 'disabled', disabled);
23862
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.container, 'disabled', disabled);
23852
23863
  }
23853
23864
  /**
23854
23865
  * Init constant data from control
@@ -23858,19 +23869,19 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23858
23869
  state.name = ctr.name;
23859
23870
  this.__initIconFromControl();
23860
23871
  if (ctr.tooltip) {
23861
- state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
23872
+ state.tooltip = (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.tooltip) ? ctr.tooltip(this.j, ctr, this) : ctr.tooltip;
23862
23873
  }
23863
23874
  state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
23864
23875
  }
23865
23876
  __initIconFromControl() {
23866
23877
  const { control: ctr, state } = this;
23867
23878
  const { textIcons } = this.j.o;
23868
- if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
23869
- state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)().icon;
23879
+ if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
23880
+ state.icon = (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)().icon;
23870
23881
  state.text = ctr.text || ctr.name;
23871
23882
  return;
23872
23883
  }
23873
- if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(ctr.icon) && ctr.icon != null) {
23884
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(ctr.icon) && ctr.icon != null) {
23874
23885
  state.icon = {
23875
23886
  name: ctr.icon.name || ctr.name,
23876
23887
  iconURL: ctr.icon.iconURL || '',
@@ -23883,7 +23894,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23883
23894
  state.icon.iconURL = ctr.iconURL;
23884
23895
  } else {
23885
23896
  const name = ctr.icon || ctr.name;
23886
- state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
23897
+ state.icon.name = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_21__.Icon.exists(name) || this.j.o.extraIcons?.[name] ? name : '';
23887
23898
  }
23888
23899
  if (!ctr.iconURL && !state.icon.name) {
23889
23900
  state.text = ctr.text || ctr.name;
@@ -23897,22 +23908,22 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23897
23908
  return;
23898
23909
  }
23899
23910
  const { control: ctr } = this;
23900
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'aria-expanded', true);
23911
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', true);
23901
23912
  e.buffer = {
23902
23913
  actionTrigger: this
23903
23914
  };
23904
23915
  if (ctr.list) {
23905
23916
  return this.__openControlList(ctr);
23906
23917
  }
23907
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.popup)) {
23918
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.popup)) {
23908
23919
  const popup = this.openPopup();
23909
23920
  popup.parentElement = this;
23910
23921
  try {
23911
- 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) {
23922
+ 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) {
23912
23923
  const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
23913
23924
  const elm = ctr.popup(this.j, target, this.__closePopup, this);
23914
23925
  if (elm) {
23915
- 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);
23926
+ 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);
23916
23927
  } else {
23917
23928
  this.__closePopup();
23918
23929
  }
@@ -23925,28 +23936,39 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23925
23936
  * Fired after the popup was opened for some control button
23926
23937
  */ /**
23927
23938
  * Close all opened popups
23928
- */ this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_14__.camelCase)(`after-${ctr.name}-open-popup`), popup.container);
23939
+ */ this.j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_15__.camelCase)(`after-${ctr.name}-open-popup`), popup.container);
23929
23940
  }
23930
23941
  }
23942
+ onTriggerKeyDown(e) {
23943
+ if (this.state.disabled || ![
23944
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_ENTER,
23945
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_SPACE,
23946
+ ' '
23947
+ ].includes(e.key)) {
23948
+ return;
23949
+ }
23950
+ e.preventDefault();
23951
+ this.trigger.click();
23952
+ }
23931
23953
  /**
23932
23954
  * Create an open popup list
23933
23955
  */ __openControlList(control) {
23934
- const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_19__.findControlType)(key, controls);
23956
+ const controls = this.jodit.options.controls ?? {}, getControl = (key)=>(0,jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_20__.findControlType)(key, controls);
23935
23957
  const list = control.list;
23936
23958
  const menu = this.openPopup();
23937
- const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_22__.makeCollection)(this.j);
23959
+ const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
23938
23960
  menu.parentElement = this;
23939
23961
  toolbar.parentElement = menu;
23940
23962
  toolbar.mode = 'vertical';
23941
- const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_11__.isPlainObject)(key) && 'title' in key && 'value' in key;
23963
+ const isListItem = (key)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_12__.isPlainObject)(key) && 'title' in key && 'value' in key;
23942
23964
  const getButton = (key, value)=>{
23943
- if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(value) && getControl(value)) {
23965
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(value) && getControl(value)) {
23944
23966
  return {
23945
23967
  name: value.toString(),
23946
23968
  ...getControl(value)
23947
23969
  };
23948
23970
  }
23949
- if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(key) && getControl(key)) {
23971
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(key) && getControl(key)) {
23950
23972
  return {
23951
23973
  name: key.toString(),
23952
23974
  ...getControl(key),
@@ -23977,26 +23999,26 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23977
23999
  value
23978
24000
  ]
23979
24001
  };
23980
- if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__.isString)(value)) {
24002
+ if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_13__.isString)(value)) {
23981
24003
  childControl.text = value;
23982
24004
  }
23983
24005
  return childControl;
23984
24006
  };
23985
- 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);
23986
- menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_13__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
24007
+ 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);
24008
+ menu.setContent(toolbar).open(()=>(0,jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_14__.position)(this.container), false, this.j.o.allowTabNavigation ? this.container : undefined);
23987
24009
  this.state.activated = true;
23988
24010
  }
23989
24011
  onOutsideClick(e) {
23990
24012
  if (!this.openedPopup) {
23991
24013
  return;
23992
24014
  }
23993
- 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)) {
24015
+ 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)) {
23994
24016
  this.__closePopup();
23995
24017
  }
23996
24018
  }
23997
24019
  openPopup() {
23998
24020
  this.__closePopup();
23999
- this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_21__.Popup(this.j, false);
24021
+ this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__.Popup(this.j, false);
24000
24022
  this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick);
24001
24023
  return this.openedPopup;
24002
24024
  }
@@ -24008,7 +24030,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24008
24030
  this.openedPopup.destruct();
24009
24031
  this.openedPopup = null;
24010
24032
  if (this.trigger) {
24011
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'aria-expanded', false);
24033
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', false);
24012
24034
  }
24013
24035
  }
24014
24036
  }
@@ -24016,7 +24038,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24016
24038
  * Click handler
24017
24039
  */ onClick(originalEvent) {
24018
24040
  const { control: ctr } = this;
24019
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.exec)) {
24041
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.exec)) {
24020
24042
  const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
24021
24043
  const result = ctr.exec(this.j, target, {
24022
24044
  control: ctr,
@@ -24040,11 +24062,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24040
24062
  if (ctr.list) {
24041
24063
  return this.__openControlList(ctr);
24042
24064
  }
24043
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(ctr.popup)) {
24065
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(ctr.popup)) {
24044
24066
  return this.onTriggerClick(originalEvent);
24045
24067
  }
24046
24068
  if (ctr.command || ctr.name) {
24047
- (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]);
24069
+ (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]);
24048
24070
  this.j.e.fire('closeAllPopups');
24049
24071
  }
24050
24072
  }
@@ -24054,20 +24076,20 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24054
24076
  }
24055
24077
  constructor(jodit, control, target = null){
24056
24078
  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 = {
24057
- ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)(),
24079
+ ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)(),
24058
24080
  theme: 'toolbar',
24059
24081
  currentValue: '',
24060
24082
  hasTrigger: false
24061
24083
  }, this.openedPopup = null;
24062
24084
  const button = this.getElm('button');
24063
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__.assert)(button, 'Element button should exists');
24085
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(button, 'Element button should exists');
24064
24086
  this.button = button;
24065
24087
  Object.defineProperty(button, 'component', {
24066
24088
  value: this,
24067
24089
  configurable: true
24068
24090
  });
24069
24091
  const trigger = this.getElm('trigger');
24070
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__.assert)(trigger, 'Element trigger should exists');
24092
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_16__.assert)(trigger, 'Element trigger should exists');
24071
24093
  this.trigger = trigger;
24072
24094
  trigger.remove();
24073
24095
  // Prevent lost focus
@@ -24088,24 +24110,27 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24088
24110
  }
24089
24111
  }
24090
24112
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24091
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__.cacheHTML
24113
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__.cacheHTML
24092
24114
  ], ToolbarButton.prototype, "createContainer", null);
24093
24115
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24094
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__.watch)('state.hasTrigger', {
24116
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('state.hasTrigger', {
24095
24117
  immediately: false
24096
24118
  })
24097
24119
  ], ToolbarButton.prototype, "onChangeHasTrigger", null);
24098
24120
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24099
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__.watch)('trigger:click')
24121
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:click')
24100
24122
  ], ToolbarButton.prototype, "onTriggerClick", null);
24101
24123
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24102
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
24124
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:keydown')
24125
+ ], ToolbarButton.prototype, "onTriggerKeyDown", null);
24126
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24127
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24103
24128
  ], ToolbarButton.prototype, "onOutsideClick", null);
24104
24129
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24105
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
24130
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24106
24131
  ], ToolbarButton.prototype, "__closePopup", null);
24107
24132
  ToolbarButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24108
- jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__.component
24133
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.component
24109
24134
  ], ToolbarButton);
24110
24135
 
24111
24136
 
@@ -42110,13 +42135,14 @@ function findCell(editor, key) {
42110
42135
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
42111
42136
 
42112
42137
  "use strict";
42113
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
42114
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
42115
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93640);
42116
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29434);
42117
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
42118
- /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67447);
42119
- /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_5__);
42138
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
42139
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
42140
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
42141
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
42142
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
42143
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
42144
+ /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67447);
42145
+ /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_6__);
42120
42146
  /*!
42121
42147
  * Jodit Editor (https://xdsoft.net/jodit/)
42122
42148
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -42129,13 +42155,14 @@ function findCell(editor, key) {
42129
42155
 
42130
42156
 
42131
42157
 
42132
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.table = {
42158
+
42159
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
42133
42160
  splitBlockOnInsertTable: true,
42134
42161
  selectionCellStyle: 'border: 1px double #1e88e5 !important;',
42135
42162
  useExtraClassesOptions: false
42136
42163
  };
42137
- jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_5___default()));
42138
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42164
+ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
42165
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
42139
42166
  data: {
42140
42167
  cols: 10,
42141
42168
  rows: 10,
@@ -42165,19 +42192,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42165
42192
  };
42166
42193
  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 = [];
42167
42194
  const cnt = default_rows_count * default_cols_count;
42195
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(blocksContainer, {
42196
+ role: 'grid',
42197
+ ariaLabel: 'Table size',
42198
+ ariaRowcount: default_rows_count,
42199
+ ariaColcount: default_cols_count
42200
+ });
42168
42201
  for(let i = 0; i < cnt; i += 1){
42169
42202
  if (!cells[i]) {
42203
+ const row = Math.floor(i / default_cols_count) + 1, col = i % default_cols_count + 1;
42170
42204
  cells.push(editor.c.element('span', {
42171
- dataIndex: i
42205
+ dataIndex: i,
42206
+ role: 'gridcell',
42207
+ tabindex: i === 0 ? 0 : -1,
42208
+ ariaLabel: `${row} by ${col}`
42172
42209
  }));
42173
42210
  }
42174
42211
  }
42175
- const mouseenter = (e, index)=>{
42176
- const dv = e.target;
42177
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
42178
- return;
42179
- }
42180
- const k = index === undefined || isNaN(index) ? parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10) : index || 0;
42212
+ const highlightCell = (cell)=>{
42213
+ const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
42181
42214
  const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
42182
42215
  for(let i = 0; i < cells.length; i += 1){
42183
42216
  if (cols_count >= i % default_cols_count + 1 && rows_count >= Math.ceil((i + 1) / default_cols_count)) {
@@ -42189,14 +42222,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42189
42222
  cols.textContent = cols_count.toString();
42190
42223
  rows.textContent = rows_count.toString();
42191
42224
  };
42192
- editor.e.on(blocksContainer, 'mousemove', mouseenter).on(blocksContainer, 'touchstart mousedown', (e)=>{
42193
- const dv = e.target;
42194
- e.preventDefault();
42195
- e.stopImmediatePropagation();
42196
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
42197
- return;
42198
- }
42199
- const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10);
42225
+ const insertTable = (cell)=>{
42226
+ const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
42200
42227
  const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
42201
42228
  const crt = editor.createInside, tbody = crt.element('tbody'), table = crt.element('table');
42202
42229
  table.appendChild(tbody);
@@ -42208,7 +42235,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42208
42235
  if (!first_td) {
42209
42236
  first_td = td;
42210
42237
  }
42211
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
42238
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
42212
42239
  td.appendChild(crt.element('br'));
42213
42240
  tr.appendChild(crt.text('\n'));
42214
42241
  tr.appendChild(crt.text('\t'));
@@ -42217,7 +42244,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42217
42244
  tbody.appendChild(crt.text('\n'));
42218
42245
  tbody.appendChild(tr);
42219
42246
  }
42220
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
42247
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
42221
42248
  input.value.split(/[\s]+/).forEach((className)=>{
42222
42249
  table.classList.add(className);
42223
42250
  });
@@ -42226,15 +42253,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42226
42253
  editor.s.removeMarkers();
42227
42254
  editor.editor.normalize();
42228
42255
  editor.history.snapshot.restore(snapshot);
42229
- 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);
42230
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block)) {
42231
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(block, table, undefined, false, true);
42256
+ 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);
42257
+ if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
42258
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
42232
42259
  } else {
42233
42260
  if (block) {
42234
42261
  const fake = crt.text('\n');
42235
42262
  if (!editor.o.table.splitBlockOnInsertTable) {
42236
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, fake);
42237
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(fake, table);
42263
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, fake);
42264
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, table);
42238
42265
  } else {
42239
42266
  const range = editor.s.range;
42240
42267
  range.collapse(false);
@@ -42243,9 +42270,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42243
42270
  editor.s.selectRange(range);
42244
42271
  const firstPart = editor.s.splitSelection(block, fake);
42245
42272
  if (firstPart) {
42246
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(firstPart, table);
42273
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(firstPart, table);
42247
42274
  } else {
42248
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, table);
42275
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
42249
42276
  }
42250
42277
  }
42251
42278
  } else {
@@ -42254,13 +42281,68 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
42254
42281
  }
42255
42282
  if (first_td) {
42256
42283
  editor.s.setCursorIn(first_td);
42257
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
42284
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
42258
42285
  }
42259
42286
  close();
42287
+ };
42288
+ editor.e.on(blocksContainer, 'mousemove', (e)=>{
42289
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
42290
+ highlightCell(e.target);
42291
+ }
42292
+ }).on(blocksContainer, 'touchstart mousedown', (e)=>{
42293
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
42294
+ return;
42295
+ }
42296
+ e.preventDefault();
42297
+ e.stopImmediatePropagation();
42298
+ insertTable(e.target);
42299
+ }).on(blocksContainer, 'keydown', (e)=>{
42300
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
42301
+ return;
42302
+ }
42303
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER) {
42304
+ e.preventDefault();
42305
+ e.stopImmediatePropagation();
42306
+ insertTable(e.target);
42307
+ return;
42308
+ }
42309
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ESC) {
42310
+ e.preventDefault();
42311
+ e.stopImmediatePropagation();
42312
+ close();
42313
+ return;
42314
+ }
42315
+ 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;
42316
+ let nextIndex = index;
42317
+ switch(e.key){
42318
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
42319
+ nextIndex = col > 0 ? index - 1 : index;
42320
+ break;
42321
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT:
42322
+ nextIndex = col < default_cols_count - 1 ? index + 1 : index;
42323
+ break;
42324
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP:
42325
+ nextIndex = row > 0 ? index - default_cols_count : index;
42326
+ break;
42327
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
42328
+ nextIndex = row < default_rows_count - 1 ? index + default_cols_count : index;
42329
+ break;
42330
+ default:
42331
+ return;
42332
+ }
42333
+ e.preventDefault();
42334
+ e.stopImmediatePropagation();
42335
+ if (nextIndex !== index) {
42336
+ cells[index].tabIndex = -1;
42337
+ cells[nextIndex].tabIndex = 0;
42338
+ cells[nextIndex].focus();
42339
+ highlightCell(cells[nextIndex]);
42340
+ }
42260
42341
  });
42261
42342
  if (button && button.parentElement) {
42262
42343
  for(let i = 0; i < default_rows_count; i += 1){
42263
42344
  const row = editor.c.div();
42345
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(row, 'role', 'row');
42264
42346
  for(let j = 0; j < default_cols_count; j += 1){
42265
42347
  row.appendChild(cells[i * default_cols_count + j]);
42266
42348
  }