jodit 4.15.9 → 4.15.13

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 (77) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +7 -0
  3. package/es2015/jodit.css +21 -1
  4. package/es2015/jodit.fat.min.css +1 -1
  5. package/es2015/jodit.fat.min.js +7 -7
  6. package/es2015/jodit.js +250 -9
  7. package/es2015/jodit.min.css +1 -1
  8. package/es2015/jodit.min.js +5 -5
  9. package/es2015/plugins/debug/debug.css +1 -1
  10. package/es2015/plugins/debug/debug.js +1 -1
  11. package/es2015/plugins/debug/debug.min.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  14. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  15. package/es2018/jodit.fat.min.css +1 -1
  16. package/es2018/jodit.fat.min.js +5 -5
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +5 -5
  19. package/es2018/plugins/debug/debug.min.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  21. package/es2021/jodit.css +21 -1
  22. package/es2021/jodit.fat.min.css +1 -1
  23. package/es2021/jodit.fat.min.js +6 -6
  24. package/es2021/jodit.js +249 -9
  25. package/es2021/jodit.min.css +1 -1
  26. package/es2021/jodit.min.js +6 -6
  27. package/es2021/plugins/debug/debug.css +1 -1
  28. package/es2021/plugins/debug/debug.js +1 -1
  29. package/es2021/plugins/debug/debug.min.js +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  33. package/es2021.en/jodit.css +21 -1
  34. package/es2021.en/jodit.fat.min.css +1 -1
  35. package/es2021.en/jodit.fat.min.js +11 -11
  36. package/es2021.en/jodit.js +249 -9
  37. package/es2021.en/jodit.min.css +1 -1
  38. package/es2021.en/jodit.min.js +10 -10
  39. package/es2021.en/plugins/debug/debug.css +1 -1
  40. package/es2021.en/plugins/debug/debug.js +1 -1
  41. package/es2021.en/plugins/debug/debug.min.js +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  45. package/es5/jodit.css +22 -2
  46. package/es5/jodit.fat.min.css +1 -1
  47. package/es5/jodit.fat.min.js +2 -2
  48. package/es5/jodit.js +307 -9
  49. package/es5/jodit.min.css +3 -3
  50. package/es5/jodit.min.js +2 -2
  51. package/es5/plugins/debug/debug.css +1 -1
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/es5/polyfills.fat.min.js +1 -1
  58. package/es5/polyfills.js +1 -1
  59. package/es5/polyfills.min.js +1 -1
  60. package/esm/core/constants.d.ts +2 -0
  61. package/esm/core/constants.js +3 -1
  62. package/esm/core/selection/selection.d.ts +11 -0
  63. package/esm/core/selection/selection.js +24 -1
  64. package/esm/modules/toolbar/button/button.d.ts +14 -0
  65. package/esm/modules/toolbar/button/button.js +102 -4
  66. package/esm/plugins/all.d.ts +1 -0
  67. package/esm/plugins/all.js +1 -0
  68. package/esm/plugins/index.d.ts +1 -0
  69. package/esm/plugins/index.js +1 -0
  70. package/esm/plugins/toolbar-navigation/toolbar-navigation.d.ts +42 -0
  71. package/esm/plugins/toolbar-navigation/toolbar-navigation.js +113 -0
  72. package/package.json +1 -1
  73. package/types/core/constants.d.ts +2 -0
  74. package/types/core/selection/selection.d.ts +11 -0
  75. package/types/modules/toolbar/button/button.d.ts +14 -0
  76. package/types/plugins/index.d.ts +1 -0
  77. package/types/plugins/toolbar-navigation/toolbar-navigation.d.ts +42 -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.15.9
