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/es5/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
  */
@@ -2155,7 +2155,7 @@ __webpack_require__.r(__webpack_exports__);
2155
2155
  * @packageDocumentation
2156
2156
  * @module constants
2157
2157
  */
2158
- var APP_VERSION = "4.19.11";
2158
+ var APP_VERSION = "4.19.14";
2159
2159
  // prettier-ignore
2160
2160
  var ES = "es5";
2161
2161
  var IS_ES_MODERN = false;
@@ -5699,16 +5699,18 @@ var EventHandlersStore = /*#__PURE__*/ function() {
5699
5699
  /* harmony export */ uniqueUid: function() { return /* binding */ uniqueUid; }
5700
5700
  /* harmony export */ });
5701
5701
  /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24497);
5702
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
5703
- /* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31534);
5704
- /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74264);
5705
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
5706
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
5707
- /* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(421);
5708
- /* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85305);
5709
- /* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42689);
5710
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(81937);
5711
- /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(27795);
5702
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
5703
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85932);
5704
+ /* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31534);
5705
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74264);
5706
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
5707
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
5708
+ /* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(421);
5709
+ /* harmony import */ var jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(78048);
5710
+ /* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85305);
5711
+ /* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42689);
5712
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81937);
5713
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(27795);
5712
5714
  /*!
5713
5715
  * Jodit Editor (https://xdsoft.net/jodit/)
5714
5716
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -5726,6 +5728,8 @@ var EventHandlersStore = /*#__PURE__*/ function() {
5726
5728
 
5727
5729
 
5728
5730
 
5731
+
5732
+
5729
5733
  var instances = {};
5730
5734
  var counter = 1;
5731
5735
  var uuids = new Set();
@@ -5743,17 +5747,33 @@ var uuids = new Set();
5743
5747
  uuids.add(uid);
5744
5748
  return uid;
5745
5749
  }
5746
- var pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_7__.PluginSystem({
5750
+ var pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__.PluginSystem({
5747
5751
  getContainer: getContainer
5748
5752
  });
5749
5753
  var modules = {};
5750
- var extendLang = function extendLang(langs) {
5754
+ // A CommonJS pack imported as a namespace carries the dictionary in `default`; a translation of the word is a string
5755
+ var unwrapModule = function unwrapModule(pack) {
5756
+ return (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;
5757
+ };
5758
+ /**
5759
+ * Merge language packs into the global `lang` registry
5760
+ *
5761
+ * `__proto__`, `constructor` and `prototype` are skipped on both levels, so a
5762
+ * pack parsed from untrusted JSON cannot reach `Object.prototype` (CWE-1321).
5763
+ */ var extendLang = function extendLang(langs) {
5751
5764
  Object.keys(langs).forEach(function(key) {
5752
- if (_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key]) {
5753
- Object.assign(_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key], langs[key]);
5754
- } else {
5755
- _constants__WEBPACK_IMPORTED_MODULE_9__.lang[key] = langs[key];
5765
+ var pack = unwrapModule(langs[key]);
5766
+ 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)) {
5767
+ return;
5768
+ }
5769
+ 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])) {
5770
+ _constants__WEBPACK_IMPORTED_MODULE_11__.lang[key] = {};
5756
5771
  }
5772
+ Object.keys(pack).forEach(function(name) {
5773
+ if (!(0,jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__.isUnsafeProtoKey)(name)) {
5774
+ _constants__WEBPACK_IMPORTED_MODULE_11__.lang[key][name] = pack[name];
5775
+ }
5776
+ });
5757
5777
  });
5758
5778
  };
5759
5779
  var boxes = new WeakMap();
@@ -5761,9 +5781,9 @@ var boxes = new WeakMap();
5761
5781
  * Create unique box(HTMLCotainer) and remove it after destroy
5762
5782
  */ function getContainer(jodit, classFunc) {
5763
5783
  var tag = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 'div', createInsideEditor = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
5764
- var 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';
5784
+ var 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';
5765
5785
  var data = boxes.get(jodit) || {}, key = name + tag;
5766
- var view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__.isViewObject)(jodit) ? jodit : jodit.j;
5786
+ var view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__.isViewObject)(jodit) ? jodit : jodit.j;
5767
5787
  var body;
5768
5788
  if (!data[key]) {
5769
5789
  var c = view.c;
@@ -5774,18 +5794,18 @@ var boxes = new WeakMap();
5774
5794
  body = (0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__.isJoditObject)(jodit) && jodit.o.shadowRoot ? jodit.o.shadowRoot : place;
5775
5795
  }
5776
5796
  var box = c.element(tag, {
5777
- className: "jodit jodit-".concat((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_3__.kebabCase)(name), "-container jodit-box")
5797
+ className: "jodit jodit-".concat((0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__.kebabCase)(name), "-container jodit-box")
5778
5798
  });
5779
5799
  // Let a strict CSP accept the injected <style>/<script> box
5780
5800
  if (view.o.nonce && (tag === 'style' || tag === 'script')) {
5781
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(box, 'nonce', view.o.nonce);
5801
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(box, 'nonce', view.o.nonce);
5782
5802
  }
5783
5803
  box.classList.add("jodit_theme_".concat(view.o.theme || 'default'));
5784
- _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.append(body, box);
5804
+ _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(body, box);
5785
5805
  data[key] = box;
5786
5806
  jodit.hookStatus('beforeDestruct', function() {
5787
5807
  view.events.off(box);
5788
- _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(box);
5808
+ _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(box);
5789
5809
  delete data[key];
5790
5810
  if (Object.keys(data).length) {
5791
5811
  boxes.delete(jodit);
@@ -5803,17 +5823,17 @@ var boxes = new WeakMap();
5803
5823
  * @internal
5804
5824
  */ function getPopupViewRoot(o, container, defaultRoot) {
5805
5825
  var _ref, _ref1, _o_popupRoot;
5806
- return (_ref = (_ref1 = (_o_popupRoot = o.popupRoot) !== null && _o_popupRoot !== void 0 ? _o_popupRoot : o.shadowRoot) !== null && _ref1 !== void 0 ? _ref1 : _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(container, function(parentElement) {
5807
- return _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isTag(parentElement, 'dialog') || [
5826
+ return (_ref = (_ref1 = (_o_popupRoot = o.popupRoot) !== null && _o_popupRoot !== void 0 ? _o_popupRoot : o.shadowRoot) !== null && _ref1 !== void 0 ? _ref1 : _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(container, function(parentElement) {
5827
+ return _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isTag(parentElement, 'dialog') || [
5808
5828
  'fixed',
5809
5829
  'absolute'
5810
- ].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(parentElement, 'position')));
5830
+ ].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(parentElement, 'position')));
5811
5831
  }, defaultRoot)) !== null && _ref !== void 0 ? _ref : defaultRoot;
5812
5832
  }
5813
5833
  /**
5814
5834
  * Global event emitter
5815
5835
  * @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
5816
- */ var eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_8__.eventEmitter;
5836
+ */ var eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__.eventEmitter;
5817
5837
 
5818
5838
 
5819
5839
  /***/ }),
@@ -7476,6 +7496,22 @@ function isSmuggledForeignHtml(elm) {
7476
7496
  'background',
7477
7497
  'xlink:href'
7478
7498
  ];
7499
+ /**
7500
+ * SVG animation elements can write a URL attribute at run time, as
7501
+ * `<animate attributeName="href" values="javascript:…">` does, and the
7502
+ * attributes below carry the values they write.
7503
+ */ var ANIMATION_TAGS = new Set([
7504
+ 'animate',
7505
+ 'set',
7506
+ 'animatemotion',
7507
+ 'animatetransform'
7508
+ ]);
7509
+ var ANIMATION_VALUE_ATTRIBUTES = [
7510
+ 'values',
7511
+ 'from',
7512
+ 'to',
7513
+ 'by'
7514
+ ];
7479
7515
  /**
7480
7516
  * Tags that load their URL as a *document* (scripts inside run). An SVG data
7481
7517
  * URL is only an XSS vector here — as an `<img>` source it renders inertly.
@@ -7567,6 +7603,38 @@ function sanitizeHTMLElement(elm) {
7567
7603
  }
7568
7604
  }
7569
7605
  }
7606
+ // SMIL sets the attribute on click time, after the static check above:
7607
+ // `<svg><a><animate attributeName="href" values="javascript:…">` ran
7608
+ // in Chromium and Safari. Drop the values that hold a dangerous
7609
+ // scheme; `values` is a `;` list. See GHSA-6wrw-v5gj-6xg7
7610
+ if (ANIMATION_TAGS.has(tagName)) {
7611
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
7612
+ try {
7613
+ for(var _iterator1 = ANIMATION_VALUE_ATTRIBUTES[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
7614
+ var name1 = _step1.value;
7615
+ var value1 = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attrRaw)(elm, name1);
7616
+ if (value1 && value1.split(';').some(function(part) {
7617
+ return isDangerousUrl(part, 'a');
7618
+ })) {
7619
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, name1, null);
7620
+ effected = true;
7621
+ }
7622
+ }
7623
+ } catch (err) {
7624
+ _didIteratorError1 = true;
7625
+ _iteratorError1 = err;
7626
+ } finally{
7627
+ try {
7628
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
7629
+ _iterator1.return();
7630
+ }
7631
+ } finally{
7632
+ if (_didIteratorError1) {
7633
+ throw _iteratorError1;
7634
+ }
7635
+ }
7636
+ }
7637
+ }
7570
7638
  }
7571
7639
  return effected;
7572
7640
  }
@@ -19057,7 +19125,7 @@ var UITooltip = /*#__PURE__*/ function(UIElement) {
19057
19125
  _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, UITooltip, [
19058
19126
  view
19059
19127
  ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isOpened", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__attachedContainers", new Set()), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__listenClose", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__currentTarget", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__delayShowTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__hideTimeout", 0);
19060
- if (!view.o.textIcons && view.o.showTooltip && !view.o.useNativeTooltip) {
19128
+ if (_this.__isEnabled) {
19061
19129
  _this.j.e.on('getContainer', function(box) {
19062
19130
  _this.__onAttach(box);
19063
19131
  });
@@ -19080,6 +19148,24 @@ var UITooltip = /*#__PURE__*/ function(UIElement) {
19080
19148
  return '<div><div class="&__content"></div></div>';
19081
19149
  }
19082
19150
  },
19151
+ {
19152
+ key: "__isEnabled",
19153
+ get: function get() {
19154
+ var o = this.j.o;
19155
+ return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
19156
+ }
19157
+ },
19158
+ {
19159
+ /**
19160
+ * Show tooltips for the buttons in an element outside the editor's
19161
+ * container, such as a toolbar placed by the `toolbar` option
19162
+ */ key: "attach",
19163
+ value: function attach(container) {
19164
+ if (this.__isEnabled) {
19165
+ this.__onAttach(container);
19166
+ }
19167
+ }
19168
+ },
19083
19169
  {
19084
19170
  key: "__onAttach",
19085
19171
  value: function __onAttach(container) {
@@ -22342,7 +22428,12 @@ var ViewWithToolbar = /*#__PURE__*/ function(View) {
22342
22428
  return;
22343
22429
  }
22344
22430
  var buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_13__.splitArray)(this.o.buttons) : [];
22345
- (_this_toolbar = this.toolbar) === null || _this_toolbar === void 0 ? void 0 : _this_toolbar.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(this.toolbarContainer);
22431
+ var container = this.toolbarContainer;
22432
+ (_this_toolbar = this.toolbar) === null || _this_toolbar === void 0 ? void 0 : _this_toolbar.setRemoveButtons(this.o.removeButtons).build(buttons.concat(this.o.extraButtons || [])).appendTo(container);
22433
+ // The toolbar's own element, as editors can share the one it is placed in
22434
+ if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(this.container, container)) {
22435
+ this.__tooltip.attach(this.toolbar.container);
22436
+ }
22346
22437
  }
22347
22438
  },
22348
22439
  {
@@ -24471,6 +24562,9 @@ var Jodit = /*#__PURE__*/ function(ViewWithToolbar) {
24471
24562
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(Jodit, "constants", jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__);
24472
24563
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_14__.instances);
24473
24564
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.lang);
24565
+ /**
24566
+ * Merge language packs into `Jodit.lang`; prototype keys are ignored
24567
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(Jodit, "extendLang", jodit_core_global__WEBPACK_IMPORTED_MODULE_14__.extendLang);
24474
24568
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(Jodit, "core", {
24475
24569
  Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_21__.Plugin
24476
24570
  });
@@ -24517,34 +24611,35 @@ function addClassNames(className, elm) {
24517
24611
 
24518
24612
  "use strict";
24519
24613
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17312);
24520
- /* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57741);
24521
- /* harmony import */ var jodit_langs_az__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23717);
24522
- /* harmony import */ var jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56014);
24523
- /* harmony import */ var jodit_langs_de__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95461);
24524
- /* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63837);
24525
- /* harmony import */ var jodit_langs_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(39386);
24526
- /* harmony import */ var jodit_langs_fa__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52735);
24527
- /* harmony import */ var jodit_langs_fi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(62327);
24528
- /* harmony import */ var jodit_langs_fr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25090);
24529
- /* harmony import */ var jodit_langs_he__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(53113);
24530
- /* harmony import */ var jodit_langs_hu__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81321);
24531
- /* harmony import */ var jodit_langs_id__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4679);
24532
- /* harmony import */ var jodit_langs_it__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(31927);
24533
- /* harmony import */ var jodit_langs_ja__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21195);
24534
- /* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(53414);
24535
- /* harmony import */ var jodit_langs_ko__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(11012);
24536
- /* harmony import */ var jodit_langs_mn__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(87061);
24537
- /* harmony import */ var jodit_langs_nl__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(3268);
24538
- /* harmony import */ var jodit_langs_no__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(85325);
24539
- /* harmony import */ var jodit_langs_pl__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(97834);
24540
- /* harmony import */ var jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(86433);
24541
- /* harmony import */ var jodit_langs_ru__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(28359);
24542
- /* harmony import */ var jodit_langs_sk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(33872);
24543
- /* harmony import */ var jodit_langs_sv__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(39579);
24544
- /* harmony import */ var jodit_langs_tr__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(68368);
24545
- /* harmony import */ var jodit_langs_ua__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(57456);
24546
- /* harmony import */ var jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(25182);
24547
- /* harmony import */ var jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(44906);
24614
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
24615
+ /* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57741);
24616
+ /* harmony import */ var jodit_langs_az__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23717);
24617
+ /* harmony import */ var jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56014);
24618
+ /* harmony import */ var jodit_langs_de__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95461);
24619
+ /* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63837);
24620
+ /* harmony import */ var jodit_langs_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(39386);
24621
+ /* harmony import */ var jodit_langs_fa__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52735);
24622
+ /* harmony import */ var jodit_langs_fi__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(62327);
24623
+ /* harmony import */ var jodit_langs_fr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(25090);
24624
+ /* harmony import */ var jodit_langs_he__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(53113);
24625
+ /* harmony import */ var jodit_langs_hu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(81321);
24626
+ /* harmony import */ var jodit_langs_id__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4679);
24627
+ /* harmony import */ var jodit_langs_it__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31927);
24628
+ /* harmony import */ var jodit_langs_ja__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21195);
24629
+ /* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(53414);
24630
+ /* harmony import */ var jodit_langs_ko__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(11012);
24631
+ /* harmony import */ var jodit_langs_mn__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(87061);
24632
+ /* harmony import */ var jodit_langs_nl__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(3268);
24633
+ /* harmony import */ var jodit_langs_no__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(85325);
24634
+ /* harmony import */ var jodit_langs_pl__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(97834);
24635
+ /* harmony import */ var jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(86433);
24636
+ /* harmony import */ var jodit_langs_ru__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(28359);
24637
+ /* harmony import */ var jodit_langs_sk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(33872);
24638
+ /* harmony import */ var jodit_langs_sv__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(39579);
24639
+ /* harmony import */ var jodit_langs_tr__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(68368);
24640
+ /* harmony import */ var jodit_langs_ua__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(57456);
24641
+ /* harmony import */ var jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(25182);
24642
+ /* harmony import */ var jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(44906);
24548
24643
  /*!
24549
24644
  * Jodit Editor (https://xdsoft.net/jodit/)
24550
24645
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -24581,43 +24676,45 @@ function addClassNames(className, elm) {
24581
24676
 
24582
24677
 
24583
24678
 
24679
+
24584
24680
 
24585
24681
 
24586
24682
  var exp = {};
24587
24683
  exp = {
24588
- ar: jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1__,
24589
- az: jodit_langs_az__WEBPACK_IMPORTED_MODULE_2__,
24590
- cs_cz: jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_3__,
24591
- de: jodit_langs_de__WEBPACK_IMPORTED_MODULE_4__,
24592
- en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_5__,
24593
- es: jodit_langs_es__WEBPACK_IMPORTED_MODULE_6__,
24594
- fa: jodit_langs_fa__WEBPACK_IMPORTED_MODULE_7__,
24595
- fi: jodit_langs_fi__WEBPACK_IMPORTED_MODULE_8__,
24596
- fr: jodit_langs_fr__WEBPACK_IMPORTED_MODULE_9__,
24597
- he: jodit_langs_he__WEBPACK_IMPORTED_MODULE_10__,
24598
- hu: jodit_langs_hu__WEBPACK_IMPORTED_MODULE_11__,
24599
- id: jodit_langs_id__WEBPACK_IMPORTED_MODULE_12__,
24600
- it: jodit_langs_it__WEBPACK_IMPORTED_MODULE_13__,
24601
- ja: jodit_langs_ja__WEBPACK_IMPORTED_MODULE_14__,
24602
- ko: jodit_langs_ko__WEBPACK_IMPORTED_MODULE_16__,
24603
- mn: jodit_langs_mn__WEBPACK_IMPORTED_MODULE_17__,
24604
- nl: jodit_langs_nl__WEBPACK_IMPORTED_MODULE_18__,
24605
- no: jodit_langs_no__WEBPACK_IMPORTED_MODULE_19__,
24606
- pl: jodit_langs_pl__WEBPACK_IMPORTED_MODULE_20__,
24607
- pt_br: jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_21__,
24608
- ru: jodit_langs_ru__WEBPACK_IMPORTED_MODULE_22__,
24609
- sk: jodit_langs_sk__WEBPACK_IMPORTED_MODULE_23__,
24610
- sv: jodit_langs_sv__WEBPACK_IMPORTED_MODULE_24__,
24611
- tr: jodit_langs_tr__WEBPACK_IMPORTED_MODULE_25__,
24612
- ua: jodit_langs_ua__WEBPACK_IMPORTED_MODULE_26__,
24613
- zh_cn: jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_27__,
24614
- zh_tw: jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_28__
24615
- };
24616
- /* Unpack array to hash */ var get = function get(value) {
24617
- return value ? value.default || value : {};
24684
+ ar: jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__,
24685
+ az: jodit_langs_az__WEBPACK_IMPORTED_MODULE_3__,
24686
+ cs_cz: jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_4__,
24687
+ de: jodit_langs_de__WEBPACK_IMPORTED_MODULE_5__,
24688
+ en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_6__,
24689
+ es: jodit_langs_es__WEBPACK_IMPORTED_MODULE_7__,
24690
+ fa: jodit_langs_fa__WEBPACK_IMPORTED_MODULE_8__,
24691
+ fi: jodit_langs_fi__WEBPACK_IMPORTED_MODULE_9__,
24692
+ fr: jodit_langs_fr__WEBPACK_IMPORTED_MODULE_10__,
24693
+ he: jodit_langs_he__WEBPACK_IMPORTED_MODULE_11__,
24694
+ hu: jodit_langs_hu__WEBPACK_IMPORTED_MODULE_12__,
24695
+ id: jodit_langs_id__WEBPACK_IMPORTED_MODULE_13__,
24696
+ it: jodit_langs_it__WEBPACK_IMPORTED_MODULE_14__,
24697
+ ja: jodit_langs_ja__WEBPACK_IMPORTED_MODULE_15__,
24698
+ ko: jodit_langs_ko__WEBPACK_IMPORTED_MODULE_17__,
24699
+ mn: jodit_langs_mn__WEBPACK_IMPORTED_MODULE_18__,
24700
+ nl: jodit_langs_nl__WEBPACK_IMPORTED_MODULE_19__,
24701
+ no: jodit_langs_no__WEBPACK_IMPORTED_MODULE_20__,
24702
+ pl: jodit_langs_pl__WEBPACK_IMPORTED_MODULE_21__,
24703
+ pt_br: jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_22__,
24704
+ ru: jodit_langs_ru__WEBPACK_IMPORTED_MODULE_23__,
24705
+ sk: jodit_langs_sk__WEBPACK_IMPORTED_MODULE_24__,
24706
+ sv: jodit_langs_sv__WEBPACK_IMPORTED_MODULE_25__,
24707
+ tr: jodit_langs_tr__WEBPACK_IMPORTED_MODULE_26__,
24708
+ ua: jodit_langs_ua__WEBPACK_IMPORTED_MODULE_27__,
24709
+ zh_cn: jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_28__,
24710
+ zh_tw: jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_29__
24711
+ };
24712
+ /* 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`)
24713
+ var get = function get(value) {
24714
+ return 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 : {};
24618
24715
  }, hashLang = {};
24619
- if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__))) {
24620
- get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__).forEach(function(key, index) {
24716
+ if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__))) {
24717
+ get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__).forEach(function(key, index) {
24621
24718
  hashLang[index] = key;
24622
24719
  });
24623
24720
  }
@@ -34248,7 +34345,7 @@ var ns = 'addnewline';
34248
34345
  return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
34249
34346
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__onClickLine", function(e) {
34250
34347
  var editor = _this.j;
34251
- var p = editor.createInside.element(editor.o.enter);
34348
+ var p = _this.__newLine();
34252
34349
  if (_this.__isBeforeContent && _this.__current && _this.__current.parentNode) {
34253
34350
  if (_this.__current === editor.editor) {
34254
34351
  jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
@@ -34331,6 +34428,20 @@ var ns = 'addnewline';
34331
34428
  ], '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);
34332
34429
  }
34333
34430
  },
34431
+ {
34432
+ key: "__newLine",
34433
+ value: /**
34434
+ * An empty line with a `<br>`, as Enter makes, so it keeps its height
34435
+ * without clean-html's fillEmptyParagraph (#1807)
34436
+ */ function __newLine() {
34437
+ var j = this.j;
34438
+ var line = j.createInside.element(j.o.enter);
34439
+ if (!jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isTag(line, 'br')) {
34440
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(line, j.createInside.element('br'));
34441
+ }
34442
+ return line;
34443
+ }
34444
+ },
34334
34445
  {
34335
34446
  key: "onArrowKey",
34336
34447
  value: /**
@@ -34339,12 +34450,18 @@ var ns = 'addnewline';
34339
34450
  * starts it. When an arrow key leaves the caret where it was and there is
34340
34451
  * content beyond it, a new line goes there, as when the line is clicked.
34341
34452
  */ function onArrowKey(e) {
34453
+ var _this = this;
34342
34454
  var editor = this.j;
34343
34455
  var forward = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_DOWN || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_RIGHT;
34344
34456
  if (!editor.o.addNewLine || editor.o.readonly || editor.isLocked || e.shiftKey || !(forward || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_UP || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_LEFT) || !editor.s.isCollapsed()) {
34345
34457
  return;
34346
34458
  }
34347
34459
  var _editor_s_range = editor.s.range, startContainer = _editor_s_range.startContainer, startOffset = _editor_s_range.startOffset;
34460
+ // A caret in the editor itself, as beside a horizontal line, is in no
34461
+ // paragraph, and the browsers can leave it there with text beyond (#1803)
34462
+ if (startContainer === editor.editor) {
34463
+ return;
34464
+ }
34348
34465
  // Once the browser has moved the caret, if it could. With a 0 timeout
34349
34466
  // Jodit would run this at once, before the browser moves it
34350
34467
  editor.async.setTimeout(function() {
@@ -34353,7 +34470,7 @@ var ns = 'addnewline';
34353
34470
  if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
34354
34471
  return;
34355
34472
  }
34356
- var p = editor.createInside.element(editor.o.enter);
34473
+ var p = _this.__newLine();
34357
34474
  forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
34358
34475
  editor.s.setCursorIn(p);
34359
34476
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
@@ -34368,7 +34485,7 @@ var ns = 'addnewline';
34368
34485
  if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
34369
34486
  var editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.offset)(editor.editor, editor, editor.ed);
34370
34487
  var top = e.pageY - editor.ew.scrollX;
34371
- var p = editor.createInside.element(editor.o.enter);
34488
+ var p = this.__newLine();
34372
34489
  if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
34373
34490
  jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
34374
34491
  } else {
@@ -39650,6 +39767,7 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
39650
39767
  }
39651
39768
  jodit.s.expandSelection();
39652
39769
  var range = jodit.s.range;
39770
+ this.__moveEdgesIntoCells(range);
39653
39771
  var caret = this.__clearSelectedCells(range);
39654
39772
  if (caret && range.collapsed) {
39655
39773
  jodit.s.selectRange(caret);
@@ -39672,6 +39790,25 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
39672
39790
  return false;
39673
39791
  }
39674
39792
  },
39793
+ {
39794
+ key: "__moveEdgesIntoCells",
39795
+ value: /**
39796
+ * Firefox selects cells whole from their row, as after a drag into or out
39797
+ * of a table nested in a cell, and `deleteContents` would remove them. The
39798
+ * edges move into the cells, so their content is cleared instead, as in
39799
+ * Firefox's own delete
39800
+ */ function __moveEdgesIntoCells(range) {
39801
+ var startContainer = range.startContainer, startOffset = range.startOffset, endContainer = range.endContainer, endOffset = range.endOffset;
39802
+ var first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
39803
+ var last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
39804
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isCell(first)) {
39805
+ range.setStart(first, 0);
39806
+ }
39807
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isCell(last)) {
39808
+ range.setEnd(last, last.childNodes.length);
39809
+ }
39810
+ }
39811
+ },
39675
39812
  {
39676
39813
  key: "__clearSelectedCells",
39677
39814
  value: /**
@@ -43268,6 +43405,11 @@ function hr(editor) {
43268
43405
  return false;
43269
43406
  }
43270
43407
  var p = editor.createInside.element(editor.o.enter);
43408
+ // As Enter's new line has, so it keeps its height without clean-html's
43409
+ // fillEmptyParagraph (#1807)
43410
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
43411
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
43412
+ }
43271
43413
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
43272
43414
  editor.s.setCursorIn(p);
43273
43415
  return false;
@@ -50320,11 +50462,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
50320
50462
  }, "data-".concat(keyFake), 1));
50321
50463
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_6__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'style'));
50322
50464
  // The wrapper fits the media, whose size changes as its metadata loads
50323
- // and as it's resized. A percentage width is of the line, so it takes that
50465
+ // and as it's resized. It's inline, as the media is by default, so the
50466
+ // line's text-align still places it, or a block when the media is one.
50467
+ // A percentage width is of the line, so the wrapper is a block that
50468
+ // takes the line, and the media in it follows the text-align it inherits
50324
50469
  var fit = function fit() {
50470
+ var ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(_$media, 'width').endsWith('%');
50325
50471
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(wrapper, {
50326
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(_$media, 'display') === 'inline-block' ? 'inline-block' : 'block',
50327
- width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(_$media, 'width').endsWith('%') ? '' : 'fit-content',
50472
+ display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.css)(_$media, 'display').toString()) ? 'inline-block' : 'block',
50473
+ width: ofLine ? '' : 'fit-content',
50328
50474
  height: ''
50329
50475
  });
50330
50476
  };
@@ -53994,8 +54140,11 @@ var IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
53994
54140
  // is nothing measurable at all, let the wrapper size itself.
53995
54141
  var width = element.offsetWidth || attrPixelSize(element, 'width');
53996
54142
  var height = element.offsetHeight || attrPixelSize(element, 'height');
54143
+ // The wrapper takes the iframe's place in its line: inline, as an
54144
+ // iframe is by default, so the line's text-align still places it,
54145
+ // or a block when the iframe is one
53997
54146
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(wrapper, {
53998
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_13__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
54147
+ display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
53999
54148
  });
54000
54149
  if (width) {
54001
54150
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(wrapper, 'width', width);
@@ -55725,20 +55874,13 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
55725
55874
  value: /**
55726
55875
  * Mouse move inside the table
55727
55876
  */ function __onMove(table, e) {
55728
- var _this_j_o_shadowRoot;
55729
55877
  if (this.j.o.readonly && !this.j.isLocked) {
55730
55878
  return;
55731
55879
  }
55732
55880
  if (this.j.isLockedNotBy(key)) {
55733
55881
  return;
55734
55882
  }
55735
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
55736
- // host, so the lookup must start from the shadow root
55737
- var node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
55738
- var cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, [
55739
- 'td',
55740
- 'th'
55741
- ], table);
55883
+ var cell = this.__cellUnder(e, table);
55742
55884
  if (!cell || !this.__selectedCell) {
55743
55885
  return;
55744
55886
  }
@@ -55787,34 +55929,33 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
55787
55929
  this.__selectedCell = null;
55788
55930
  }
