jodit 4.13.18 → 4.13.20

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 (56) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +205 -115
  5. package/es2015/jodit.min.js +9 -9
  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 +5 -5
  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 +201 -111
  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 +201 -111
  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 +501 -407
  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/modules/toolbar/button/button.d.ts +1 -0
  52. package/esm/modules/toolbar/button/button.js +13 -0
  53. package/esm/plugins/search/ui/search.js +24 -4
  54. package/esm/plugins/table/config.js +79 -19
  55. package/package.json +1 -1
  56. 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.18
4
+ * Version: v4.13.20
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.18";
1846
+ */ const APP_VERSION = "4.13.20";
1847
1847
  // prettier-ignore
1848
1848
  const ES = "es2021";
1849
1849
  const IS_ES_MODERN = true;
@@ -23721,27 +23721,28 @@ const instance = (j)=>j.getInstance('Table', j.o);
23721
23721
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
23722
23722
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
23723
23723
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69364);
23724
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
23725
- /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51676);
23726
- /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91672);
23727
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68616);
23728
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(23211);
23729
- /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17312);
23730
- /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91565);
23731
- /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(24497);
23732
- /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62101);
23733
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(85932);
23734
- /* harmony import */ var jodit_core_helpers_size__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(86878);
23735
- /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57821);
23736
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28712);
23737
- /* 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__);
23738
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(7909);
23739
- /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(71125);
23740
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(59400);
23741
- /* harmony import */ var jodit_core_ui_helpers_get_control_type__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(15982);
23742
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(29434);
23743
- /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(51116);
23744
- /* 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);
23745
23746
  /*!
23746
23747
  * Jodit Editor (https://xdsoft.net/jodit/)
23747
23748
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -23774,7 +23775,8 @@ const instance = (j)=>j.getInstance('Table', j.o);
23774
23775
 
23775
23776
 
23776
23777
 
23777
- 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 {
23778
23780
  className() {
23779
23781
  return 'ToolbarButton';
23780
23782
  }
@@ -23785,13 +23787,13 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23785
23787
  super.updateAriaLabel();
23786
23788
  if (this.trigger) {
23787
23789
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
23788
- (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);
23789
23791
  }
23790
23792
  }
23791
23793
  /**
23792
23794
  * Get parent toolbar
23793
23795
  */ get toolbar() {
23794
- 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');
23795
23797
  return this.closest(ToolbarCollection);
23796
23798
  }
23797
23799
  update() {
@@ -23811,7 +23813,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23811
23813
  /**
23812
23814
  * Calculates whether the button is active
23813
23815
  */ __calculateActivatedStatus(tc) {
23814
- 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) {
23815
23817
  return false;
23816
23818
  }
23817
23819
  if (this.control.isActive?.(this.j, this)) {
@@ -23834,11 +23836,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23834
23836
  return Boolean(tc && tc.shouldBeDisabled(this));
23835
23837
  }
23836
23838
  onChangeActivated() {
23837
- (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);
23838
23840
  super.onChangeActivated();
23839
23841
  }
23840
23842
  onChangeText() {
23841
- 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)) {
23842
23844
  this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
23843
23845
  } else {
23844
23846
  super.onChangeText();
@@ -23846,7 +23848,8 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23846
23848
  this.setMod('text-icons', Boolean(this.text.innerText.trim().length));
23847
23849
  }
23848
23850
  onChangeTabIndex() {
23849
- (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);
23850
23853
  }
23851
23854
  createContainer() {
23852
23855
  const cn = this.componentName;
@@ -23859,7 +23862,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23859
23862
  configurable: true
23860
23863
  });
23861
23864
  container.appendChild(button);
