jodit 4.19.11 → 4.19.14

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 (84) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/es2015/jodit.css +33 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +11 -11
  5. package/es2015/jodit.js +219 -117
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +9 -9
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +9 -9
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +9 -9
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +33 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +10 -10
  23. package/es2021/jodit.js +218 -115
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +10 -10
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +33 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +10 -10
  35. package/es2021.en/jodit.js +194 -91
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +11 -11
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +34 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +261 -120
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/global.d.ts +6 -0
  61. package/esm/core/global.js +21 -4
  62. package/esm/core/helpers/html/safe-html.js +26 -0
  63. package/esm/core/ui/button/tooltip/tooltip.d.ts +6 -0
  64. package/esm/core/ui/button/tooltip/tooltip.js +14 -3
  65. package/esm/core/view/view-with-toolbar.js +6 -1
  66. package/esm/jodit.d.ts +4 -0
  67. package/esm/jodit.js +5 -1
  68. package/esm/languages.js +7 -1
  69. package/esm/plugins/add-new-line/add-new-line.d.ts +5 -0
  70. package/esm/plugins/add-new-line/add-new-line.js +20 -3
  71. package/esm/plugins/delete/delete.d.ts +7 -0
  72. package/esm/plugins/delete/delete.js +22 -0
  73. package/esm/plugins/hr/hr.js +5 -0
  74. package/esm/plugins/media/media.js +8 -5
  75. package/esm/plugins/resizer/resizer.js +4 -1
  76. package/esm/plugins/select-cells/select-cells.d.ts +1 -0
  77. package/esm/plugins/select-cells/select-cells.js +12 -18
  78. package/package.json +1 -1
  79. package/types/core/global.d.ts +6 -0
  80. package/types/core/ui/button/tooltip/tooltip.d.ts +6 -0
  81. package/types/jodit.d.ts +4 -0
  82. package/types/plugins/add-new-line/add-new-line.d.ts +5 -0
  83. package/types/plugins/delete/delete.d.ts +7 -0
  84. package/types/plugins/select-cells/select-cells.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.19.11
4
+ * Version: v4.19.14
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1824,7 +1824,7 @@ __webpack_require__.r(__webpack_exports__);
1824
1824
  * ```
1825
1825
  * @packageDocumentation
1826
1826
  * @module constants
1827
- */ const APP_VERSION = "4.19.11";
1827
+ */ const APP_VERSION = "4.19.14";
1828
1828
  // prettier-ignore
1829
1829
  const ES = "es2021";
1830
1830
  const IS_ES_MODERN = true;
@@ -4780,16 +4780,18 @@ class EventHandlersStore {
4780
4780
  /* harmony export */ uniqueUid: function() { return /* binding */ uniqueUid; }
4781
4781
  /* harmony export */ });
4782
4782
  /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24497);
4783
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
4784
- /* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31534);
4785
- /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74264);
4786
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
4787
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
4788
- /* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(421);
4789
- /* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85305);
4790
- /* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42689);
4791
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(81937);
4792
- /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(27795);
4783
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
4784
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85932);
4785
+ /* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31534);
4786
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74264);
4787
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
4788
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
4789
+ /* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(421);
4790
+ /* harmony import */ var jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(78048);
4791
+ /* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85305);
4792
+ /* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42689);
4793
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81937);
4794
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(27795);
4793
4795
  /*!
4794
4796
  * Jodit Editor (https://xdsoft.net/jodit/)
4795
4797
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -4807,6 +4809,8 @@ class EventHandlersStore {
4807
4809
 
4808
4810
 
4809
4811
 
4812
+
4813
+
4810
4814
  const instances = {};
4811
4815
  let counter = 1;
4812
4816
  const uuids = new Set();
@@ -4824,26 +4828,40 @@ const uuids = new Set();
4824
4828
  uuids.add(uid);
4825
4829
  return uid;
4826
4830
  }
4827
- const pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_7__.PluginSystem({
4831
+ const pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__.PluginSystem({
4828
4832
  getContainer
4829
4833
  });
4830
4834
  const modules = {};
4831
- const extendLang = (langs)=>{
4835
+ // A CommonJS pack imported as a namespace carries the dictionary in `default`; a translation of the word is a string
4836
+ const unwrapModule = (pack)=>(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(pack) && (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(pack.default) ? pack.default : pack;
4837
+ /**
4838
+ * Merge language packs into the global `lang` registry
4839
+ *
4840
+ * `__proto__`, `constructor` and `prototype` are skipped on both levels, so a
4841
+ * pack parsed from untrusted JSON cannot reach `Object.prototype` (CWE-1321).
4842
+ */ const extendLang = (langs)=>{
4832
4843
  Object.keys(langs).forEach((key)=>{
4833
- if (_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key]) {
4834
- Object.assign(_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key], langs[key]);
4835
- } else {
4836
- _constants__WEBPACK_IMPORTED_MODULE_9__.lang[key] = langs[key];
4844
+ const pack = unwrapModule(langs[key]);
4845
+ if ((0,jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__.isUnsafeProtoKey)(key) || !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(pack)) {
4846
+ return;
4837
4847
  }
4848
+ if (!Object.prototype.hasOwnProperty.call(_constants__WEBPACK_IMPORTED_MODULE_11__.lang, key) || !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(_constants__WEBPACK_IMPORTED_MODULE_11__.lang[key])) {
4849
+ _constants__WEBPACK_IMPORTED_MODULE_11__.lang[key] = {};
4850
+ }
4851
+ Object.keys(pack).forEach((name)=>{
4852
+ if (!(0,jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__.isUnsafeProtoKey)(name)) {
4853
+ _constants__WEBPACK_IMPORTED_MODULE_11__.lang[key][name] = pack[name];
4854
+ }
4855
+ });
4838
4856
  });
4839
4857
  };
4840
4858
  const boxes = new WeakMap();
4841
4859
  /**
4842
4860
  * Create unique box(HTMLCotainer) and remove it after destroy
4843
4861
  */ function getContainer(jodit, classFunc, tag = 'div', createInsideEditor = false) {
4844
- const name = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(classFunc) ? classFunc : classFunc ? (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__.getClassName)(classFunc.prototype) : 'jodit-utils';
4862
+ const name = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__.isString)(classFunc) ? classFunc : classFunc ? (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_7__.getClassName)(classFunc.prototype) : 'jodit-utils';
4845
4863
  const data = boxes.get(jodit) || {}, key = name + tag;
4846
- const view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__.isViewObject)(jodit) ? jodit : jodit.j;
4864
+ const view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__.isViewObject)(jodit) ? jodit : jodit.j;
4847
4865
  let body;
4848
4866
  if (!data[key]) {
4849
4867
  let c = view.c;
@@ -4854,18 +4872,18 @@ const boxes = new WeakMap();
4854
4872
  body = (0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__.isJoditObject)(jodit) && jodit.o.shadowRoot ? jodit.o.shadowRoot : place;
4855
4873
  }
4856
4874
  const box = c.element(tag, {
4857
- className: `jodit jodit-${(0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_3__.kebabCase)(name)}-container jodit-box`
4875
+ className: `jodit jodit-${(0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__.kebabCase)(name)}-container jodit-box`
4858
4876
  });
4859
4877
  // Let a strict CSP accept the injected <style>/<script> box
4860
4878
  if (view.o.nonce && (tag === 'style' || tag === 'script')) {
4861
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(box, 'nonce', view.o.nonce);
4879
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(box, 'nonce', view.o.nonce);
4862
4880
  }
4863
4881
  box.classList.add(`jodit_theme_${view.o.theme || 'default'}`);
4864
- _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.append(body, box);
4882
+ _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(body, box);
4865
4883
  data[key] = box;
4866
4884
  jodit.hookStatus('beforeDestruct', ()=>{
4867
4885
  view.events.off(box);
4868
- _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(box);
4886
+ _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(box);
4869
4887
  delete data[key];
4870
4888
  if (Object.keys(data).length) {
4871
4889
  boxes.delete(jodit);
@@ -4882,15 +4900,15 @@ const boxes = new WeakMap();
4882
4900
  * Get root element for view
4883
4901
  * @internal
4884
4902
  */ function getPopupViewRoot(o, container, defaultRoot) {
4885
- return o.popupRoot ?? o.shadowRoot ?? _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(container, (parentElement)=>_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isTag(parentElement, 'dialog') || [
4903
+ return o.popupRoot ?? o.shadowRoot ?? _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(container, (parentElement)=>_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isTag(parentElement, 'dialog') || [
4886
4904
  'fixed',
4887
4905
  'absolute'
4888
- ].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(parentElement, 'position'))), defaultRoot) ?? defaultRoot;
4906
+ ].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(parentElement, 'position'))), defaultRoot) ?? defaultRoot;
4889
4907
  }
4890
4908
  /**
4891
4909
  * Global event emitter
4892
4910
  * @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
4893
- */ const eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_8__.eventEmitter;
4911
+ */ const eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__.eventEmitter;
4894
4912
 
4895
4913
  /* harmony export */ __webpack_require__.d(__webpack_exports__, [
4896
4914
  /* harmony export */ "eventEmitter", 0, /* binding */ eventEmitter,
@@ -6478,6 +6496,22 @@ function isSmuggledForeignHtml(elm) {
6478
6496
  'background',
6479
6497
  'xlink:href'
6480
6498
  ];
6499
+ /**
6500
+ * SVG animation elements can write a URL attribute at run time, as
6501
+ * `<animate attributeName="href" values="javascript:…">` does, and the
6502
+ * attributes below carry the values they write.
6503
+ */ const ANIMATION_TAGS = new Set([
6504
+ 'animate',
6505
+ 'set',
6506
+ 'animatemotion',
6507
+ 'animatetransform'
6508
+ ]);
6509
+ const ANIMATION_VALUE_ATTRIBUTES = [
6510
+ 'values',
6511
+ 'from',
6512
+ 'to',
6513
+ 'by'
6514
+ ];
6481
6515
  /**
6482
6516
  * Tags that load their URL as a *document* (scripts inside run). An SVG data
6483
6517
  * URL is only an XSS vector here — as an `<img>` source it renders inertly.
@@ -6551,6 +6585,19 @@ function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError, removeEve
6551
6585
  effected = true;
6552
6586
  }
6553
6587
  }
6588
+ // SMIL sets the attribute on click time, after the static check above:
6589
+ // `<svg><a><animate attributeName="href" values="javascript:…">` ran
6590
+ // in Chromium and Safari. Drop the values that hold a dangerous
6591
+ // scheme; `values` is a `;` list. See GHSA-6wrw-v5gj-6xg7
6592
+ if (ANIMATION_TAGS.has(tagName)) {
6593
+ for (const name of ANIMATION_VALUE_ATTRIBUTES){
6594
+ const value = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attrRaw)(elm, name);
6595
+ if (value && value.split(';').some((part)=>isDangerousUrl(part, 'a'))) {
6596
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, name, null);
6597
+ effected = true;
6598
+ }
6599
+ }
6600
+ }
6554
6601
  }
6555
6602
  return effected;
6556
6603
  }
@@ -16023,6 +16070,18 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
16023
16070
  render() {
16024
16071
  return '<div><div class="&__content"></div></div>';
16025
16072
  }
16073
+ get __isEnabled() {
16074
+ const { o } = this.j;
16075
+ return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
16076
+ }
16077
+ /**
16078
+ * Show tooltips for the buttons in an element outside the editor's
16079
+ * container, such as a toolbar placed by the `toolbar` option
16080
+ */ attach(container) {
16081
+ if (this.__isEnabled) {
16082
+ this.__onAttach(container);
16083
+ }
16084
+ }
16026
16085
  __onAttach(container) {
16027
16086
  // TODO Move it inside __show method. Now it is here because testcase failed with capturing
16028
16087
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(this.j, UITooltip), this.container);
@@ -16157,7 +16216,7 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
16157
16216
  }
16158
16217
  constructor(view){
16159
16218
  super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__isOpened", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__attachedContainers", new Set()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__listenClose", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__currentTarget", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__delayShowTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hideTimeout", 0);
16160
- if (!view.o.textIcons && view.o.showTooltip && !view.o.useNativeTooltip) {
16219
+ if (this.__isEnabled) {
16161
16220
  this.j.e.on('getContainer', (box)=>{
16162
16221
  this.__onAttach(box);
16163
16222
  });
@@ -18476,7 +18535,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
18476
18535
  return;
18477
18536
  }
18478
18537
  const buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__.splitArray)(this.o.buttons) : [];
18479
- this.toolbar?.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(this.toolbarContainer);
18538
+ const container = this.toolbarContainer;
18539
+ this.toolbar?.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(container);
18540
+ // The toolbar's own element, as editors can share the one it is placed in
18541
+ if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isOrContains(this.container, container)) {
18542
+ this.__tooltip.attach(this.toolbar.container);
18543
+ }
18480
18544
  }
18481
18545
  getRegisteredButtonGroups() {
18482
18546
  return this.groupToButtons;
@@ -20180,6 +20244,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar
20180
20244
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "constants", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__);
20181
20245
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.instances);
20182
20246
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.lang);
20247
+ /**
20248
+ * Merge language packs into `Jodit.lang`; prototype keys are ignored
20249
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "extendLang", jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.extendLang);
20183
20250
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
20184
20251
  Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin
20185
20252
  });
@@ -20224,34 +20291,35 @@ function addClassNames(className, elm) {
20224
20291
 
20225
20292
  "use strict";
20226
20293
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17312);
20227
- /* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57741);
20228
- /* harmony import */ var jodit_langs_az__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23717);
20229
- /* harmony import */ var jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56014);
20230
- /* harmony import */ var jodit_langs_de__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95461);
20231
- /* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63837);
20232
- /* harmony import */ var jodit_langs_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(39386);
20233
- /* harmony import */ var jodit_langs_fa__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52735);
20234
- /* harmony import */ var jodit_langs_fi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(62327);
20235
- /* harmony import */ var jodit_langs_fr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25090);
20236
- /* harmony import */ var jodit_langs_he__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(53113);
20237
- /* harmony import */ var jodit_langs_hu__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81321);
20238
- /* harmony import */ var jodit_langs_id__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4679);
20239
- /* harmony import */ var jodit_langs_it__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(31927);
20240
- /* harmony import */ var jodit_langs_ja__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21195);
20241
- /* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(53414);
20242
- /* harmony import */ var jodit_langs_ko__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(11012);
20243
- /* harmony import */ var jodit_langs_mn__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(87061);
20244
- /* harmony import */ var jodit_langs_nl__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(3268);
20245
- /* harmony import */ var jodit_langs_no__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(85325);
20246
- /* harmony import */ var jodit_langs_pl__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(97834);
20247
- /* harmony import */ var jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(86433);
20248
- /* harmony import */ var jodit_langs_ru__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(28359);
20249
- /* harmony import */ var jodit_langs_sk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(33872);
20250
- /* harmony import */ var jodit_langs_sv__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(39579);
20251
- /* harmony import */ var jodit_langs_tr__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(68368);
20252
- /* harmony import */ var jodit_langs_ua__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(57456);
20253
- /* harmony import */ var jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(25182);
20254
- /* harmony import */ var jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(44906);
20294
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
20295
+ /* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57741);
20296
+ /* harmony import */ var jodit_langs_az__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23717);
20297
+ /* harmony import */ var jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56014);
20298
+ /* harmony import */ var jodit_langs_de__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95461);
20299
+ /* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63837);
20300
+ /* harmony import */ var jodit_langs_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(39386);
20301
+ /* harmony import */ var jodit_langs_fa__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52735);
20302
+ /* harmony import */ var jodit_langs_fi__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(62327);
20303
+ /* harmony import */ var jodit_langs_fr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(25090);
20304
+ /* harmony import */ var jodit_langs_he__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(53113);
20305
+ /* harmony import */ var jodit_langs_hu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(81321);
20306
+ /* harmony import */ var jodit_langs_id__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4679);
20307
+ /* harmony import */ var jodit_langs_it__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31927);
20308
+ /* harmony import */ var jodit_langs_ja__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21195);
20309
+ /* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(53414);
20310
+ /* harmony import */ var jodit_langs_ko__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(11012);
20311
+ /* harmony import */ var jodit_langs_mn__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(87061);
20312
+ /* harmony import */ var jodit_langs_nl__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(3268);
20313
+ /* harmony import */ var jodit_langs_no__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(85325);
20314
+ /* harmony import */ var jodit_langs_pl__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(97834);
20315
+ /* harmony import */ var jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(86433);
20316
+ /* harmony import */ var jodit_langs_ru__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(28359);
20317
+ /* harmony import */ var jodit_langs_sk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(33872);
20318
+ /* harmony import */ var jodit_langs_sv__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(39579);
20319
+ /* harmony import */ var jodit_langs_tr__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(68368);
20320
+ /* harmony import */ var jodit_langs_ua__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(57456);
20321
+ /* harmony import */ var jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(25182);
20322
+ /* harmony import */ var jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(44906);
20255
20323
  /*!
20256
20324
  * Jodit Editor (https://xdsoft.net/jodit/)
20257
20325
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -20288,41 +20356,43 @@ function addClassNames(className, elm) {
20288
20356
 
20289
20357
 
20290
20358
 
20359
+
20291
20360
 
20292
20361
 
20293
20362
  let exp = {};
20294
20363
  exp = {
20295
- ar: jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1__,
20296
- az: jodit_langs_az__WEBPACK_IMPORTED_MODULE_2__,
20297
- cs_cz: jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_3__,
20298
- de: jodit_langs_de__WEBPACK_IMPORTED_MODULE_4__,
20299
- en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_5__,
20300
- es: jodit_langs_es__WEBPACK_IMPORTED_MODULE_6__,
20301
- fa: jodit_langs_fa__WEBPACK_IMPORTED_MODULE_7__,
20302
- fi: jodit_langs_fi__WEBPACK_IMPORTED_MODULE_8__,
20303
- fr: jodit_langs_fr__WEBPACK_IMPORTED_MODULE_9__,
20304
- he: jodit_langs_he__WEBPACK_IMPORTED_MODULE_10__,
20305
- hu: jodit_langs_hu__WEBPACK_IMPORTED_MODULE_11__,
20306
- id: jodit_langs_id__WEBPACK_IMPORTED_MODULE_12__,
20307
- it: jodit_langs_it__WEBPACK_IMPORTED_MODULE_13__,
20308
- ja: jodit_langs_ja__WEBPACK_IMPORTED_MODULE_14__,
20309
- ko: jodit_langs_ko__WEBPACK_IMPORTED_MODULE_16__,
20310
- mn: jodit_langs_mn__WEBPACK_IMPORTED_MODULE_17__,
20311
- nl: jodit_langs_nl__WEBPACK_IMPORTED_MODULE_18__,
20312
- no: jodit_langs_no__WEBPACK_IMPORTED_MODULE_19__,
20313
- pl: jodit_langs_pl__WEBPACK_IMPORTED_MODULE_20__,
20314
- pt_br: jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_21__,
20315
- ru: jodit_langs_ru__WEBPACK_IMPORTED_MODULE_22__,
20316
- sk: jodit_langs_sk__WEBPACK_IMPORTED_MODULE_23__,
20317
- sv: jodit_langs_sv__WEBPACK_IMPORTED_MODULE_24__,
20318
- tr: jodit_langs_tr__WEBPACK_IMPORTED_MODULE_25__,
20319
- ua: jodit_langs_ua__WEBPACK_IMPORTED_MODULE_26__,
20320
- zh_cn: jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_27__,
20321
- zh_tw: jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_28__
20364
+ ar: jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__,
20365
+ az: jodit_langs_az__WEBPACK_IMPORTED_MODULE_3__,
20366
+ cs_cz: jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_4__,
20367
+ de: jodit_langs_de__WEBPACK_IMPORTED_MODULE_5__,
20368
+ en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_6__,
20369
+ es: jodit_langs_es__WEBPACK_IMPORTED_MODULE_7__,
20370
+ fa: jodit_langs_fa__WEBPACK_IMPORTED_MODULE_8__,
20371
+ fi: jodit_langs_fi__WEBPACK_IMPORTED_MODULE_9__,
20372
+ fr: jodit_langs_fr__WEBPACK_IMPORTED_MODULE_10__,
20373
+ he: jodit_langs_he__WEBPACK_IMPORTED_MODULE_11__,
20374
+ hu: jodit_langs_hu__WEBPACK_IMPORTED_MODULE_12__,
20375
+ id: jodit_langs_id__WEBPACK_IMPORTED_MODULE_13__,
20376
+ it: jodit_langs_it__WEBPACK_IMPORTED_MODULE_14__,
20377
+ ja: jodit_langs_ja__WEBPACK_IMPORTED_MODULE_15__,
20378
+ ko: jodit_langs_ko__WEBPACK_IMPORTED_MODULE_17__,
20379
+ mn: jodit_langs_mn__WEBPACK_IMPORTED_MODULE_18__,
20380
+ nl: jodit_langs_nl__WEBPACK_IMPORTED_MODULE_19__,
20381
+ no: jodit_langs_no__WEBPACK_IMPORTED_MODULE_20__,
20382
+ pl: jodit_langs_pl__WEBPACK_IMPORTED_MODULE_21__,
20383
+ pt_br: jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_22__,
20384
+ ru: jodit_langs_ru__WEBPACK_IMPORTED_MODULE_23__,
20385
+ sk: jodit_langs_sk__WEBPACK_IMPORTED_MODULE_24__,
20386
+ sv: jodit_langs_sv__WEBPACK_IMPORTED_MODULE_25__,
20387
+ tr: jodit_langs_tr__WEBPACK_IMPORTED_MODULE_26__,
20388
+ ua: jodit_langs_ua__WEBPACK_IMPORTED_MODULE_27__,
20389
+ zh_cn: jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_28__,
20390
+ zh_tw: jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_29__
20322
20391
  };
20323
- /* Unpack array to hash */ const get = (value)=>value ? value.default || value : {}, hashLang = {};
20324
- if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__))) {
20325
- get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__).forEach((key, index)=>{
20392
+ /* Unpack array to hash */ // Unwrap a module (`default` is the dictionary or the packed array), but keep a dictionary whose `default` is a translation (`no.js`)
20393
+ const get = (value)=>value ? (0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(value.default) || (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value.default) ? value.default : value : {}, hashLang = {};
20394
+ if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__))) {
20395
+ get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__).forEach((key, index)=>{
20326
20396
  hashLang[index] = key;
20327
20397
  });
20328
20398
  }
@@ -28438,6 +28508,17 @@ const ns = 'addnewline';
28438
28508
  editor.editor
28439
28509
  ], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
28440
28510
  }
28511
+ /**
28512
+ * An empty line with a `<br>`, as Enter makes, so it keeps its height
28513
+ * without clean-html's fillEmptyParagraph (#1807)
28514
+ */ __newLine() {
28515
+ const { j } = this;
28516
+ const line = j.createInside.element(j.o.enter);
28517
+ if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(line, 'br')) {
28518
+ jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(line, j.createInside.element('br'));
28519
+ }
28520
+ return line;
28521
+ }
28441
28522
  /**
28442
28523
  * A paragraph holding only an embed has no place for the caret, so the
28443
28524
  * arrow keys can't get past one that ends the content, or before one that
@@ -28450,6 +28531,11 @@ const ns = 'addnewline';
28450
28531
  return;
28451
28532
  }
28452
28533
  const { startContainer, startOffset } = editor.s.range;
28534
+ // A caret in the editor itself, as beside a horizontal line, is in no
28535
+ // paragraph, and the browsers can leave it there with text beyond (#1803)
28536
+ if (startContainer === editor.editor) {
28537
+ return;
28538
+ }
28453
28539
  // Once the browser has moved the caret, if it could. With a 0 timeout
28454
28540
  // Jodit would run this at once, before the browser moves it
28455
28541
  editor.async.setTimeout(()=>{
@@ -28458,7 +28544,7 @@ const ns = 'addnewline';
28458
28544
  if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
28459
28545
  return;
28460
28546
  }
28461
- const p = editor.createInside.element(editor.o.enter);
28547
+ const p = this.__newLine();
28462
28548
  forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
28463
28549
  editor.s.setCursorIn(p);
28464
28550
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
@@ -28470,7 +28556,7 @@ const ns = 'addnewline';
28470
28556
  if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
28471
28557
  const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
28472
28558
  const top = e.pageY - editor.ew.scrollX;
28473
- const p = editor.createInside.element(editor.o.enter);
28559
+ const p = this.__newLine();
28474
28560
  if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
28475
28561
  jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
28476
28562
  } else {
@@ -28554,7 +28640,7 @@ const ns = 'addnewline';
28554
28640
  return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
28555
28641
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
28556
28642
  const editor = this.j;
28557
- const p = editor.createInside.element(editor.o.enter);
28643
+ const p = this.__newLine();
28558
28644
  if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
28559
28645
  if (this.__current === editor.editor) {
28560
28646
  jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
@@ -33287,6 +33373,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33287
33373
  }
33288
33374
  jodit.s.expandSelection();
33289
33375
  const range = jodit.s.range;
33376
+ this.__moveEdgesIntoCells(range);
33290
33377
  const caret = this.__clearSelectedCells(range);
33291
33378
  if (caret && range.collapsed) {
33292
33379
  jodit.s.selectRange(caret);
@@ -33308,6 +33395,22 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33308
33395
  jodit.s.selectRange(caret ?? range);
33309
33396
  return false;
33310
33397
  }
33398
+ /**
33399
+ * Firefox selects cells whole from their row, as after a drag into or out
33400
+ * of a table nested in a cell, and `deleteContents` would remove them. The
33401
+ * edges move into the cells, so their content is cleared instead, as in
33402
+ * Firefox's own delete
33403
+ */ __moveEdgesIntoCells(range) {
33404
+ const { startContainer, startOffset, endContainer, endOffset } = range;
33405
+ const first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
33406
+ const last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
33407
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(first)) {
33408
+ range.setStart(first, 0);
33409
+ }
33410
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(last)) {
33411
+ range.setEnd(last, last.childNodes.length);
33412
+ }
33413
+ }
33311
33414
  /**
33312
33415
  * A selection that starts or ends in a table cell clears the selected part
33313
33416
  * of each cell it covers and keeps the cells, as the browsers do.
@@ -36423,6 +36526,11 @@ function hr(editor) {
36423
36526
  return false;
36424
36527
  }
36425
36528
  const p = editor.createInside.element(editor.o.enter);
36529
+ // As Enter's new line has, so it keeps its height without clean-html's
36530
+ // fillEmptyParagraph (#1807)
36531
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
36532
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
36533
+ }
36426
36534
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
36427
36535
  editor.s.setCursorIn(p);
36428
36536
  return false;
@@ -42505,11 +42613,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
42505
42613
  });
42506
42614
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
42507
42615
  // The wrapper fits the media, whose size changes as its metadata loads
42508
- // and as it's resized. A percentage width is of the line, so it takes that
42616
+ // and as it's resized. It's inline, as the media is by default, so the
42617
+ // line's text-align still places it, or a block when the media is one.
42618
+ // A percentage width is of the line, so the wrapper is a block that
42619
+ // takes the line, and the media in it follows the text-align it inherits
42509
42620
  const fit = ()=>{
42621
+ const ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%');
42510
42622
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
42511
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
42512
- width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
42623
+ display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(media, 'display').toString()) ? 'inline-block' : 'block',
42624
+ width: ofLine ? '' : 'fit-content',
42513
42625
  height: ''
42514
42626
  });
42515
42627
  };
@@ -45507,8 +45619,11 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
45507
45619
  // is nothing measurable at all, let the wrapper size itself.
45508
45620
  const width = element.offsetWidth || attrPixelSize(element, 'width');
45509
45621
  const height = element.offsetHeight || attrPixelSize(element, 'height');
45622
+ // The wrapper takes the iframe's place in its line: inline, as an
45623
+ // iframe is by default, so the line's text-align still places it,
45624
+ // or a block when the iframe is one
45510
45625
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
45511
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
45626
+ display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
45512
45627
  });
45513
45628
  if (width) {
45514
45629
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
@@ -46818,13 +46933,7 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
46818
46933
  if (this.j.isLockedNotBy(key)) {
46819
46934
  return;
46820
46935
  }
46821
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
46822
- // host, so the lookup must start from the shadow root
46823
- const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
46824
- const cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
46825
- 'td',
46826
- 'th'
46827
- ], table);
46936
+ const cell = this.__cellUnder(e, table);
46828
46937
  if (!cell || !this.__selectedCell) {
46829
46938
  return;
46830
46939
  }
@@ -46867,6 +46976,13 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
46867
46976
  this.__isSelectionMode = false;
46868
46977
  this.__selectedCell = null;
46869
46978
  }
46979
+ // The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
46980
+ __cellUnder(e, table) {
46981
+ // Inside Shadow DOM `document.elementFromPoint` returns the shadow
46982
+ // host, so the lookup must start from the shadow root
46983
+ const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
46984
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, (elm)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(elm, 'table', table), table);
46985
+ }
46870
46986
  /**
46871
46987
  * Stop a selection process
46872
46988
  */ __onStopSelection(table, e) {
@@ -46875,23 +46991,10 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
46875
46991
  }
46876
46992
  this.__isSelectionMode = false;
46877
46993
  this.j.unlock();
46878
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
46879
- // host, so the lookup must start from the shadow root
46880
- const node = (this.j.o.shadowRoot ?? this.j.ed).elementFromPoint(e.clientX, e.clientY);
46881
- if (!node) {
46882
- return;
46883
- }
46884
- const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
46885
- 'td',
46886
- 'th'
46887
- ], table);
46994
+ const cell = this.__cellUnder(e, table);
46888
46995
  if (!cell) {
46889
46996
  return;
46890
46997
  }
46891
- const ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', table);
46892
- if (ownTable && ownTable !== table) {
46893
- return; // Nested tables
46894
- }
46895
46998
  this.__showCellsPopup(table, [
46896
46999
  cell,
46897
47000
  this.__selectedCell