55789
55931
  },
55932
+ {
55933
+ key: "__cellUnder",
55934
+ value: // The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
55935
+ function __cellUnder(e, table) {
55936
+ var _this_j_o_shadowRoot;
55937
+ // Inside Shadow DOM `document.elementFromPoint` returns the shadow
55938
+ // host, so the lookup must start from the shadow root
55939
+ var node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
55940
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, function(elm) {
55941
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isCell(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(elm, 'table', table);
55942
+ }, table);
55943
+ }
55944
+ },
55790
55945
  {
55791
55946
  key: "__onStopSelection",
55792
55947
  value: /**
55793
55948
  * Stop a selection process
55794
55949
  */ function __onStopSelection(table, e) {
55795
- var _this_j_o_shadowRoot;
55796
55950
  if (!this.__selectedCell) {
55797
55951
  return;
55798
55952
  }
55799
55953
  this.__isSelectionMode = false;
55800
55954
  this.j.unlock();
55801
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
55802
- // host, so the lookup must start from the shadow root
55803
- var node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
55804
- if (!node) {
55805
- return;
55806
- }
55807
- var cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, [
55808
- 'td',
55809
- 'th'
55810
- ], table);
55955
+ var cell = this.__cellUnder(e, table);
55811
55956
  if (!cell) {
55812
55957
  return;
55813
55958
  }
55814
- var ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(cell, 'table', table);
55815
- if (ownTable && ownTable !== table) {
55816
- return; // Nested tables
55817
- }
55818
55959
  this.__showCellsPopup(table, [
55819
55960
  cell,
55820
55961
  this.__selectedCell