23862
- 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>`);
23863
23866
  // For caching
23864
23867
  button.appendChild(trigger);
23865
23868
  return container;
@@ -23871,15 +23874,15 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23871
23874
  if (this.state.hasTrigger) {
23872
23875
  this.container.appendChild(this.trigger);
23873
23876
  } else {
23874
- 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);
23875
23878
  }
23876
23879
  this.setMod('with-trigger', this.state.hasTrigger || null);
23877
23880
  }
23878
23881
  /** @override */ onChangeDisabled() {
23879
23882
  const disabled = this.state.disabled ? 'disabled' : null;
23880
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.trigger, 'disabled', disabled);
23881
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_16__.attr)(this.button, 'disabled', disabled);
23882
- (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);
23883
23886
  }
23884
23887
  /**
23885
23888
  * Init constant data from control
@@ -23889,19 +23892,19 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23889
23892
  state.name = ctr.name;
23890
23893
  this.__initIconFromControl();
23891
23894
  if (ctr.tooltip) {
23892
- 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;
23893
23896
  }
23894
23897
  state.hasTrigger = Boolean(ctr.list || ctr.popup && ctr.exec);
23895
23898
  }
23896
23899
  __initIconFromControl() {
23897
23900
  const { control: ctr, state } = this;
23898
23901
  const { textIcons } = this.j.o;
23899
- if (textIcons === true || (0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_9__.isFunction)(textIcons) && textIcons(ctr.name) || ctr.template) {
23900
- 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;
23901
23904
  state.text = ctr.text || ctr.name;
23902
23905
  return;
23903
23906
  }
23904
- 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) {
23905
23908
  state.icon = {
23906
23909
  name: ctr.icon.name || ctr.name,
23907
23910
  iconURL: ctr.icon.iconURL || '',
@@ -23914,7 +23917,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23914
23917
  state.icon.iconURL = ctr.iconURL;
23915
23918
  } else {
23916
23919
  const name = ctr.icon || ctr.name;
23917
- 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 : '';
23918
23921
  }
23919
23922
  if (!ctr.iconURL && !state.icon.name) {
23920
23923
  state.text = ctr.text || ctr.name;
@@ -23928,22 +23931,22 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23928
23931
  return;
23929
23932
  }
23930
23933
  const { control: ctr } = this;
23931
- (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);
23932
23935
  e.buffer = {
23933
23936
  actionTrigger: this
23934
23937
  };
23935
23938
  if (ctr.list) {
23936
23939
  return this.__openControlList(ctr);
23937
23940
  }
23938
- 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)) {
23939
23942
  const popup = this.openPopup();
23940
23943
  popup.parentElement = this;
23941
23944
  try {
23942
- 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) {
23943
23946
  const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
23944
23947
  const elm = ctr.popup(this.j, target, this.__closePopup, this);
23945
23948
  if (elm) {
23946
- 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);
23947
23950
  } else {
23948
23951
  this.__closePopup();
23949
23952
  }
@@ -23956,28 +23959,39 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
23956
23959
  * Fired after the popup was opened for some control button
23957
23960
  */ /**
23958
23961
  * Close all opened popups
23959
- */ 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);
23963
+ }
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;
23960
23972
  }
23973
+ e.preventDefault();
23974
+ this.trigger.click();
23961
23975
  }
23962
23976
  /**
23963
23977
  * Create an open popup list
23964
23978
  */ __openControlList(control) {
23965
- 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);
23966
23980
  const list = control.list;
23967
23981
  const menu = this.openPopup();
23968
- const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_22__.makeCollection)(this.j);
23982
+ const toolbar = (0,_factory__WEBPACK_IMPORTED_MODULE_23__.makeCollection)(this.j);
23969
23983
  menu.parentElement = this;
23970
23984
  toolbar.parentElement = menu;
23971
23985
  toolbar.mode = 'vertical';
23972
- 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;
23973
23987
  const getButton = (key, value)=>{
23974
- 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)) {
23975
23989
  return {
23976
23990
  name: value.toString(),
23977
23991
  ...getControl(value)
23978
23992
  };
23979
23993
  }
23980
- 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)) {
23981
23995
  return {
23982
23996
  name: key.toString(),
23983
23997
  ...getControl(key),
@@ -24008,26 +24022,26 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24008
24022
  value
24009
24023
  ]
24010
24024
  };
24011
- 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)) {
24012
24026
  childControl.text = value;
24013
24027
  }
24014
24028
  return childControl;
24015
24029
  };
24016
- 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);
24017
- 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);
24018
24032
  this.state.activated = true;
24019
24033
  }
24020
24034
  onOutsideClick(e) {
24021
24035
  if (!this.openedPopup) {
24022
24036
  return;
24023
24037
  }
24024
- 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)) {
24025
24039
  this.__closePopup();
24026
24040
  }
24027
24041
  }
24028
24042
  openPopup() {
24029
24043
  this.__closePopup();
24030
- 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);
24031
24045
  this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick);
24032
24046
  return this.openedPopup;
24033
24047
  }
@@ -24039,7 +24053,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24039
24053
  this.openedPopup.destruct();
24040
24054
  this.openedPopup = null;
24041
24055
  if (this.trigger) {
24042
- (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);
24043
24057
  }
24044
24058
  }
24045
24059
  }
@@ -24047,7 +24061,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24047
24061
  * Click handler
24048
24062
  */ onClick(originalEvent) {
24049
24063
  const { control: ctr } = this;
24050
- 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)) {
24051
24065
  const target = this.toolbar?.getTarget(this) ?? this.target ?? null;
24052
24066
  const result = ctr.exec(this.j, target, {
24053
24067
  control: ctr,
@@ -24071,11 +24085,11 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24071
24085
  if (ctr.list) {
24072
24086
  return this.__openControlList(ctr);
24073
24087
  }
24074
- 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)) {
24075
24089
  return this.onTriggerClick(originalEvent);
24076
24090
  }
24077
24091
  if (ctr.command || ctr.name) {
24078
- (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]);
24079
24093
  this.j.e.fire('closeAllPopups');
24080
24094
  }
24081
24095
  }
@@ -24085,20 +24099,20 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24085
24099
  }
24086
24100
  constructor(jodit, control, target = null){
24087
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 = {
24088
- ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.UIButtonState)(),
24102
+ ...(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButtonState)(),
24089
24103
  theme: 'toolbar',
24090
24104
  currentValue: '',
24091
24105
  hasTrigger: false
24092
24106
  }, this.openedPopup = null;
24093
24107
  const button = this.getElm('button');
24094
- (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');
24095
24109
  this.button = button;
24096
24110
  Object.defineProperty(button, 'component', {
24097
24111
  value: this,
24098
24112
  configurable: true
24099
24113
  });
24100
24114
  const trigger = this.getElm('trigger');
24101
- (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');
24102
24116
  this.trigger = trigger;
24103
24117
  trigger.remove();
24104
24118
  // Prevent lost focus
@@ -24119,24 +24133,27 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_18__.U
24119
24133
  }
24120
24134
  }
24121
24135
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24122
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__.cacheHTML
24136
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__.cacheHTML
24123
24137
  ], ToolbarButton.prototype, "createContainer", null);
24124
24138
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24125
- (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', {
24126
24140
  immediately: false
24127
24141
  })
24128
24142
  ], ToolbarButton.prototype, "onChangeHasTrigger", null);
24129
24143
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24130
- (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')
24131
24145
  ], ToolbarButton.prototype, "onTriggerClick", null);
24132
24146
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24133
- 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
24134
24151
  ], ToolbarButton.prototype, "onOutsideClick", null);
24135
24152
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24136
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
24153
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24137
24154
  ], ToolbarButton.prototype, "__closePopup", null);
24138
24155
  ToolbarButton = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24139
- jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_5__.component
24156
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__.component
24140
24157
  ], ToolbarButton);
24141
24158
 
24142
24159
 
@@ -39958,10 +39975,26 @@ class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIElement {
39958
39975
  this.replaceButton = replaceBtn;
39959
39976
  this.currentBox = current;
39960
39977
  this.countBox = count;
39978
+ const closeAction = ()=>this.close();
39979
+ const replaceAction = ()=>void jodit.e.fire(this, 'pressReplaceButton');
39980
+ const nextAction = ()=>void jodit.e.fire('searchNext');
39981
+ const prevAction = ()=>void jodit.e.fire('searchPrevious');
39982
+ // Pointer activation is handled on `pointerdown` (returning `false`
39983
+ // there keeps the focus and selection intact), but activating a
39984
+ // native button from the keyboard (Enter/Space) fires only `click`
39985
+ // with `detail === 0` — handle that path separately. Pointer clicks
39986
+ // arrive with `detail >= 1`, so the action does not run twice.
39987
+ // See https://github.com/xdan/jodit/issues/1440
39988
+ const onKeyboardActivate = (action)=>(e)=>{
39989
+ if (!e.detail) {
39990
+ e.preventDefault();
39991
+ action();
39992
+ }
39993
+ };
39961
39994
  jodit.e.on(this.closeButton, 'pointerdown', ()=>{
39962
- this.close();
39995
+ closeAction();
39963
39996
  return false;
39964
- }).on(this.queryInput, 'input', ()=>{
39997
+ }).on(this.closeButton, 'click', onKeyboardActivate(closeAction)).on(this.queryInput, 'input', ()=>{
39965
39998
  this.currentIndex = 0;
39966
39999
  }).on(this.queryInput, 'pointerdown', ()=>{
39967
40000
  if (jodit.s.isFocused()) {
@@ -39969,15 +40002,15 @@ class UISearch extends jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIElement {
39969
40002
  this.selInfo = jodit.s.save();
39970
40003
  }
39971
40004
  }).on(this.replaceButton, 'pointerdown', ()=>{
39972
- jodit.e.fire(this, 'pressReplaceButton');
40005
+ replaceAction();
39973
40006
  return false;
39974
- }).on(next, 'pointerdown', ()=>{
39975
- void jodit.e.fire('searchNext');
40007
+ }).on(this.replaceButton, 'click', onKeyboardActivate(replaceAction)).on(next, 'pointerdown', ()=>{
40008
+ nextAction();
39976
40009
  return false;
39977
- }).on(prev, 'pointerdown', ()=>{
39978
- jodit.e.fire('searchPrevious');
40010
+ }).on(next, 'click', onKeyboardActivate(nextAction)).on(prev, 'pointerdown', ()=>{
40011
+ prevAction();
39979
40012
  return false;
39980
- }).on(this.queryInput, 'input', ()=>{
40013
+ }).on(prev, 'click', onKeyboardActivate(prevAction)).on(this.queryInput, 'input', ()=>{
39981
40014
  this.setMod('empty-query', !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.trim)(this.queryInput.value).length);
39982
40015
  }).on(this.queryInput, 'keydown', (()=>{
39983
40016
  const debounced = this.j.async.debounce(async (e)=>{
@@ -43623,13 +43656,14 @@ function findCell(editor, key) {
43623
43656
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
43624
43657
 
43625
43658
  "use strict";
43626
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
43627
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
43628
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93640);
43629
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29434);
43630
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
43631
- /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67447);
43632
- /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_5__);
43659
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
43660
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
43661
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
43662
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(93640);
43663
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
43664
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
43665
+ /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67447);
43666
+ /* harmony import */ var _table_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_table_svg__WEBPACK_IMPORTED_MODULE_6__);
43633
43667
  /*!
43634
43668
  * Jodit Editor (https://xdsoft.net/jodit/)
43635
43669
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43642,13 +43676,14 @@ function findCell(editor, key) {
43642
43676
 
43643
43677
 
43644
43678
 
43645
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.table = {
43679
+
43680
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
43646
43681
  splitBlockOnInsertTable: true,
43647
43682
  selectionCellStyle: 'border: 1px double #1e88e5 !important;',
43648
43683
  useExtraClassesOptions: false
43649
43684
  };
43650
- jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_5___default()));
43651
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43685
+ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
43686
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
43652
43687
  data: {
43653
43688
  cols: 10,
43654
43689
  rows: 10,
@@ -43678,19 +43713,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43678
43713
  };
43679
43714
  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 = [];
43680
43715
  const cnt = default_rows_count * default_cols_count;
43716
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(blocksContainer, {
43717
+ role: 'grid',
43718
+ ariaLabel: 'Table size',
43719
+ ariaRowcount: default_rows_count,
43720
+ ariaColcount: default_cols_count
43721
+ });
43681
43722
  for(let i = 0; i < cnt; i += 1){
43682
43723
  if (!cells[i]) {
43724
+ const row = Math.floor(i / default_cols_count) + 1, col = i % default_cols_count + 1;
43683
43725
  cells.push(editor.c.element('span', {
43684
- dataIndex: i
43726
+ dataIndex: i,
43727
+ role: 'gridcell',
43728
+ tabindex: i === 0 ? 0 : -1,
43729
+ ariaLabel: `${row} by ${col}`
43685
43730
  }));
43686
43731
  }
43687
43732
  }
43688
- const mouseenter = (e, index)=>{
43689
- const dv = e.target;
43690
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
43691
- return;
43692
- }
43693
- const k = index === undefined || isNaN(index) ? parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10) : index || 0;
43733
+ const highlightCell = (cell)=>{
43734
+ const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
43694
43735
  const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
43695
43736
  for(let i = 0; i < cells.length; i += 1){
43696
43737
  if (cols_count >= i % default_cols_count + 1 && rows_count >= Math.ceil((i + 1) / default_cols_count)) {
@@ -43702,14 +43743,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43702
43743
  cols.textContent = cols_count.toString();
43703
43744
  rows.textContent = rows_count.toString();
43704
43745
  };
43705
- editor.e.on(blocksContainer, 'mousemove', mouseenter).on(blocksContainer, 'touchstart mousedown', (e)=>{
43706
- const dv = e.target;
43707
- e.preventDefault();
43708
- e.stopImmediatePropagation();
43709
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(dv, 'span')) {
43710
- return;
43711
- }
43712
- const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.attr)(dv, '-index') || '0', 10);
43746
+ const insertTable = (cell)=>{
43747
+ const k = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(cell, '-index') || '0', 10);
43713
43748
  const rows_count = Math.ceil((k + 1) / default_cols_count), cols_count = k % default_cols_count + 1;
43714
43749
  const crt = editor.createInside, tbody = crt.element('tbody'), table = crt.element('table');
43715
43750
  table.appendChild(tbody);
@@ -43721,7 +43756,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43721
43756
  if (!first_td) {
43722
43757
  first_td = td;
43723
43758
  }
43724
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
43759
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.css)(td, 'width', (100 / cols_count).toFixed(4) + '%');
43725
43760
  td.appendChild(crt.element('br'));
43726
43761
  tr.appendChild(crt.text('\n'));
43727
43762
  tr.appendChild(crt.text('\t'));
@@ -43730,7 +43765,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43730
43765
  tbody.appendChild(crt.text('\n'));
43731
43766
  tbody.appendChild(tr);
43732
43767
  }
43733
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
43768
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('input[type=checkbox]:checked', options).forEach((input)=>{
43734
43769
  input.value.split(/[\s]+/).forEach((className)=>{
43735
43770
  table.classList.add(className);
43736
43771
  });
@@ -43739,15 +43774,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43739
43774
  editor.s.removeMarkers();
43740
43775
  editor.editor.normalize();
43741
43776
  editor.history.snapshot.restore(snapshot);
43742
- 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);
43743
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block)) {
43744
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(block, table, undefined, false, true);
43777
+ 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);
43778
+ if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
43779
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
43745
43780
  } else {
43746
43781
  if (block) {
43747
43782
  const fake = crt.text('\n');
43748
43783
  if (!editor.o.table.splitBlockOnInsertTable) {
43749
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, fake);
43750
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(fake, table);
43784
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, fake);
43785
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, table);
43751
43786
  } else {
43752
43787
  const range = editor.s.range;
43753
43788
  range.collapse(false);
@@ -43756,9 +43791,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43756
43791
  editor.s.selectRange(range);
43757
43792
  const firstPart = editor.s.splitSelection(block, fake);
43758
43793
  if (firstPart) {
43759
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(firstPart, table);
43794
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(firstPart, table);
43760
43795
  } else {
43761
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, table);
43796
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
43762
43797
  }
43763
43798
  }
43764
43799
  } else {
@@ -43767,13 +43802,68 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.table = {
43767
43802
  }
43768
43803
  if (first_td) {
43769
43804
  editor.s.setCursorIn(first_td);
43770
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
43805
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.scrollIntoViewIfNeeded)(first_td, editor.editor, editor.ed);
43771
43806
  }
43772
43807
  close();
43808
+ };
43809
+ editor.e.on(blocksContainer, 'mousemove', (e)=>{
43810
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
43811
+ highlightCell(e.target);
43812
+ }
43813
+ }).on(blocksContainer, 'touchstart mousedown', (e)=>{
43814
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
43815
+ return;
43816
+ }
43817
+ e.preventDefault();
43818
+ e.stopImmediatePropagation();
43819
+ insertTable(e.target);
43820
+ }).on(blocksContainer, 'keydown', (e)=>{
43821
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, 'span')) {
43822
+ return;
43823
+ }
43824
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER) {
43825
+ e.preventDefault();
43826
+ e.stopImmediatePropagation();
43827
+ insertTable(e.target);
43828
+ return;
43829
+ }
43830
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_ESC) {
43831
+ e.preventDefault();
43832
+ e.stopImmediatePropagation();
43833
+ close();
43834
+ return;
43835
+ }
43836
+ 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;
43837
+ let nextIndex = index;
43838
+ switch(e.key){
43839
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
43840
+ nextIndex = col > 0 ? index - 1 : index;
43841
+ break;
43842
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT:
43843
+ nextIndex = col < default_cols_count - 1 ? index + 1 : index;
43844
+ break;
43845
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP:
43846
+ nextIndex = row > 0 ? index - default_cols_count : index;
43847
+ break;
43848
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
43849
+ nextIndex = row < default_rows_count - 1 ? index + default_cols_count : index;
43850
+ break;
43851
+ default:
43852
+ return;
43853
+ }
43854
+ e.preventDefault();
43855
+ e.stopImmediatePropagation();
43856
+ if (nextIndex !== index) {
43857
+ cells[index].tabIndex = -1;
43858
+ cells[nextIndex].tabIndex = 0;
43859
+ cells[nextIndex].focus();
43860
+ highlightCell(cells[nextIndex]);
43861
+ }
43773
43862
  });
43774
43863
  if (button && button.parentElement) {
43775
43864
  for(let i = 0; i < default_rows_count; i += 1){
43776
43865
  const row = editor.c.div();
43866
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(row, 'role', 'row');
43777
43867
  for(let j = 0; j < default_cols_count; j += 1){
43778
43868
  row.appendChild(cells[i * default_cols_count + j]);
43779
43869
  }