4
+ * Version: v4.15.13
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1779,7 +1779,7 @@ __webpack_require__.r(__webpack_exports__);
1779
1779
  * ```
1780
1780
  * @packageDocumentation
1781
1781
  * @module constants
1782
- */ const APP_VERSION = "4.15.9";
1782
+ */ const APP_VERSION = "4.15.13";
1783
1783
  // prettier-ignore
1784
1784
  const ES = "es2021";
1785
1785
  const IS_ES_MODERN = true;
@@ -1830,6 +1830,8 @@ const KEY_TAB = 'Tab';
1830
1830
  const KEY_ENTER = 'Enter';
1831
1831
  const KEY_ESC = 'Escape';
1832
1832
  const KEY_ALT = 'Alt';
1833
+ const KEY_HOME = 'Home';
1834
+ const KEY_END = 'End';
1833
1835
  const KEY_LEFT = 'ArrowLeft';
1834
1836
  const KEY_UP = 'ArrowUp';
1835
1837
  const KEY_RIGHT = 'ArrowRight';
@@ -2023,9 +2025,11 @@ const PASSIVE_EVENTS = new Set([
2023
2025
  /* harmony export */ "KEY_BACKSPACE", 0, /* binding */ KEY_BACKSPACE,
2024
2026
  /* harmony export */ "KEY_DELETE", 0, /* binding */ KEY_DELETE,
2025
2027
  /* harmony export */ "KEY_DOWN", 0, /* binding */ KEY_DOWN,
2028
+ /* harmony export */ "KEY_END", 0, /* binding */ KEY_END,
2026
2029
  /* harmony export */ "KEY_ENTER", 0, /* binding */ KEY_ENTER,
2027
2030
  /* harmony export */ "KEY_ESC", 0, /* binding */ KEY_ESC,
2028
2031
  /* harmony export */ "KEY_F3", 0, /* binding */ KEY_F3,
2032
+ /* harmony export */ "KEY_HOME", 0, /* binding */ KEY_HOME,
2029
2033
  /* harmony export */ "KEY_LEFT", 0, /* binding */ KEY_LEFT,
2030
2034
  /* harmony export */ "KEY_META", 0, /* binding */ KEY_META,
2031
2035
  /* harmony export */ "KEY_RIGHT", 0, /* binding */ KEY_RIGHT,
@@ -11529,10 +11533,31 @@ class Selection {
11529
11533
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.up(node, (elm)=>elm === this.area || elm && elm.parentNode === this.area, this.area)) {
11530
11534
  throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.error)('Node element must be in editor');
11531
11535
  }
11536
+ const target = !inward && this.__closestNotEditable(node) || node;
11532
11537
  const range = this.createRange();
11533
- range[inward || node === this.area ? 'selectNodeContents' : 'selectNode'](node);
11538
+ range[inward || target === this.area ? 'selectNodeContents' : 'selectNode'](target);
11534
11539
  return this.selectRange(range);
11535
11540
  }
11541
+ /**
11542
+ * The outermost `contenteditable="false"` ancestor of the node inside the
11543
+ * editable area, if there is one.
11544
+ *
11545
+ * A range can be put inside such an island (e.g. on an `<img>` wrapped in a
11546
+ * `<picture contenteditable="false">`), but the browser cannot place a caret
11547
+ * there: the arrow keys then have nothing to move from and the selection
11548
+ * cannot be escaped. Selecting the island itself keeps the range in editable
11549
+ * content, so the caret can step over it. See #1184
11550
+ */ __closestNotEditable(node) {
11551
+ const { area } = this;
11552
+ let result = null, elm = node.parentNode;
11553
+ while(elm && elm !== area && area.contains(elm)){
11554
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isElement(elm) && elm.getAttribute('contenteditable') === 'false') {
11555
+ result = elm;
11556
+ }
11557
+ elm = elm.parentNode;
11558
+ }
11559
+ return result;
11560
+ }
11536
11561
  /**
11537
11562
  * Return current selected HTML
11538
11563
  * @example
@@ -24200,6 +24225,19 @@ const instance = (j)=>j.getInstance('Table', j.o);
24200
24225
 
24201
24226
 
24202
24227
 
24228
+ const INPUT_TAGS = new Set([
24229
+ 'input',
24230
+ 'textarea',
24231
+ 'select'
24232
+ ]);
24233
+ const FOCUSABLE_SELECTOR = [
24234
+ 'button:not([disabled])',
24235
+ 'a[href]',
24236
+ 'input:not([disabled]):not([type="hidden"])',
24237
+ 'select:not([disabled])',
24238
+ 'textarea:not([disabled])',
24239
+ '[tabindex]:not([tabindex="-1"])'
24240
+ ].join(',');
24203
24241
  class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.UIButton {
24204
24242
  className() {
24205
24243
  return 'ToolbarButton';
@@ -24387,7 +24425,14 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24387
24425
  }
24388
24426
  }
24389
24427
  onTriggerKeyDown(e) {
24390
- if (this.state.disabled || ![
24428
+ if (this.state.disabled) {
24429
+ return;
24430
+ }
24431
+ if (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_DOWN) {
24432
+ this.onButtonKeyDown(e);
24433
+ return;
24434
+ }
24435
+ if (![
24391
24436
  jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_ENTER,
24392
24437
  jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_SPACE,
24393
24438
  ' '
@@ -24397,6 +24442,65 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24397
24442
  e.preventDefault();
24398
24443
  this.trigger.click();
24399
24444
  }
24445
+ /**
24446
+ * `ArrowDown` on a button with a trigger opens its dropdown and moves the
24447
+ * focus into it, like the WAI-ARIA menu button pattern
24448
+ */ onButtonKeyDown(e) {
24449
+ if (e.key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_DOWN || this.state.disabled || !this.state.hasTrigger || e.altKey || e.ctrlKey || e.metaKey) {
24450
+ return;
24451
+ }
24452
+ e.preventDefault();
24453
+ e.stopPropagation();
24454
+ if (!this.openedPopup) {
24455
+ this.trigger.click();
24456
+ }
24457
+ this.__popupFocusables()[0]?.focus();
24458
+ }
24459
+ /**
24460
+ * Inside the dropdown: `ArrowDown`/`ArrowUp` walk the items, `Escape` and
24461
+ * `ArrowUp` on the first item close it and give the focus back to the button
24462
+ */ __onPopupKeyDown(e) {
24463
+ if (!this.openedPopup || e.altKey || e.ctrlKey || e.metaKey) {
24464
+ return;
24465
+ }
24466
+ const target = e.target;
24467
+ // A text field keeps the arrow keys for itself
24468
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(target, INPUT_TAGS) && e.key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_ESC) {
24469
+ return;
24470
+ }
24471
+ const items = this.__popupFocusables(), index = items.indexOf(target);
24472
+ switch(e.key){
24473
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_ESC:
24474
+ this.__closePopup();
24475
+ break;
24476
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_UP:
24477
+ if (index <= 0) {
24478
+ this.__closePopup();
24479
+ } else {
24480
+ items[index - 1].focus();
24481
+ }
24482
+ break;
24483
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_DOWN:
24484
+ if (!items.length) {
24485
+ return;
24486
+ }
24487
+ items[(index + 1) % items.length].focus();
24488
+ break;
24489
+ default:
24490
+ return;
24491
+ }
24492
+ e.preventDefault();
24493
+ e.stopPropagation();
24494
+ }
24495
+ /**
24496
+ * Visible controls of the opened dropdown that can take the focus
24497
+ */ __popupFocusables() {
24498
+ const popup = this.openedPopup;
24499
+ if (!popup) {
24500
+ return [];
24501
+ }
24502
+ return Array.from(popup.container.querySelectorAll(FOCUSABLE_SELECTOR)).filter((elm)=>Boolean(elm.offsetParent));
24503
+ }
24400
24504
  /**
24401
24505
  * Create an open popup list
24402
24506
  */ __openControlList(control) {
@@ -24466,7 +24570,7 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24466
24570
  openPopup() {
24467
24571
  this.__closePopup();
24468
24572
  this.openedPopup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_22__.Popup(this.j, false);
24469
- this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick);
24573
+ this.j.e.on(this.ow, 'mousedown touchstart', this.onOutsideClick).on('escape closeAllPopups', this.onOutsideClick).on(this.openedPopup.container, 'keydown', this.__onPopupKeyDown);
24470
24574
  return this.openedPopup;
24471
24575
  }
24472
24576
  __closePopup() {
@@ -24482,12 +24586,18 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24482
24586
  // throws NotFoundError. See #1458
24483
24587
  this.openedPopup = null;
24484
24588
  this.j.e.off(this.ow, 'mousedown touchstart', this.onOutsideClick).off('escape closeAllPopups', this.onOutsideClick);
24589
+ // The keyboard brought the focus into the dropdown: give it back to
24590
+ // the button, otherwise it would fall out to the document
24591
+ const { activeElement } = this.od, hadFocus = activeElement && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(popup.container, activeElement);
24485
24592
  this.state.activated = false;
24486
24593
  popup.close();
24487
24594
  popup.destruct();
24488
24595
  if (this.trigger) {
24489
24596
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_17__.attr)(this.trigger, 'aria-expanded', false);
24490
24597
  }
24598
+ if (hadFocus) {
24599
+ this.focus();
24600
+ }
24491
24601
  }
24492
24602
  /**
24493
24603
  * Click handler
@@ -24578,6 +24688,12 @@ class ToolbarButton extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_19__.U
24578
24688
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24579
24689
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('trigger:keydown')
24580
24690
  ], ToolbarButton.prototype, "onTriggerKeyDown", null);
24691
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24692
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)('button:keydown')
24693
+ ], ToolbarButton.prototype, "onButtonKeyDown", null);
24694
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24695
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24696
+ ], ToolbarButton.prototype, "__onPopupKeyDown", null);
24581
24697
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24582
24698
  jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
24583
24699
  ], ToolbarButton.prototype, "onOutsideClick", null);
@@ -34492,10 +34608,11 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
34492
34608
  /* harmony import */ var jodit_plugins_tab_tab__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(81582);
34493
34609
  /* harmony import */ var jodit_plugins_table_table__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(7994);
34494
34610
  /* harmony import */ var jodit_plugins_table_keyboard_navigation_table_keyboard_navigation__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(30110);
34495
- /* harmony import */ var jodit_plugins_video_video__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(34142);
34496
- /* harmony import */ var jodit_plugins_wrap_nodes_wrap_nodes__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(22980);
34497
- /* harmony import */ var jodit_plugins_dtd_dtd__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(56894);
34498
- /* harmony import */ var jodit_plugins_xpath_xpath__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(52014);
34611
+ /* harmony import */ var jodit_plugins_toolbar_navigation_toolbar_navigation__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(74192);
34612
+ /* harmony import */ var jodit_plugins_video_video__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(34142);
34613
+ /* harmony import */ var jodit_plugins_wrap_nodes_wrap_nodes__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(22980);
34614
+ /* harmony import */ var jodit_plugins_dtd_dtd__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(56894);
34615
+ /* harmony import */ var jodit_plugins_xpath_xpath__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(52014);
34499
34616
  /*!
34500
34617
  * Jodit Editor (https://xdsoft.net/jodit/)
34501
34618
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34567,6 +34684,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
34567
34684
 
34568
34685
 
34569
34686
 
34687
+
34570
34688
 
34571
34689
 
34572
34690
  /***/ }),
@@ -43112,6 +43230,128 @@ function table(editor) {
43112
43230
  jodit_core_global__WEBPACK_IMPORTED_MODULE_0__.pluginSystem.add('table', table);
43113
43231
 
43114
43232
 
43233
+ /***/ }),
43234
+
43235
+ /***/ 74192:
43236
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
43237
+
43238
+ "use strict";
43239
+ /* unused harmony export toolbarNavigation */
43240
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31635);
43241
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
43242
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(49574);
43243
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68616);
43244
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23211);
43245
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
43246
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7909);
43247
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
43248
+ /*!
43249
+ * Jodit Editor (https://xdsoft.net/jodit/)
43250
+ * Released under MIT see LICENSE.txt in the project root for license information.
43251
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
43252
+ */ /**
43253
+ * [[include:plugins/toolbar-navigation/README.md]]
43254
+ * @packageDocumentation
43255
+ * @module plugins/toolbar-navigation
43256
+ */
43257
+
43258
+
43259
+
43260
+
43261
+
43262
+
43263
+
43264
+ const INPUT_TAGS = new Set([
43265
+ 'input',
43266
+ 'textarea',
43267
+ 'select'
43268
+ ]);
43269
+ /**
43270
+ * Makes the toolbar reachable from the keyboard, as described by the WAI-ARIA
43271
+ * authoring practices for a `role="toolbar"` widget.
43272
+ *
43273
+ * The focus is moved programmatically, so this works whatever
43274
+ * {@link Config.allowTabNavigation} does with the tab order — including the
43275
+ * default, where the buttons take no part in the page tab order.
43276
+ */ class toolbarNavigation extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
43277
+ /** @override */ afterInit(jodit) {
43278
+ jodit.registerCommand('focusToolbar', {
43279
+ hotkeys: 'alt+f10',
43280
+ exec: this.focusToolbar
43281
+ });
43282
+ }
43283
+ /** @override */ beforeDestruct() {}
43284
+ /**
43285
+ * Moves the focus to the first button of the toolbar.
43286
+ *
43287
+ * Bound to `Alt+F10` by default; remap it like any other command:
43288
+ * `commandToHotkeys: { focusToolbar: 'alt+0' }`
43289
+ */ focusToolbar() {
43290
+ const [first] = this.__buttons();
43291
+ first?.focus();
43292
+ return false;
43293
+ }
43294
+ /**
43295
+ * Arrow keys / `Home` / `End` walk the buttons, `Escape` leaves the toolbar
43296
+ */ onKeyDown(e) {
43297
+ if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) {
43298
+ return;
43299
+ }
43300
+ const target = e.target;
43301
+ // A control that needs the arrow keys for itself
43302
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(target, INPUT_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(target) && target.isContentEditable) {
43303
+ return;
43304
+ }
43305
+ const buttons = this.__buttons();
43306
+ if (!buttons.length) {
43307
+ return;
43308
+ }
43309
+ switch(e.key){
43310
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_ESC:
43311
+ this.j.s.focus();
43312
+ break;
43313
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_HOME:
43314
+ buttons[0].focus();
43315
+ break;
43316
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_END:
43317
+ buttons[buttons.length - 1].focus();
43318
+ break;
43319
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT:
43320
+ case jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT:
43321
+ {
43322
+ const index = buttons.findIndex((button)=>button.container.contains(target));
43323
+ if (index === -1) {
43324
+ return;
43325
+ }
43326
+ const forward = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT !== this.__isRtl(), next = index + (forward ? 1 : -1);
43327
+ buttons[(next + buttons.length) % buttons.length].focus();
43328
+ break;
43329
+ }
43330
+ default:
43331
+ return;
43332
+ }
43333
+ e.preventDefault();
43334
+ e.stopPropagation();
43335
+ return false;
43336
+ }
43337
+ /**
43338
+ * Toolbar buttons that can take the focus right now
43339
+ */ __buttons() {
43340
+ return this.j.toolbar.buttons.filter((button)=>!button.state.disabled && button.container.isConnected);
43341
+ }
43342
+ __isRtl() {
43343
+ return (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_6__.attr)(this.j.toolbar.container, 'dir') === 'rtl';
43344
+ }
43345
+ }
43346
+ ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
43347
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_2__.autobind
43348
+ ], toolbarNavigation.prototype, "focusToolbar", null);
43349
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
43350
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__.watch)('j.toolbar.container:keydown.toolbar-navigation')
43351
+ ], toolbarNavigation.prototype, "onKeyDown", null);
43352
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigation', toolbarNavigation);
43353
+
43354
+
43115
43355
  /***/ }),
43116
43356
 
43117
43357
  /***/ 48899: