jodit 4.0.6 → 4.0.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 (133) hide show
  1. package/CHANGELOG.md +15 -5
  2. package/es2015/jodit.css +19 -19
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +633 -529
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +72 -46
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  13. package/es2018/jodit.css +19 -19
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +633 -529
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +72 -46
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  24. package/es2021/jodit.css +19 -19
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +632 -528
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +72 -46
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  35. package/es2021.en/jodit.css +19 -19
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +333 -313
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +3 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  46. package/es5/jodit.css +25 -19
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +646 -542
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  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 +72 -46
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  57. package/esm/core/async/async.d.ts +1 -1
  58. package/esm/core/async/async.js +2 -2
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/create/create.d.ts +1 -1
  61. package/esm/core/helpers/utils/append-script.d.ts +1 -5
  62. package/esm/core/helpers/utils/append-script.js +13 -28
  63. package/esm/core/plugin/helpers/load.d.ts +1 -1
  64. package/esm/core/plugin/helpers/load.js +2 -2
  65. package/esm/core/plugin/plugin-system.js +5 -5
  66. package/esm/core/plugin/plugin.js +5 -1
  67. package/esm/core/ui/popup/popup.js +1 -0
  68. package/esm/core/view/view-with-toolbar.js +4 -1
  69. package/esm/langs/fi.d.ts +218 -0
  70. package/esm/langs/fi.js +231 -0
  71. package/esm/languages.js +2 -0
  72. package/esm/plugins/add-new-line/add-new-line.d.ts +14 -14
  73. package/esm/plugins/add-new-line/add-new-line.js +76 -73
  74. package/esm/plugins/copy-format/langs/fi.d.ts +4 -0
  75. package/esm/plugins/copy-format/langs/fi.js +9 -0
  76. package/esm/plugins/copy-format/langs/index.d.ts +2 -1
  77. package/esm/plugins/copy-format/langs/index.js +2 -1
  78. package/esm/plugins/line-height/langs/fi.d.ts +4 -0
  79. package/esm/plugins/line-height/langs/fi.js +9 -0
  80. package/esm/plugins/line-height/langs/index.d.ts +2 -1
  81. package/esm/plugins/line-height/langs/index.js +2 -1
  82. package/esm/plugins/resizer/resizer.d.ts +2 -2
  83. package/esm/plugins/resizer/resizer.js +12 -13
  84. package/esm/plugins/search/config.d.ts +5 -0
  85. package/esm/plugins/search/config.js +3 -1
  86. package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts} +2 -2
  87. package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.js → highlight-text-ranges.js} +19 -1
  88. package/esm/plugins/search/helpers/index.d.ts +1 -1
  89. package/esm/plugins/search/helpers/index.js +1 -1
  90. package/esm/plugins/search/search.d.ts +1 -1
  91. package/esm/plugins/search/search.js +4 -4
  92. package/esm/plugins/source/source.js +1 -1
  93. package/esm/plugins/speech-recognize/langs/fi.d.ts +9 -0
  94. package/esm/plugins/speech-recognize/langs/fi.js +14 -0
  95. package/esm/plugins/speech-recognize/langs/index.d.ts +2 -1
  96. package/esm/plugins/speech-recognize/langs/index.js +2 -1
  97. package/esm/plugins/spellcheck/langs/fi.d.ts +1 -0
  98. package/esm/plugins/spellcheck/langs/fi.js +9 -0
  99. package/esm/plugins/spellcheck/langs/index.d.ts +2 -1
  100. package/esm/plugins/spellcheck/langs/index.js +2 -1
  101. package/esm/plugins/symbols/langs/fi.d.ts +1 -0
  102. package/esm/plugins/symbols/langs/fi.js +9 -0
  103. package/esm/plugins/symbols/langs/index.d.ts +2 -1
  104. package/esm/plugins/symbols/langs/index.js +2 -1
  105. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.d.ts +1 -1
  106. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +70 -73
  107. package/esm/tsconfig.json +1 -1
  108. package/esm/types/create.d.ts +1 -1
  109. package/package.json +1 -1
  110. package/types/core/async/async.d.ts +1 -1
  111. package/types/core/create/create.d.ts +1 -1
  112. package/types/core/helpers/utils/append-script.d.ts +1 -5
  113. package/types/core/plugin/helpers/load.d.ts +1 -1
  114. package/types/langs/fi.d.ts +218 -0
  115. package/types/plugins/add-new-line/add-new-line.d.ts +14 -14
  116. package/types/plugins/copy-format/langs/fi.d.ts +4 -0
  117. package/types/plugins/copy-format/langs/index.d.ts +2 -1
  118. package/types/plugins/line-height/langs/fi.d.ts +4 -0
  119. package/types/plugins/line-height/langs/index.d.ts +2 -1
  120. package/types/plugins/resizer/resizer.d.ts +2 -2
  121. package/types/plugins/search/config.d.ts +5 -0
  122. package/types/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts} +2 -2
  123. package/types/plugins/search/helpers/index.d.ts +1 -1
  124. package/types/plugins/search/search.d.ts +1 -1
  125. package/types/plugins/speech-recognize/langs/fi.d.ts +9 -0
  126. package/types/plugins/speech-recognize/langs/index.d.ts +2 -1
  127. package/types/plugins/spellcheck/langs/fi.d.ts +1 -0
  128. package/types/plugins/spellcheck/langs/index.d.ts +2 -1
  129. package/types/plugins/symbols/langs/fi.d.ts +1 -0
  130. package/types/plugins/symbols/langs/index.d.ts +2 -1
  131. package/types/plugins/table-keyboard-navigation/table-keyboard-navigation.d.ts +1 -1
  132. package/types/tsconfig.json +1 -1
  133. package/types/types/create.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.6
4
+ * Version: v4.0.13
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1037,7 +1037,7 @@ class Async {
1037
1037
  });
1038
1038
  }, options?.timeout ?? 1);
1039
1039
  });
1040
- this.cancelIdleCallbackNative = window['cancelIdleCallback']?.bind(window) ??
1040
+ this.__cancelIdleCallbackNative = window['cancelIdleCallback']?.bind(window) ??
1041
1041
  ((request) => {
1042
1042
  this.clearTimeout(request);
1043
1043
  });
@@ -1263,7 +1263,7 @@ class Async {
1263
1263
  }
1264
1264
  cancelIdleCallback(request) {
1265
1265
  this.requestsIdle.delete(request);
1266
- return this.cancelIdleCallbackNative(request);
1266
+ return this.__cancelIdleCallbackNative(request);
1267
1267
  }
1268
1268
  requestAnimationFrame(callback) {
1269
1269
  const request = requestAnimationFrame(callback);
@@ -1692,7 +1692,7 @@ __webpack_require__.r(__webpack_exports__);
1692
1692
  * Released under MIT see LICENSE.txt in the project root for license information.
1693
1693
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1694
1694
  */
1695
- const APP_VERSION = "4.0.6";
1695
+ const APP_VERSION = "4.0.13";
1696
1696
  // prettier-ignore
1697
1697
  const ES = "es2021";
1698
1698
  const IS_ES_MODERN = true;
@@ -7146,12 +7146,10 @@ function alignElement(command, box) {
7146
7146
  /* harmony export */ GX: function() { return /* binding */ loadNextStyle; },
7147
7147
  /* harmony export */ JL: function() { return /* binding */ appendScriptAsync; },
7148
7148
  /* harmony export */ Nf: function() { return /* binding */ appendStyleAsync; },
7149
- /* harmony export */ uR: function() { return /* binding */ appendScript; },
7150
7149
  /* harmony export */ wY: function() { return /* binding */ loadNext; }
7151
7150
  /* harmony export */ });
7152
- /* harmony import */ var _complete_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55313);
7153
- /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69099);
7154
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2926);
7151
+ /* harmony import */ var _complete_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55313);
7152
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2926);
7155
7153
  /*!
7156
7154
  * Jodit Editor (https://xdsoft.net/jodit/)
7157
7155
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -7159,7 +7157,6 @@ function alignElement(command, box) {
7159
7157
  */
7160
7158
 
7161
7159
 
7162
-
7163
7160
  const alreadyLoadedList = new Map();
7164
7161
  const cacheLoaders = (loader) => {
7165
7162
  return async (jodit, url) => {
@@ -7171,44 +7168,30 @@ const cacheLoaders = (loader) => {
7171
7168
  return promise;
7172
7169
  };
7173
7170
  };
7174
- /**
7175
- * Append script in document and call callback function after download
7176
- */
7177
- const appendScript = (jodit, url, callback) => {
7178
- const script = jodit.c.element('script');
7179
- script.type = 'text/javascript';
7180
- script.async = true;
7181
- if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_0__/* .isFunction */ .m)(callback) && !jodit.isInDestruct) {
7182
- jodit.e.on(script, 'load', callback);
7183
- }
7184
- if (!script.src) {
7185
- script.src = (0,_complete_url__WEBPACK_IMPORTED_MODULE_1__/* .completeUrl */ .W)(url);
7186
- }
7187
- jodit.od.body.appendChild(script);
7188
- return {
7189
- callback,
7190
- element: script
7191
- };
7192
- };
7193
7171
  /**
7194
7172
  * Load script and return promise
7195
7173
  */
7196
7174
  const appendScriptAsync = cacheLoaders((jodit, url) => {
7197
- return new Promise((resolve, reject) => {
7175
+ return jodit.async.promise((resolve, reject) => {
7198
7176
  if (jodit.isInDestruct) {
7199
- return;
7177
+ return reject();
7200
7178
  }
7201
- const { element } = appendScript(jodit, url, resolve);
7202
- !jodit.isInDestruct && jodit.e.on(element, 'error', reject);
7179
+ const script = jodit.c.element('script', {
7180
+ type: 'text/javascript',
7181
+ async: true,
7182
+ src: (0,_complete_url__WEBPACK_IMPORTED_MODULE_0__/* .completeUrl */ .W)(url)
7183
+ });
7184
+ jodit.od.body.appendChild(script);
7185
+ jodit.e.on(script, 'error', reject).on(script, 'load', resolve);
7203
7186
  });
7204
7187
  });
7205
7188
  /**
7206
7189
  * Download CSS style script
7207
7190
  */
7208
7191
  const appendStyleAsync = cacheLoaders((jodit, url) => {
7209
- return new Promise((resolve, reject) => {
7192
+ return jodit.async.promise((resolve, reject) => {
7210
7193
  if (jodit.isInDestruct) {
7211
- return;
7194
+ return reject();
7212
7195
  }
7213
7196
  const link = jodit.c.element('link');
7214
7197
  link.rel = 'stylesheet';
@@ -7217,7 +7200,7 @@ const appendStyleAsync = cacheLoaders((jodit, url) => {
7217
7200
  const callback = () => resolve(link);
7218
7201
  !jodit.isInDestruct &&
7219
7202
  jodit.e.on(link, 'load', callback).on(link, 'error', reject);
7220
- link.href = (0,_complete_url__WEBPACK_IMPORTED_MODULE_1__/* .completeUrl */ .W)(url);
7203
+ link.href = (0,_complete_url__WEBPACK_IMPORTED_MODULE_0__/* .completeUrl */ .W)(url);
7221
7204
  if (jodit.o.shadowRoot) {
7222
7205
  jodit.o.shadowRoot.appendChild(link);
7223
7206
  }
@@ -7226,14 +7209,14 @@ const appendStyleAsync = cacheLoaders((jodit, url) => {
7226
7209
  }
7227
7210
  });
7228
7211
  });
7229
- const loadNext = (jodit, urls, i = 0) => {
7230
- if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .H)(urls[i])) {
7212
+ function loadNext(jodit, urls, i = 0) {
7213
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .H)(urls[i])) {
7231
7214
  return Promise.resolve();
7232
7215
  }
7233
7216
  return appendScriptAsync(jodit, urls[i]).then(() => loadNext(jodit, urls, i + 1));
7234
- };
7217
+ }
7235
7218
  function loadNextStyle(jodit, urls, i = 0) {
7236
- if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__/* .isString */ .H)(urls[i])) {
7219
+ if (!(0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .H)(urls[i])) {
7237
7220
  return Promise.resolve();
7238
7221
  }
7239
7222
  return appendStyleAsync(jodit, urls[i]).then(() => loadNextStyle(jodit, urls, i + 1));
@@ -8156,7 +8139,6 @@ __webpack_require__.r(__webpack_exports__);
8156
8139
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.tW; },
8157
8140
  /* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.JG; },
8158
8141
  /* harmony export */ alignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.E3; },
8159
- /* harmony export */ appendScript: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_2__.uR; },
8160
8142
  /* harmony export */ appendScriptAsync: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_2__.JL; },
8161
8143
  /* harmony export */ appendStyleAsync: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_2__.Nf; },
8162
8144
  /* harmony export */ attr: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_1__.L; },
@@ -8210,7 +8192,7 @@ __webpack_require__.r(__webpack_exports__);
8210
8192
  /* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52378);
8211
8193
  /* harmony import */ var _assert__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_assert__WEBPACK_IMPORTED_MODULE_3__);
8212
8194
  /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
8213
- /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_3__) if(["default","alignElement","clearAlign","hAlignElement","attr","appendScript","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_3__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
8195
+ /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _assert__WEBPACK_IMPORTED_MODULE_3__) if(["default","alignElement","clearAlign","hAlignElement","attr","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _assert__WEBPACK_IMPORTED_MODULE_3__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
8214
8196
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
8215
8197
  /* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67600);
8216
8198
  /* harmony import */ var _build_query__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(36990);
@@ -9088,9 +9070,9 @@ function getFullUrl(jodit, name, js) {
9088
9070
  /**
9089
9071
  * @private
9090
9072
  */
9091
- function loadExtras(items, jodit, extrasList, callback) {
9073
+ function loadExtras(items, jodit, extraList, callback) {
9092
9074
  try {
9093
- const needLoadExtras = extrasList.filter(extra => !items.has((0,jodit_core_plugin_helpers_utils__WEBPACK_IMPORTED_MODULE_3__/* .normalizeName */ .B)(extra.name)));
9075
+ const needLoadExtras = extraList.filter(extra => !items.has((0,jodit_core_plugin_helpers_utils__WEBPACK_IMPORTED_MODULE_3__/* .normalizeName */ .B)(extra.name)));
9094
9076
  if (needLoadExtras.length) {
9095
9077
  load(jodit, needLoadExtras, callback);
9096
9078
  }
@@ -9288,7 +9270,7 @@ class PluginSystem {
9288
9270
  * Public method for async init all plugins
9289
9271
  */
9290
9272
  __init(jodit) {
9291
- const { extrasList, disableList, filter } = getSpecialLists(jodit);
9273
+ const { extraList, disableList, filter } = getSpecialLists(jodit);
9292
9274
  const doneList = new Map();
9293
9275
  const pluginsMap = {};
9294
9276
  const waitingList = new Set();
@@ -9327,8 +9309,8 @@ class PluginSystem {
9327
9309
  initPlugins();
9328
9310
  }
9329
9311
  };
9330
- if (!extrasList || !extrasList.length) {
9331
- (0,jodit_core_plugin_helpers_load__WEBPACK_IMPORTED_MODULE_3__/* .loadExtras */ .z)(this.__items, jodit, extrasList, initPlugins);
9312
+ if (extraList && extraList.length) {
9313
+ (0,jodit_core_plugin_helpers_load__WEBPACK_IMPORTED_MODULE_3__/* .loadExtras */ .z)(this.__items, jodit, extraList, initPlugins);
9332
9314
  }
9333
9315
  initPlugins();
9334
9316
  bindOnBeforeDestruct(jodit, pluginsMap);
@@ -9368,10 +9350,10 @@ function bindOnBeforeDestruct(jodit, plugins) {
9368
9350
  });
9369
9351
  }
9370
9352
  function getSpecialLists(jodit) {
9371
- const extrasList = jodit.o.extraPlugins.map(s => (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__/* .isString */ .HD)(s) ? { name: s } : s);
9353
+ const extraList = jodit.o.extraPlugins.map(s => (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_0__/* .isString */ .HD)(s) ? { name: s } : s);
9372
9354
  const disableList = new Set((0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_1__/* .splitArray */ .C1)(jodit.o.disablePlugins).map(jodit_core_plugin_helpers_utils__WEBPACK_IMPORTED_MODULE_7__/* .normalizeName */ .B));
9373
9355
  const filter = jodit.o.safeMode ? new Set(jodit.o.safePluginsList) : null;
9374
- return { extrasList, disableList, filter };
9356
+ return { extraList, disableList, filter };
9375
9357
  }
9376
9358
 
9377
9359
 
@@ -9430,7 +9412,11 @@ class Plugin extends jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .ViewCo
9430
9412
  this.afterInit(this.jodit);
9431
9413
  }
9432
9414
  init(jodit) {
9433
- // empty
9415
+ if (this.jodit.isReady) {
9416
+ this.afterInit(this.jodit);
9417
+ this.__afterPluginSystemInit();
9418
+ this.jodit.e.fire('rebuildToolbar');
9419
+ }
9434
9420
  }
9435
9421
  __beforeDestruct() {
9436
9422
  if (this.isInDestruct) {
@@ -15258,6 +15244,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UI
15258
15244
  */
15259
15245
  open(getBound, keepPosition = false, parentContainer) {
15260
15246
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.markOwner)(this.jodit, this.container);
15247
+ this.container.classList.add(`jodit_theme_${this.jodit.o.theme}`);
15261
15248
  this.__calculateZIndex();
15262
15249
  this.isOpened = true;
15263
15250
  this.__addGlobalListeners();
@@ -15738,6 +15725,9 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_0__/
15738
15725
  super.destruct();
15739
15726
  }
15740
15727
  }
15728
+ (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .gn)([
15729
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':rebuildToolbar')
15730
+ ], ViewWithToolbar.prototype, "buildToolbar", null);
15741
15731
  (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .gn)([
15742
15732
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
15743
15733
  ], ViewWithToolbar.prototype, "beforeToolbarBuild", null);
@@ -17359,6 +17349,7 @@ function addClassNames(className, elm) {
17359
17349
 
17360
17350
 
17361
17351
 
17352
+
17362
17353
 
17363
17354
 
17364
17355
  let exp = {};
@@ -17368,6 +17359,7 @@ exp = {
17368
17359
  de: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1___default()),
17369
17360
  en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_0__,
17370
17361
  es: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1___default()),
17362
+ fi: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1___default()),
17371
17363
  fr: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1___default()),
17372
17364
  he: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1___default()),
17373
17365
  hu: (jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1___default()),
@@ -24837,36 +24829,38 @@ const ns = 'addnewline';
24837
24829
  class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Plugin {
24838
24830
  constructor() {
24839
24831
  super(...arguments);
24840
- this.line = this.j.c.fromHTML(`<div role="button" tabindex="-1" title="${this.j.i18n('Break')}" class="jodit-add-new-line"><span>${jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Icon.get('enter')}</span></div>`);
24841
- this.isMatchedTag = (node) => Boolean(node &&
24832
+ this.__line = this.j.c.fromHTML(`<div role="button" tabindex="-1" title="${this.j.i18n('Break')}" class="jodit-add-new-line"><span>${jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Icon.get('enter')}</span></div>`);
24833
+ this.__isMatchedTag = (node) => Boolean(node &&
24842
24834
  this.j.o.addNewLineTagsTriggers.includes(node.nodeName.toLowerCase()));
24843
- this.preview = false;
24844
- this.lineInFocus = false;
24845
- this.isShown = false;
24846
- this.hideForce = () => {
24847
- if (!this.isShown) {
24835
+ this.__isBeforeContent = false;
24836
+ this.__lineInFocus = false;
24837
+ this.__isShown = false;
24838
+ this.__hideForce = () => {
24839
+ if (!this.__isShown) {
24848
24840
  return;
24849
24841
  }
24850
- this.isShown = false;
24851
- this.j.async.clearTimeout(this.timeout);
24852
- this.lineInFocus = false;
24853
- jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(this.line);
24854
- this.line.style.setProperty('--jd-offset-handle', '0');
24842
+ this.__isShown = false;
24843
+ this.j.async.clearTimeout(this.__timeout);
24844
+ this.__lineInFocus = false;
24845
+ jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(this.__line);
24846
+ this.__line.style.setProperty('--jd-anl-handle-offset', '0');
24855
24847
  };
24856
- this.canGetFocus = (elm) => {
24848
+ this.__canGetFocus = (elm) => {
24857
24849
  return (elm != null &&
24858
24850
  jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(elm) &&
24859
24851
  !/^(img|table|iframe|hr)$/i.test(elm.nodeName));
24860
24852
  };
24861
- this.onClickLine = (e) => {
24853
+ this.__onClickLine = (e) => {
24862
24854
  const editor = this.j;
24863
24855
  const p = editor.createInside.element(editor.o.enter);
24864
- if (this.preview && this.current && this.current.parentNode) {
24865
- if (this.current === editor.editor) {
24856
+ if (this.__isBeforeContent &&
24857
+ this.__current &&
24858
+ this.__current.parentNode) {
24859
+ if (this.__current === editor.editor) {
24866
24860
  jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.prepend(editor.editor, p);
24867
24861
  }
24868
24862
  else {
24869
- this.current.parentNode.insertBefore(p, this.current);
24863
+ this.__current.parentNode.insertBefore(p, this.__current);
24870
24864
  }
24871
24865
  }
24872
24866
  else {
@@ -24875,30 +24869,32 @@ class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Plugin {
24875
24869
  editor.s.setCursorIn(p);
24876
24870
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
24877
24871
  editor.synchronizeValues();
24878
- this.hideForce();
24872
+ this.__hideForce();
24879
24873
  e.preventDefault();
24880
24874
  };
24881
24875
  }
24882
- show() {
24883
- if (this.isShown || this.j.o.readonly || this.j.isLocked) {
24876
+ __show() {
24877
+ if (this.j.o.readonly || this.j.isLocked) {
24884
24878
  return;
24885
24879
  }
24886
- this.isShown = true;
24887
- this.j.async.clearTimeout(this.timeout);
24888
- this.line.classList.toggle('jodit-add-new-line_after', !this.preview);
24889
- this.j.container.appendChild(this.line);
24890
- this.line.style.width = this.j.container.clientWidth + 'px';
24880
+ this.j.async.clearTimeout(this.__timeout);
24881
+ if (this.__isShown) {
24882
+ return;
24883
+ }
24884
+ this.__isShown = true;
24885
+ this.j.container.appendChild(this.__line);
24886
+ this.__line.style.width = this.j.container.clientWidth + 'px';
24891
24887
  }
24892
24888
  onLock(isLocked) {
24893
- if (isLocked && this.isShown) {
24894
- this.hideForce();
24889
+ if (isLocked && this.__isShown) {
24890
+ this.__hideForce();
24895
24891
  }
24896
24892
  }
24897
- hide() {
24898
- if (!this.isShown || this.lineInFocus) {
24893
+ __hide() {
24894
+ if (!this.__isShown || this.__lineInFocus) {
24899
24895
  return;
24900
24896
  }
24901
- this.timeout = this.j.async.setTimeout(this.hideForce, {
24897
+ this.__timeout = this.j.async.setTimeout(this.__hideForce, {
24902
24898
  timeout: 500,
24903
24899
  label: 'add-new-line-hide'
24904
24900
  });
@@ -24908,30 +24904,30 @@ class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Plugin {
24908
24904
  return;
24909
24905
  }
24910
24906
  editor.e
24911
- .on(this.line, 'mousemove', (e) => {
24907
+ .on(this.__line, 'mousemove', (e) => {
24912
24908
  e.stopPropagation();
24913
24909
  })
24914
- .on(this.line, 'mousedown touchstart', this.onClickLine)
24915
- .on('change', this.hideForce)
24916
- .on(this.line, 'mouseenter', () => {
24917
- this.j.async.clearTimeout(this.timeout);
24918
- this.lineInFocus = true;
24910
+ .on(this.__line, 'mousedown touchstart', this.__onClickLine)
24911
+ .on('change', this.__hideForce)
24912
+ .on(this.__line, 'mouseenter', () => {
24913
+ this.j.async.clearTimeout(this.__timeout);
24914
+ this.__lineInFocus = true;
24919
24915
  })
24920
- .on(this.line, 'mouseleave', () => {
24921
- this.lineInFocus = false;
24916
+ .on(this.__line, 'mouseleave', () => {
24917
+ this.__lineInFocus = false;
24922
24918
  })
24923
- .on('changePlace', this.addEventListeners.bind(this));
24924
- this.addEventListeners();
24919
+ .on('changePlace', this.__addEventListeners.bind(this));
24920
+ this.__addEventListeners();
24925
24921
  }
24926
- addEventListeners() {
24922
+ __addEventListeners() {
24927
24923
  const editor = this.j;
24928
24924
  editor.e
24929
24925
  .off(editor.editor, '.' + ns)
24930
24926
  .off(editor.container, '.' + ns)
24931
- .on([editor.ow, editor.ew, editor.editor], 'scroll' + '.' + ns, this.hideForce)
24932
- .on(editor.editor, 'click' + '.' + ns, this.hide)
24933
- .on(editor.container, 'mouseleave' + '.' + ns, this.hide)
24934
- .on(editor.editor, 'mousemove' + '.' + ns, this.onMouseMove);
24927
+ .on([editor.ow, editor.ew, editor.editor], 'scroll' + '.' + ns, this.__hideForce)
24928
+ .on(editor.editor, 'click' + '.' + ns, this.__hide)
24929
+ .on(editor.container, 'mouseleave' + '.' + ns, this.__hide)
24930
+ .on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
24935
24931
  }
24936
24932
  onDblClickEditor(e) {
24937
24933
  const editor = this.j;
@@ -24952,29 +24948,26 @@ class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Plugin {
24952
24948
  }
24953
24949
  editor.s.setCursorIn(p);
24954
24950
  editor.synchronizeValues();
24955
- this.hideForce();
24951
+ this.__hideForce();
24956
24952
  e.preventDefault();
24957
24953
  }
24958
24954
  }
24959
- onMouseMove(e) {
24955
+ __onMouseMove(e) {
24960
24956
  const editor = this.j;
24961
24957
  let currentElement = editor.ed.elementFromPoint(e.clientX, e.clientY);
24962
24958
  if (!jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(currentElement) ||
24963
- jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(this.line, currentElement)) {
24964
- return;
24965
- }
24966
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(editor.editor, currentElement)) {
24959
+ !jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(editor.editor, currentElement)) {
24967
24960
  return;
24968
24961
  }
24969
24962
  if (editor.editor !== currentElement &&
24970
- !this.isMatchedTag(currentElement)) {
24971
- currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(currentElement, this.isMatchedTag, editor.editor);
24963
+ !this.__isMatchedTag(currentElement)) {
24964
+ currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
24972
24965
  }
24973
24966
  if (!currentElement) {
24974
- this.hide();
24967
+ this.__hide();
24975
24968
  return;
24976
24969
  }
24977
- if (this.isMatchedTag(currentElement)) {
24970
+ if (this.__isMatchedTag(currentElement)) {
24978
24971
  const parentBox = jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.up(currentElement, jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor);
24979
24972
  if (parentBox && parentBox !== editor.editor) {
24980
24973
  currentElement = parentBox;
@@ -24991,30 +24984,32 @@ class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Plugin {
24991
24984
  const delta = this.j.o.addNewLineDeltaShow;
24992
24985
  if (Math.abs(clientY - pos.top) <= delta) {
24993
24986
  top = pos.top;
24994
- this.preview = true;
24987
+ this.__isBeforeContent = true;
24995
24988
  }
24996
- if (Math.abs(clientY - (pos.top + pos.height)) <= delta) {
24989
+ else if (Math.abs(clientY - (pos.top + pos.height)) <= delta) {
24997
24990
  top = pos.top + pos.height;
24998
- this.preview = false;
24991
+ this.__isBeforeContent = false;
24999
24992
  }
24993
+ const isEditor = editor.editor === currentElement;
25000
24994
  if (top !== false &&
25001
- ((editor.editor === currentElement && !this.preview) ||
25002
- !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(this.preview ? jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.prev : jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.next, currentElement, this.canGetFocus, editor.editor))) {
25003
- this.line.style.top = top + 'px';
25004
- this.current = currentElement;
25005
- this.show();
25006
- this.line.style.setProperty('--jd-offset-handle', clientX - pos.left - 10 + 'px');
24995
+ ((isEditor && !this.__isBeforeContent) ||
24996
+ (!isEditor &&
24997
+ !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(this.__isBeforeContent ? jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.prev : jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.next, currentElement, this.__canGetFocus, editor.editor)))) {
24998
+ this.__line.style.top = top + 'px';
24999
+ this.__current = currentElement;
25000
+ this.__show();
25001
+ this.__line.style.setProperty('--jd-anl-handle-offset', clientX - pos.left - 10 + 'px');
25007
25002
  }
25008
25003
  else {
25009
- this.current = false;
25010
- this.hide();
25004
+ this.__current = false;
25005
+ this.__hide();
25011
25006
  }
25012
25007
  }
25013
25008
  /** @override */
25014
25009
  beforeDestruct() {
25015
- this.j.async.clearTimeout(this.timeout);
25016
- this.j.e.off(this.line).off('changePlace', this.addEventListeners);
25017
- jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(this.line);
25010
+ this.j.async.clearTimeout(this.__timeout);
25011
+ this.j.e.off(this.__line).off('changePlace', this.__addEventListeners);
25012
+ jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(this.__line);
25018
25013
  this.j.e
25019
25014
  .off([this.j.ow, this.j.ew, this.j.editor], '.' + ns)
25020
25015
  .off(this.j.container, '.' + ns);
@@ -25025,13 +25020,13 @@ class addNewLine extends jodit_modules__WEBPACK_IMPORTED_MODULE_0__.Plugin {
25025
25020
  ], addNewLine.prototype, "onLock", null);
25026
25021
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .gn)([
25027
25022
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
25028
- ], addNewLine.prototype, "hide", null);
25023
+ ], addNewLine.prototype, "__hide", null);
25029
25024
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .gn)([
25030
25025
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':dblclick')
25031
25026
  ], addNewLine.prototype, "onDblClickEditor", null);
25032
25027
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .gn)([
25033
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.debounce)(ctx => ctx.defaultTimeout * 5)
25034
- ], addNewLine.prototype, "onMouseMove", null);
25028
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.throttle)(ctx => ctx.defaultTimeout)
25029
+ ], addNewLine.prototype, "__onMouseMove", null);
25035
25030
  jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .pw.add('addNewLine', addNewLine);
25036
25031
 
25037
25032
 
@@ -27451,6 +27446,7 @@ __webpack_require__.r(__webpack_exports__);
27451
27446
  /* harmony export */ de: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
27452
27447
  /* harmony export */ es: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
27453
27448
  /* harmony export */ fa: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
27449
+ /* harmony export */ fi: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
27454
27450
  /* harmony export */ fr: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
27455
27451
  /* harmony export */ he: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
27456
27452
  /* harmony export */ hu: function() { return /* reexport default from dynamic */ _ar_js__WEBPACK_IMPORTED_MODULE_0___default.a; },
@@ -27495,6 +27491,7 @@ __webpack_require__.r(__webpack_exports__);
27495
27491
 
27496
27492
 
27497
27493
 
27494
+
27498
27495
 
27499
27496
 
27500
27497
  /***/ }),
@@ -32281,6 +32278,7 @@ __webpack_require__.r(__webpack_exports__);
32281
32278
  /* harmony export */ de: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
32282
32279
  /* harmony export */ es: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
32283
32280
  /* harmony export */ fa: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
32281
+ /* harmony export */ fi: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
32284
32282
  /* harmony export */ fr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
32285
32283
  /* harmony export */ he: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
32286
32284
  /* harmony export */ hu: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
@@ -32325,6 +32323,7 @@ __webpack_require__.r(__webpack_exports__);
32325
32323
 
32326
32324
 
32327
32325
 
32326
+
32328
32327
 
32329
32328
 
32330
32329
  /***/ }),
@@ -35248,11 +35247,9 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .P
35248
35247
  if (rgx.test(data.value)) {
35249
35248
  data.value = data.value.replace(rgx, '$1');
35250
35249
  }
35251
- })
35252
- .on('hideResizer', this.hide)
35253
- .on('change afterInit afterSetMode', this.onChangeEditor);
35250
+ });
35254
35251
  this.addEventListeners();
35255
- this.onChangeEditor();
35252
+ this.__onChangeEditor();
35256
35253
  }
35257
35254
  /**
35258
35255
  * Click in the editor area
@@ -35262,7 +35259,7 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .P
35262
35259
  const { editor, options: { allowResizeTags } } = this.j;
35263
35260
  while (node && node !== editor) {
35264
35261
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(node, allowResizeTags)) {
35265
- this.bind(node);
35262
+ this.__bind(node);
35266
35263
  this.onClickElement(node);
35267
35264
  return;
35268
35265
  }
@@ -35436,7 +35433,7 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .P
35436
35433
  e.preventDefault();
35437
35434
  }
35438
35435
  }
35439
- onChangeEditor() {
35436
+ __onChangeEditor() {
35440
35437
  if (this.isShown) {
35441
35438
  if (!this.element || !this.element.parentNode) {
35442
35439
  this.hide();
@@ -35445,13 +35442,13 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .P
35445
35442
  this.updateSize();
35446
35443
  }
35447
35444
  }
35448
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('iframe', this.j.editor).forEach(this.bind);
35445
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.$$)('iframe', this.j.editor).forEach(this.__bind);
35449
35446
  }
35450
35447
  /**
35451
35448
  * Bind an edit element to element
35452
35449
  * @param element - The element that you want to add a function to resize
35453
35450
  */
35454
- bind(element) {
35451
+ __bind(element) {
35455
35452
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isHTMLElement(element) ||
35456
35453
  !this.j.o.allowResizeTags.has(element.tagName.toLowerCase()) ||
35457
35454
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.dataBind)(element, keyBInd)) {
@@ -35583,13 +35580,14 @@ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .P
35583
35580
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.autobind
35584
35581
  ], resizer.prototype, "onClickOutside", null);
35585
35582
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
35586
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.debounce)()
35587
- ], resizer.prototype, "onChangeEditor", null);
35583
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.watch)(':change')
35584
+ ], resizer.prototype, "__onChangeEditor", null);
35588
35585
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
35589
35586
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.autobind
35590
- ], resizer.prototype, "bind", null);
35587
+ ], resizer.prototype, "__bind", null);
35591
35588
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
35592
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.autobind
35589
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.autobind,
35590
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.watch)(':hideResizer')
35593
35591
  ], resizer.prototype, "hide", null);
35594
35592
  jodit_core_global__WEBPACK_IMPORTED_MODULE_4__/* .pluginSystem */ .pw.add('resizer', resizer);
35595
35593
 
@@ -35615,7 +35613,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__/* .pluginSystem */ .pw.add('resiz
35615
35613
 
35616
35614
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.useSearch = true;
35617
35615
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.search = {
35618
- lazyIdleTimeout: 0
35616
+ lazyIdleTimeout: 0,
35617
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
35618
+ useCustomHighlightAPI: typeof window.Highlight !== 'undefined'
35619
35619
  };
35620
35620
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__/* .Icon */ .J.set('search', (_search_svg__WEBPACK_IMPORTED_MODULE_2___default()));
35621
35621
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.find = {
@@ -35649,113 +35649,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.fin
35649
35649
 
35650
35650
  /***/ }),
35651
35651
 
35652
- /***/ 8521:
35653
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35654
-
35655
- "use strict";
35656
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35657
- /* harmony export */ Al: function() { return /* reexport safe */ _sentence_finder__WEBPACK_IMPORTED_MODULE_0__.A; },
35658
- /* harmony export */ Fb: function() { return /* reexport safe */ _wrap_ranges_texts_in_tmp_span__WEBPACK_IMPORTED_MODULE_1__.Fb; },
35659
- /* harmony export */ TW: function() { return /* reexport safe */ _wrap_ranges_texts_in_tmp_span__WEBPACK_IMPORTED_MODULE_1__.TW; },
35660
- /* harmony export */ e: function() { return /* reexport safe */ _wrap_ranges_texts_in_tmp_span__WEBPACK_IMPORTED_MODULE_1__.e; },
35661
- /* harmony export */ sG: function() { return /* reexport safe */ _wrap_ranges_texts_in_tmp_span__WEBPACK_IMPORTED_MODULE_1__.sG; }
35662
- /* harmony export */ });
35663
- /* harmony import */ var _sentence_finder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(135);
35664
- /* harmony import */ var _wrap_ranges_texts_in_tmp_span__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89883);
35665
- /*!
35666
- * Jodit Editor (https://xdsoft.net/jodit/)
35667
- * Released under MIT see LICENSE.txt in the project root for license information.
35668
- * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35669
- */
35670
- /**
35671
- * @module plugins/search
35672
- */
35673
-
35674
-
35675
-
35676
-
35677
- /***/ }),
35678
-
35679
- /***/ 135:
35680
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35681
-
35682
- "use strict";
35683
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35684
- /* harmony export */ A: function() { return /* binding */ SentenceFinder; }
35685
- /* harmony export */ });
35686
- /* harmony import */ var jodit_core_helpers_string_fuzzy_search_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29133);
35687
- /*!
35688
- * Jodit Editor (https://xdsoft.net/jodit/)
35689
- * Released under MIT see LICENSE.txt in the project root for license information.
35690
- * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35691
- */
35692
-
35693
- class SentenceFinder {
35694
- constructor(searchIndex = jodit_core_helpers_string_fuzzy_search_index__WEBPACK_IMPORTED_MODULE_0__/* .fuzzySearchIndex */ .Q) {
35695
- this.searchIndex = searchIndex;
35696
- this.queue = [];
35697
- this.value = '';
35698
- }
35699
- add(node) {
35700
- const value = (node.nodeValue ?? '').toLowerCase();
35701
- if (!value.length) {
35702
- return;
35703
- }
35704
- const index = this.value.length;
35705
- this.queue.push({
35706
- startIndex: index,
35707
- endIndex: index + value.length,
35708
- node
35709
- });
35710
- this.value += value;
35711
- }
35712
- ranges(needle, position = 0) {
35713
- const results = [];
35714
- let index = position, len = 0, startQueueIndex = 0;
35715
- // Find all ranges in substring
35716
- do {
35717
- [index, len] = this.searchIndex(needle, this.value, index);
35718
- if (index !== -1) {
35719
- let startContainer, startOffset = 0, endContainer, endOffset = 0;
35720
- for (let i = startQueueIndex; i < this.queue.length; i += 1) {
35721
- if (!startContainer && this.queue[i].endIndex > index) {
35722
- startContainer = this.queue[i].node;
35723
- startOffset = index - this.queue[i].startIndex;
35724
- }
35725
- if (startContainer &&
35726
- this.queue[i].endIndex >= index + len) {
35727
- endContainer = this.queue[i].node;
35728
- endOffset = index + len - this.queue[i].startIndex;
35729
- startQueueIndex = i;
35730
- break;
35731
- }
35732
- }
35733
- if (startContainer && endContainer) {
35734
- results.push({
35735
- startContainer,
35736
- startOffset,
35737
- endContainer,
35738
- endOffset
35739
- });
35740
- }
35741
- index += len;
35742
- }
35743
- } while (index !== -1);
35744
- return results.length === 0 ? null : results;
35745
- }
35746
- }
35747
-
35748
-
35749
- /***/ }),
35750
-
35751
- /***/ 89883:
35652
+ /***/ 73893:
35752
35653
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35753
35654
 
35754
35655
  "use strict";
35755
35656
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35657
+ /* harmony export */ AG: function() { return /* binding */ highlightTextRanges; },
35756
35658
  /* harmony export */ Fb: function() { return /* binding */ clearSelectionWrappersFromHTML; },
35757
35659
  /* harmony export */ TW: function() { return /* binding */ getSelectionWrappers; },
35758
- /* harmony export */ e: function() { return /* binding */ wrapRangesTextsInTmpSpan; },
35759
35660
  /* harmony export */ sG: function() { return /* binding */ clearSelectionWrappers; }
35760
35661
  /* harmony export */ });
35761
35662
  /* unused harmony export isSelectionWrapper */
@@ -35775,11 +35676,29 @@ const TMP_ATTR = 'jd-tmp-selection';
35775
35676
  /**
35776
35677
  * @private
35777
35678
  */
35778
- function wrapRangesTextsInTmpSpan(rng, restRanges, ci, root) {
35679
+ function highlightTextRanges(jodit, rng, restRanges, ci, root) {
35779
35680
  if (rng.startContainer.nodeValue == null ||
35780
35681
  rng.endContainer.nodeValue == null) {
35781
35682
  return;
35782
35683
  }
35684
+ if (jodit.o.search.useCustomHighlightAPI &&
35685
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
35686
+ typeof window.Highlight !== 'undefined') {
35687
+ const ranges = [rng, ...restRanges].map(rng => {
35688
+ const range = jodit.selection.createRange();
35689
+ range.setStart(rng.startContainer, rng.startOffset);
35690
+ range.setEnd(rng.endContainer, rng.endOffset);
35691
+ return range;
35692
+ });
35693
+ // @ts-ignore Because Highlight is not defined in the types TS 5.3.3
35694
+ const searchHighlight = new Highlight(...ranges);
35695
+ // @ts-ignore
35696
+ CSS.highlights.clear();
35697
+ // @ts-ignore
35698
+ CSS.highlights.set('jodit-search-result', searchHighlight);
35699
+ restRanges.length = 0;
35700
+ return;
35701
+ }
35783
35702
  const span = ci.element('span', {
35784
35703
  [TMP_ATTR]: true
35785
35704
  });
@@ -35863,6 +35782,105 @@ function isSelectionWrapper(node) {
35863
35782
  }
35864
35783
 
35865
35784
 
35785
+ /***/ }),
35786
+
35787
+ /***/ 8521:
35788
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35789
+
35790
+ "use strict";
35791
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35792
+ /* harmony export */ AG: function() { return /* reexport safe */ _highlight_text_ranges__WEBPACK_IMPORTED_MODULE_1__.AG; },
35793
+ /* harmony export */ Al: function() { return /* reexport safe */ _sentence_finder__WEBPACK_IMPORTED_MODULE_0__.A; },
35794
+ /* harmony export */ Fb: function() { return /* reexport safe */ _highlight_text_ranges__WEBPACK_IMPORTED_MODULE_1__.Fb; },
35795
+ /* harmony export */ TW: function() { return /* reexport safe */ _highlight_text_ranges__WEBPACK_IMPORTED_MODULE_1__.TW; },
35796
+ /* harmony export */ sG: function() { return /* reexport safe */ _highlight_text_ranges__WEBPACK_IMPORTED_MODULE_1__.sG; }
35797
+ /* harmony export */ });
35798
+ /* harmony import */ var _sentence_finder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(135);
35799
+ /* harmony import */ var _highlight_text_ranges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73893);
35800
+ /*!
35801
+ * Jodit Editor (https://xdsoft.net/jodit/)
35802
+ * Released under MIT see LICENSE.txt in the project root for license information.
35803
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35804
+ */
35805
+ /**
35806
+ * @module plugins/search
35807
+ */
35808
+
35809
+
35810
+
35811
+
35812
+ /***/ }),
35813
+
35814
+ /***/ 135:
35815
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35816
+
35817
+ "use strict";
35818
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35819
+ /* harmony export */ A: function() { return /* binding */ SentenceFinder; }
35820
+ /* harmony export */ });
35821
+ /* harmony import */ var jodit_core_helpers_string_fuzzy_search_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29133);
35822
+ /*!
35823
+ * Jodit Editor (https://xdsoft.net/jodit/)
35824
+ * Released under MIT see LICENSE.txt in the project root for license information.
35825
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
35826
+ */
35827
+
35828
+ class SentenceFinder {
35829
+ constructor(searchIndex = jodit_core_helpers_string_fuzzy_search_index__WEBPACK_IMPORTED_MODULE_0__/* .fuzzySearchIndex */ .Q) {
35830
+ this.searchIndex = searchIndex;
35831
+ this.queue = [];
35832
+ this.value = '';
35833
+ }
35834
+ add(node) {
35835
+ const value = (node.nodeValue ?? '').toLowerCase();
35836
+ if (!value.length) {
35837
+ return;
35838
+ }
35839
+ const index = this.value.length;
35840
+ this.queue.push({
35841
+ startIndex: index,
35842
+ endIndex: index + value.length,
35843
+ node
35844
+ });
35845
+ this.value += value;
35846
+ }
35847
+ ranges(needle, position = 0) {
35848
+ const results = [];
35849
+ let index = position, len = 0, startQueueIndex = 0;
35850
+ // Find all ranges in substring
35851
+ do {
35852
+ [index, len] = this.searchIndex(needle, this.value, index);
35853
+ if (index !== -1) {
35854
+ let startContainer, startOffset = 0, endContainer, endOffset = 0;
35855
+ for (let i = startQueueIndex; i < this.queue.length; i += 1) {
35856
+ if (!startContainer && this.queue[i].endIndex > index) {
35857
+ startContainer = this.queue[i].node;
35858
+ startOffset = index - this.queue[i].startIndex;
35859
+ }
35860
+ if (startContainer &&
35861
+ this.queue[i].endIndex >= index + len) {
35862
+ endContainer = this.queue[i].node;
35863
+ endOffset = index + len - this.queue[i].startIndex;
35864
+ startQueueIndex = i;
35865
+ break;
35866
+ }
35867
+ }
35868
+ if (startContainer && endContainer) {
35869
+ results.push({
35870
+ startContainer,
35871
+ startOffset,
35872
+ endContainer,
35873
+ endOffset
35874
+ });
35875
+ }
35876
+ index += len;
35877
+ }
35878
+ } while (index !== -1);
35879
+ return results.length === 0 ? null : results;
35880
+ }
35881
+ }
35882
+
35883
+
35866
35884
  /***/ }),
35867
35885
 
35868
35886
  /***/ 78014:
@@ -36012,7 +36030,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_1__/* .Plugin */
36012
36030
  this.drawPromise?.rejectCallback();
36013
36031
  this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
36014
36032
  (0,_helpers__WEBPACK_IMPORTED_MODULE_6__/* .clearSelectionWrappers */ .sG)(this.j.editor);
36015
- this.drawPromise = this.drawSelectionRanges(bounds);
36033
+ this.drawPromise = this.__drawSelectionRanges(bounds);
36016
36034
  }
36017
36035
  this.previousQuery = query;
36018
36036
  let currentIndex = this.ui.currentIndex - 1;
@@ -36087,7 +36105,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_1__/* .Plugin */
36087
36105
  });
36088
36106
  return this.cache[query];
36089
36107
  }
36090
- drawSelectionRanges(ranges) {
36108
+ __drawSelectionRanges(ranges) {
36091
36109
  const { async, createInside: ci, editor } = this.j;
36092
36110
  async.cancelAnimationFrame(this.wrapFrameRequest);
36093
36111
  const parts = [...ranges];
@@ -36097,7 +36115,7 @@ class search extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_1__/* .Plugin */
36097
36115
  do {
36098
36116
  sRange = parts.shift();
36099
36117
  if (sRange) {
36100
- (0,_helpers__WEBPACK_IMPORTED_MODULE_6__/* .wrapRangesTextsInTmpSpan */ .e)(sRange, parts, ci, editor);
36118
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_6__/* .highlightTextRanges */ .AG)(this.j, sRange, parts, ci, editor);
36101
36119
  }
36102
36120
  total += 1;
36103
36121
  } while (sRange && total <= 5);
@@ -37954,7 +37972,7 @@ class source extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_1__/* .Plugin */
37954
37972
  return false;
37955
37973
  };
37956
37974
  if (!addEventListener()) {
37957
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener);
37975
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, () => null);
37958
37976
  }
37959
37977
  }
37960
37978
  this.syncValueFromWYSIWYG(true);
@@ -38070,6 +38088,7 @@ __webpack_require__.r(__webpack_exports__);
38070
38088
  /* harmony export */ de: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38071
38089
  /* harmony export */ es: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38072
38090
  /* harmony export */ fa: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38091
+ /* harmony export */ fi: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38073
38092
  /* harmony export */ fr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38074
38093
  /* harmony export */ he: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38075
38094
  /* harmony export */ hu: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
@@ -38114,6 +38133,7 @@ __webpack_require__.r(__webpack_exports__);
38114
38133
 
38115
38134
 
38116
38135
 
38136
+
38117
38137
 
38118
38138
 
38119
38139
  /***/ }),
@@ -38694,6 +38714,7 @@ __webpack_require__.r(__webpack_exports__);
38694
38714
  /* harmony export */ de: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38695
38715
  /* harmony export */ es: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38696
38716
  /* harmony export */ fa: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38717
+ /* harmony export */ fi: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38697
38718
  /* harmony export */ fr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38698
38719
  /* harmony export */ he: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38699
38720
  /* harmony export */ hu: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
@@ -38738,6 +38759,7 @@ __webpack_require__.r(__webpack_exports__);
38738
38759
 
38739
38760
 
38740
38761
 
38762
+
38741
38763
 
38742
38764
 
38743
38765
  /***/ }),
@@ -39118,6 +39140,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .pw.add('tab',
39118
39140
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9162);
39119
39141
  /* harmony import */ var jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45979);
39120
39142
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79102);
39143
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(76974);
39121
39144
  /*!
39122
39145
  * Jodit Editor (https://xdsoft.net/jodit/)
39123
39146
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -39127,111 +39150,108 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .pw.add('tab',
39127
39150
 
39128
39151
 
39129
39152
 
39153
+
39154
+ const WORK_KEYS = new Set([
39155
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB,
39156
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT,
39157
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT,
39158
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP,
39159
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
39160
+ ]);
39130
39161
  /**
39131
- * Process navigate keypressing in table cell
39162
+ * Process navigates key pressing in table cell
39132
39163
  */
39133
39164
  function tableKeyboardNavigation(editor) {
39134
39165
  editor.e
39135
39166
  .off('.tableKeyboardNavigation')
39136
39167
  .on('keydown.tableKeyboardNavigation', (event) => {
39137
- let current, block;
39138
- if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB ||
39139
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT ||
39140
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT ||
39141
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP ||
39142
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN) {
39143
- current = editor.s.current();
39144
- block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.up(current, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isCell, editor.editor);
39145
- if (!block) {
39146
- return;
39147
- }
39148
- const range = editor.s.range;
39149
- if (event.key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && current !== block) {
39150
- if (((event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT ||
39151
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP) &&
39152
- (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.prev(current, (elm) => event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP
39153
- ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(elm, 'br')
39154
- : Boolean(elm), block) ||
39155
- (event.key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP &&
39156
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(current) &&
39157
- range.startOffset !== 0))) ||
39158
- ((event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT ||
39159
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN) &&
39160
- (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.next(current, (elm) => event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
39161
- ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(elm, 'br')
39162
- : Boolean(elm), block) ||
39163
- (event.key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN &&
39164
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(current) &&
39165
- current.nodeValue &&
39166
- range.startOffset !==
39167
- current.nodeValue.length)))) {
39168
- return;
39169
- }
39170
- }
39168
+ const { key } = event;
39169
+ if (!WORK_KEYS.has(key)) {
39170
+ return;
39171
39171
  }
39172
- else {
39172
+ const current = editor.s.current();
39173
+ if (!current) {
39174
+ return;
39175
+ }
39176
+ const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.up(current, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isCell, editor.editor);
39177
+ if (!cell) {
39173
39178
  return;
39174
39179
  }
39175
- const tableModule = editor.getInstance('Table', editor.o);
39176
- const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.up(block, (elm) => elm && /^table$/i.test(elm.nodeName), editor.editor);
39180
+ const { range } = editor.s;
39181
+ if (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && current !== cell) {
39182
+ const isNextDirection = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN;
39183
+ const hasNext = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.call)(!isNextDirection ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.next, current, elm => key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN
39184
+ ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(elm, 'br')
39185
+ : Boolean(elm), cell);
39186
+ if ((!isNextDirection &&
39187
+ (hasNext ||
39188
+ (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP &&
39189
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(current) &&
39190
+ range.startOffset !== 0))) ||
39191
+ (isNextDirection &&
39192
+ (hasNext ||
39193
+ (key !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN &&
39194
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(current) &&
39195
+ current.nodeValue &&
39196
+ range.startOffset !==
39197
+ current.nodeValue.length)))) {
39198
+ return;
39199
+ }
39200
+ }
39201
+ const tableModule = editor.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_2__/* .Table */ .i, editor.o);
39202
+ const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.closest(cell, 'table', editor.editor);
39177
39203
  let next = null;
39178
- switch (event.key) {
39204
+ const isPrev = key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT || event.shiftKey;
39205
+ const getNextCell = () => (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.call)(isPrev ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.next, cell, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isCell, table);
39206
+ switch (key) {
39179
39207
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB:
39180
- // case consts.KEY_RIGHT:
39181
39208
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT: {
39182
- const sibling = event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT || event.shiftKey
39183
- ? 'prev'
39184
- : 'next';
39185
- next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i[sibling](block, (elm) => elm &&
39186
- /^td|th$/i.test(elm.tagName), table);
39209
+ next = getNextCell();
39187
39210
  if (!next) {
39188
- tableModule.appendRow(table, sibling === 'next'
39211
+ tableModule.appendRow(table, !isPrev
39189
39212
  ? false
39190
- : table.querySelector('tr'), sibling === 'next');
39191
- next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i[sibling](block, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isCell, table);
39213
+ : table.querySelector('tr'), !isPrev);
39214
+ next = getNextCell();
39192
39215
  }
39193
39216
  break;
39194
39217
  }
39195
39218
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP:
39196
39219
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
39197
39220
  {
39198
- let i = 0, j = 0;
39199
- const matrix = tableModule.formalMatrix(table, (elm, _i, _j) => {
39200
- if (elm === block) {
39201
- i = _i;
39202
- j = _j;
39203
- }
39204
- });
39205
- if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP) {
39206
- if (matrix[i - 1] !== undefined) {
39207
- next = matrix[i - 1][j];
39221
+ const matrix = tableModule.formalMatrix(table);
39222
+ const [row, column] = tableModule.formalCoordinate(table, cell);
39223
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP) {
39224
+ if (matrix[row - 1] !== undefined) {
39225
+ next = matrix[row - 1][column];
39208
39226
  }
39209
39227
  }
39210
39228
  else {
39211
- if (matrix[i + 1] !== undefined) {
39212
- next = matrix[i + 1][j];
39229
+ if (matrix[row + 1] !== undefined) {
39230
+ next = matrix[row + 1][column];
39213
39231
  }
39214
39232
  }
39215
39233
  }
39216
39234
  break;
39217
39235
  }
39218
- if (next) {
39219
- if (!next.firstChild) {
39220
- const first = editor.createInside.element('br');
39221
- next.appendChild(first);
39222
- editor.s.setCursorBefore(first);
39236
+ if (!next) {
39237
+ return;
39238
+ }
39239
+ editor.e.fire('hidePopup hideResizer');
39240
+ if (!next.firstChild) {
39241
+ const first = editor.createInside.element('br');
39242
+ next.appendChild(first);
39243
+ editor.s.setCursorBefore(first);
39244
+ }
39245
+ else {
39246
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
39247
+ editor.s.select(next, true);
39223
39248
  }
39224
39249
  else {
39225
- if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
39226
- editor.s.select(next, true);
39227
- }
39228
- else {
39229
- editor.s.setCursorIn(next, event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT ||
39230
- event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN);
39231
- }
39250
+ editor.s.setCursorIn(next, key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN);
39232
39251
  }
39233
- return false;
39234
39252
  }
39253
+ editor.synchronizeValues();
39254
+ return false;
39235
39255
  });
39236
39256
  }
39237
39257
  jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .pluginSystem */ .pw.add('tableKeyboardNavigation', tableKeyboardNavigation);