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/es2015/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
  */
@@ -1830,7 +1830,7 @@ __webpack_require__.r(__webpack_exports__);
1830
1830
  * ```
1831
1831
  * @packageDocumentation
1832
1832
  * @module constants
1833
- */ const APP_VERSION = "4.19.11";
1833
+ */ const APP_VERSION = "4.19.14";
1834
1834
  // prettier-ignore
1835
1835
  const ES = "es2015";
1836
1836
  const IS_ES_MODERN = true;
@@ -4802,16 +4802,18 @@ class EventHandlersStore {
4802
4802
  /* harmony export */ uniqueUid: function() { return /* binding */ uniqueUid; }
4803
4803
  /* harmony export */ });
4804
4804
  /* harmony import */ var jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24497);
4805
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
4806
- /* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31534);
4807
- /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(74264);
4808
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
4809
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
4810
- /* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(421);
4811
- /* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85305);
4812
- /* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42689);
4813
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(81937);
4814
- /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(27795);
4805
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
4806
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85932);
4807
+ /* harmony import */ var jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31534);
4808
+ /* harmony import */ var jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74264);
4809
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
4810
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
4811
+ /* harmony import */ var jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(421);
4812
+ /* harmony import */ var jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(78048);
4813
+ /* harmony import */ var jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(85305);
4814
+ /* harmony import */ var _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(42689);
4815
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81937);
4816
+ /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(27795);
4815
4817
  /*!
4816
4818
  * Jodit Editor (https://xdsoft.net/jodit/)
4817
4819
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -4829,6 +4831,8 @@ class EventHandlersStore {
4829
4831
 
4830
4832
 
4831
4833
 
4834
+
4835
+
4832
4836
  const instances = {};
4833
4837
  let counter = 1;
4834
4838
  const uuids = new Set();
@@ -4846,26 +4850,40 @@ const uuids = new Set();
4846
4850
  uuids.add(uid);
4847
4851
  return uid;
4848
4852
  }
4849
- const pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_7__.PluginSystem({
4853
+ const pluginSystem = new jodit_core_plugin_plugin_system__WEBPACK_IMPORTED_MODULE_9__.PluginSystem({
4850
4854
  getContainer
4851
4855
  });
4852
4856
  const modules = {};
4853
- const extendLang = (langs)=>{
4857
+ // A CommonJS pack imported as a namespace carries the dictionary in `default`; a translation of the word is a string
4858
+ 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;
4859
+ /**
4860
+ * Merge language packs into the global `lang` registry
4861
+ *
4862
+ * `__proto__`, `constructor` and `prototype` are skipped on both levels, so a
4863
+ * pack parsed from untrusted JSON cannot reach `Object.prototype` (CWE-1321).
4864
+ */ const extendLang = (langs)=>{
4854
4865
  Object.keys(langs).forEach((key)=>{
4855
- if (_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key]) {
4856
- Object.assign(_constants__WEBPACK_IMPORTED_MODULE_9__.lang[key], langs[key]);
4857
- } else {
4858
- _constants__WEBPACK_IMPORTED_MODULE_9__.lang[key] = langs[key];
4866
+ const pack = unwrapModule(langs[key]);
4867
+ 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)) {
4868
+ return;
4869
+ }
4870
+ 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])) {
4871
+ _constants__WEBPACK_IMPORTED_MODULE_11__.lang[key] = {};
4859
4872
  }
4873
+ Object.keys(pack).forEach((name)=>{
4874
+ if (!(0,jodit_core_helpers_utils_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_8__.isUnsafeProtoKey)(name)) {
4875
+ _constants__WEBPACK_IMPORTED_MODULE_11__.lang[key][name] = pack[name];
4876
+ }
4877
+ });
4860
4878
  });
4861
4879
  };
4862
4880
  const boxes = new WeakMap();
4863
4881
  /**
4864
4882
  * Create unique box(HTMLCotainer) and remove it after destroy
4865
4883
  */ function getContainer(jodit, classFunc, tag = 'div', createInsideEditor = false) {
4866
- 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';
4884
+ 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';
4867
4885
  const data = boxes.get(jodit) || {}, key = name + tag;
4868
- const view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__.isViewObject)(jodit) ? jodit : jodit.j;
4886
+ const view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_3__.isViewObject)(jodit) ? jodit : jodit.j;
4869
4887
  let body;
4870
4888
  if (!data[key]) {
4871
4889
  let c = view.c;
@@ -4876,18 +4894,18 @@ const boxes = new WeakMap();
4876
4894
  body = (0,jodit_core_helpers_checker_is_jodit_object__WEBPACK_IMPORTED_MODULE_0__.isJoditObject)(jodit) && jodit.o.shadowRoot ? jodit.o.shadowRoot : place;
4877
4895
  }
4878
4896
  const box = c.element(tag, {
4879
- className: `jodit jodit-${(0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_3__.kebabCase)(name)}-container jodit-box`
4897
+ className: `jodit jodit-${(0,jodit_core_helpers_string_kebab_case__WEBPACK_IMPORTED_MODULE_4__.kebabCase)(name)}-container jodit-box`
4880
4898
  });
4881
4899
  // Let a strict CSP accept the injected <style>/<script> box
4882
4900
  if (view.o.nonce && (tag === 'style' || tag === 'script')) {
4883
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(box, 'nonce', view.o.nonce);
4901
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(box, 'nonce', view.o.nonce);
4884
4902
  }
4885
4903
  box.classList.add(`jodit_theme_${view.o.theme || 'default'}`);
4886
- _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.append(body, box);
4904
+ _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(body, box);
4887
4905
  data[key] = box;
4888
4906
  jodit.hookStatus('beforeDestruct', ()=>{
4889
4907
  view.events.off(box);
4890
- _dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(box);
4908
+ _dom__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(box);
4891
4909
  delete data[key];
4892
4910
  if (Object.keys(data).length) {
4893
4911
  boxes.delete(jodit);
@@ -4905,15 +4923,15 @@ const boxes = new WeakMap();
4905
4923
  * @internal
4906
4924
  */ function getPopupViewRoot(o, container, defaultRoot) {
4907
4925
  var _ref, _ref1, _o_popupRoot;
4908
- 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, (parentElement)=>_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isTag(parentElement, 'dialog') || [
4926
+ 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, (parentElement)=>_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isHTMLElement(parentElement) && (_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isTag(parentElement, 'dialog') || [
4909
4927
  'fixed',
4910
4928
  'absolute'
4911
- ].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(parentElement, 'position'))), defaultRoot)) !== null && _ref !== void 0 ? _ref : defaultRoot;
4929
+ ].includes((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(parentElement, 'position'))), defaultRoot)) !== null && _ref !== void 0 ? _ref : defaultRoot;
4912
4930
  }
4913
4931
  /**
4914
4932
  * Global event emitter
4915
4933
  * @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
4916
- */ const eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_8__.eventEmitter;
4934
+ */ const eventEmitter = _event_emitter_global__WEBPACK_IMPORTED_MODULE_10__.eventEmitter;
4917
4935
 
4918
4936
  /* harmony export */ __webpack_require__.d(__webpack_exports__, [
4919
4937
  /* harmony export */ "eventEmitter", 0, /* binding */ eventEmitter,
@@ -6503,6 +6521,22 @@ function isSmuggledForeignHtml(elm) {
6503
6521
  'background',
6504
6522
  'xlink:href'
6505
6523
  ];
6524
+ /**
6525
+ * SVG animation elements can write a URL attribute at run time, as
6526
+ * `<animate attributeName="href" values="javascript:…">` does, and the
6527
+ * attributes below carry the values they write.
6528
+ */ const ANIMATION_TAGS = new Set([
6529
+ 'animate',
6530
+ 'set',
6531
+ 'animatemotion',
6532
+ 'animatetransform'
6533
+ ]);
6534
+ const ANIMATION_VALUE_ATTRIBUTES = [
6535
+ 'values',
6536
+ 'from',
6537
+ 'to',
6538
+ 'by'
6539
+ ];
6506
6540
  /**
6507
6541
  * Tags that load their URL as a *document* (scripts inside run). An SVG data
6508
6542
  * URL is only an XSS vector here — as an `<img>` source it renders inertly.
@@ -6576,6 +6610,19 @@ function sanitizeHTMLElement(elm, { safeJavaScriptLink, removeOnError, removeEve
6576
6610
  effected = true;
6577
6611
  }
6578
6612
  }
6613
+ // SMIL sets the attribute on click time, after the static check above:
6614
+ // `<svg><a><animate attributeName="href" values="javascript:…">` ran
6615
+ // in Chromium and Safari. Drop the values that hold a dangerous
6616
+ // scheme; `values` is a `;` list. See GHSA-6wrw-v5gj-6xg7
6617
+ if (ANIMATION_TAGS.has(tagName)) {
6618
+ for (const name of ANIMATION_VALUE_ATTRIBUTES){
6619
+ const value = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attrRaw)(elm, name);
6620
+ if (value && value.split(';').some((part)=>isDangerousUrl(part, 'a'))) {
6621
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_1__.attr)(elm, name, null);
6622
+ effected = true;
6623
+ }
6624
+ }
6625
+ }
6579
6626
  }
6580
6627
  return effected;
6581
6628
  }
@@ -16149,6 +16196,18 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
16149
16196
  render() {
16150
16197
  return '<div><div class="&__content"></div></div>';
16151
16198
  }
16199
+ get __isEnabled() {
16200
+ const { o } = this.j;
16201
+ return !o.textIcons && Boolean(o.showTooltip) && !o.useNativeTooltip;
16202
+ }
16203
+ /**
16204
+ * Show tooltips for the buttons in an element outside the editor's
16205
+ * container, such as a toolbar placed by the `toolbar` option
16206
+ */ attach(container) {
16207
+ if (this.__isEnabled) {
16208
+ this.__onAttach(container);
16209
+ }
16210
+ }
16152
16211
  __onAttach(container) {
16153
16212
  // TODO Move it inside __show method. Now it is here because testcase failed with capturing
16154
16213
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(this.j, UITooltip), this.container);
@@ -16283,7 +16342,7 @@ class UITooltip extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIEle
16283
16342
  }
16284
16343
  constructor(view){
16285
16344
  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);
16286
- if (!view.o.textIcons && view.o.showTooltip && !view.o.useNativeTooltip) {
16345
+ if (this.__isEnabled) {
16287
16346
  this.j.e.on('getContainer', (box)=>{
16288
16347
  this.__onAttach(box);
16289
16348
  });
@@ -18629,7 +18688,12 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
18629
18688
  return;
18630
18689
  }
18631
18690
  const buttons = this.o.buttons ? (0,jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__.splitArray)(this.o.buttons) : [];
18632
- (_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);
18691
+ const container = this.toolbarContainer;
18692
+ (_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);
18693
+ // The toolbar's own element, as editors can share the one it is placed in
18694
+ if (this.toolbar && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isOrContains(this.container, container)) {
18695
+ this.__tooltip.attach(this.toolbar.container);
18696
+ }
18633
18697
  }
18634
18698
  getRegisteredButtonGroups() {
18635
18699
  return this.groupToButtons;
@@ -20342,6 +20406,9 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_12__.ViewWithToolbar
20342
20406
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "constants", jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__);
20343
20407
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "instances", jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.instances);
20344
20408
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "lang", jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.lang);
20409
+ /**
20410
+ * Merge language packs into `Jodit.lang`; prototype keys are ignored
20411
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "extendLang", jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.extendLang);
20345
20412
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Jodit, "core", {
20346
20413
  Plugin: jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Plugin
20347
20414
  });
@@ -20386,34 +20453,35 @@ function addClassNames(className, elm) {
20386
20453
 
20387
20454
  "use strict";
20388
20455
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17312);
20389
- /* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57741);
20390
- /* harmony import */ var jodit_langs_az__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23717);
20391
- /* harmony import */ var jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56014);
20392
- /* harmony import */ var jodit_langs_de__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95461);
20393
- /* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63837);
20394
- /* harmony import */ var jodit_langs_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(39386);
20395
- /* harmony import */ var jodit_langs_fa__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52735);
20396
- /* harmony import */ var jodit_langs_fi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(62327);
20397
- /* harmony import */ var jodit_langs_fr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25090);
20398
- /* harmony import */ var jodit_langs_he__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(53113);
20399
- /* harmony import */ var jodit_langs_hu__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81321);
20400
- /* harmony import */ var jodit_langs_id__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4679);
20401
- /* harmony import */ var jodit_langs_it__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(31927);
20402
- /* harmony import */ var jodit_langs_ja__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(21195);
20403
- /* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(53414);
20404
- /* harmony import */ var jodit_langs_ko__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(11012);
20405
- /* harmony import */ var jodit_langs_mn__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(87061);
20406
- /* harmony import */ var jodit_langs_nl__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(3268);
20407
- /* harmony import */ var jodit_langs_no__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(85325);
20408
- /* harmony import */ var jodit_langs_pl__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(97834);
20409
- /* harmony import */ var jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(86433);
20410
- /* harmony import */ var jodit_langs_ru__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(28359);
20411
- /* harmony import */ var jodit_langs_sk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(33872);
20412
- /* harmony import */ var jodit_langs_sv__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(39579);
20413
- /* harmony import */ var jodit_langs_tr__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(68368);
20414
- /* harmony import */ var jodit_langs_ua__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(57456);
20415
- /* harmony import */ var jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(25182);
20416
- /* harmony import */ var jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(44906);
20456
+ /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62101);
20457
+ /* harmony import */ var jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57741);
20458
+ /* harmony import */ var jodit_langs_az__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23717);
20459
+ /* harmony import */ var jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(56014);
20460
+ /* harmony import */ var jodit_langs_de__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95461);
20461
+ /* harmony import */ var jodit_langs_en__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63837);
20462
+ /* harmony import */ var jodit_langs_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(39386);
20463
+ /* harmony import */ var jodit_langs_fa__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52735);
20464
+ /* harmony import */ var jodit_langs_fi__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(62327);
20465
+ /* harmony import */ var jodit_langs_fr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(25090);
20466
+ /* harmony import */ var jodit_langs_he__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(53113);
20467
+ /* harmony import */ var jodit_langs_hu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(81321);
20468
+ /* harmony import */ var jodit_langs_id__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4679);
20469
+ /* harmony import */ var jodit_langs_it__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31927);
20470
+ /* harmony import */ var jodit_langs_ja__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21195);
20471
+ /* harmony import */ var jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(53414);
20472
+ /* harmony import */ var jodit_langs_ko__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(11012);
20473
+ /* harmony import */ var jodit_langs_mn__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(87061);
20474
+ /* harmony import */ var jodit_langs_nl__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(3268);
20475
+ /* harmony import */ var jodit_langs_no__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(85325);
20476
+ /* harmony import */ var jodit_langs_pl__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(97834);
20477
+ /* harmony import */ var jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(86433);
20478
+ /* harmony import */ var jodit_langs_ru__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(28359);
20479
+ /* harmony import */ var jodit_langs_sk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(33872);
20480
+ /* harmony import */ var jodit_langs_sv__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(39579);
20481
+ /* harmony import */ var jodit_langs_tr__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(68368);
20482
+ /* harmony import */ var jodit_langs_ua__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(57456);
20483
+ /* harmony import */ var jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(25182);
20484
+ /* harmony import */ var jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(44906);
20417
20485
  /*!
20418
20486
  * Jodit Editor (https://xdsoft.net/jodit/)
20419
20487
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -20450,41 +20518,43 @@ function addClassNames(className, elm) {
20450
20518
 
20451
20519
 
20452
20520
 
20521
+
20453
20522
 
20454
20523
 
20455
20524
  let exp = {};
20456
20525
  exp = {
20457
- ar: jodit_langs_ar__WEBPACK_IMPORTED_MODULE_1__,
20458
- az: jodit_langs_az__WEBPACK_IMPORTED_MODULE_2__,
20459
- cs_cz: jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_3__,
20460
- de: jodit_langs_de__WEBPACK_IMPORTED_MODULE_4__,
20461
- en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_5__,
20462
- es: jodit_langs_es__WEBPACK_IMPORTED_MODULE_6__,
20463
- fa: jodit_langs_fa__WEBPACK_IMPORTED_MODULE_7__,
20464
- fi: jodit_langs_fi__WEBPACK_IMPORTED_MODULE_8__,
20465
- fr: jodit_langs_fr__WEBPACK_IMPORTED_MODULE_9__,
20466
- he: jodit_langs_he__WEBPACK_IMPORTED_MODULE_10__,
20467
- hu: jodit_langs_hu__WEBPACK_IMPORTED_MODULE_11__,
20468
- id: jodit_langs_id__WEBPACK_IMPORTED_MODULE_12__,
20469
- it: jodit_langs_it__WEBPACK_IMPORTED_MODULE_13__,
20470
- ja: jodit_langs_ja__WEBPACK_IMPORTED_MODULE_14__,
20471
- ko: jodit_langs_ko__WEBPACK_IMPORTED_MODULE_16__,
20472
- mn: jodit_langs_mn__WEBPACK_IMPORTED_MODULE_17__,
20473
- nl: jodit_langs_nl__WEBPACK_IMPORTED_MODULE_18__,
20474
- no: jodit_langs_no__WEBPACK_IMPORTED_MODULE_19__,
20475
- pl: jodit_langs_pl__WEBPACK_IMPORTED_MODULE_20__,
20476
- pt_br: jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_21__,
20477
- ru: jodit_langs_ru__WEBPACK_IMPORTED_MODULE_22__,
20478
- sk: jodit_langs_sk__WEBPACK_IMPORTED_MODULE_23__,
20479
- sv: jodit_langs_sv__WEBPACK_IMPORTED_MODULE_24__,
20480
- tr: jodit_langs_tr__WEBPACK_IMPORTED_MODULE_25__,
20481
- ua: jodit_langs_ua__WEBPACK_IMPORTED_MODULE_26__,
20482
- zh_cn: jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_27__,
20483
- zh_tw: jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_28__
20526
+ ar: jodit_langs_ar__WEBPACK_IMPORTED_MODULE_2__,
20527
+ az: jodit_langs_az__WEBPACK_IMPORTED_MODULE_3__,
20528
+ cs_cz: jodit_langs_cs_cz__WEBPACK_IMPORTED_MODULE_4__,
20529
+ de: jodit_langs_de__WEBPACK_IMPORTED_MODULE_5__,
20530
+ en: jodit_langs_en__WEBPACK_IMPORTED_MODULE_6__,
20531
+ es: jodit_langs_es__WEBPACK_IMPORTED_MODULE_7__,
20532
+ fa: jodit_langs_fa__WEBPACK_IMPORTED_MODULE_8__,
20533
+ fi: jodit_langs_fi__WEBPACK_IMPORTED_MODULE_9__,
20534
+ fr: jodit_langs_fr__WEBPACK_IMPORTED_MODULE_10__,
20535
+ he: jodit_langs_he__WEBPACK_IMPORTED_MODULE_11__,
20536
+ hu: jodit_langs_hu__WEBPACK_IMPORTED_MODULE_12__,
20537
+ id: jodit_langs_id__WEBPACK_IMPORTED_MODULE_13__,
20538
+ it: jodit_langs_it__WEBPACK_IMPORTED_MODULE_14__,
20539
+ ja: jodit_langs_ja__WEBPACK_IMPORTED_MODULE_15__,
20540
+ ko: jodit_langs_ko__WEBPACK_IMPORTED_MODULE_17__,
20541
+ mn: jodit_langs_mn__WEBPACK_IMPORTED_MODULE_18__,
20542
+ nl: jodit_langs_nl__WEBPACK_IMPORTED_MODULE_19__,
20543
+ no: jodit_langs_no__WEBPACK_IMPORTED_MODULE_20__,
20544
+ pl: jodit_langs_pl__WEBPACK_IMPORTED_MODULE_21__,
20545
+ pt_br: jodit_langs_pt_br__WEBPACK_IMPORTED_MODULE_22__,
20546
+ ru: jodit_langs_ru__WEBPACK_IMPORTED_MODULE_23__,
20547
+ sk: jodit_langs_sk__WEBPACK_IMPORTED_MODULE_24__,
20548
+ sv: jodit_langs_sv__WEBPACK_IMPORTED_MODULE_25__,
20549
+ tr: jodit_langs_tr__WEBPACK_IMPORTED_MODULE_26__,
20550
+ ua: jodit_langs_ua__WEBPACK_IMPORTED_MODULE_27__,
20551
+ zh_cn: jodit_langs_zh_cn__WEBPACK_IMPORTED_MODULE_28__,
20552
+ zh_tw: jodit_langs_zh_tw__WEBPACK_IMPORTED_MODULE_29__
20484
20553
  };
20485
- /* Unpack array to hash */ const get = (value)=>value ? value.default || value : {}, hashLang = {};
20486
- if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__))) {
20487
- get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_15__).forEach((key, index)=>{
20554
+ /* 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`)
20555
+ 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 = {};
20556
+ if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__))) {
20557
+ get(jodit_langs_keys__WEBPACK_IMPORTED_MODULE_16__).forEach((key, index)=>{
20488
20558
  hashLang[index] = key;
20489
20559
  });
20490
20560
  }
@@ -28676,6 +28746,17 @@ const ns = 'addnewline';
28676
28746
  editor.editor
28677
28747
  ], '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);
28678
28748
  }
28749
+ /**
28750
+ * An empty line with a `<br>`, as Enter makes, so it keeps its height
28751
+ * without clean-html's fillEmptyParagraph (#1807)
28752
+ */ __newLine() {
28753
+ const { j } = this;
28754
+ const line = j.createInside.element(j.o.enter);
28755
+ if (!jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(line, 'br')) {
28756
+ jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(line, j.createInside.element('br'));
28757
+ }
28758
+ return line;
28759
+ }
28679
28760
  /**
28680
28761
  * A paragraph holding only an embed has no place for the caret, so the
28681
28762
  * arrow keys can't get past one that ends the content, or before one that
@@ -28688,6 +28769,11 @@ const ns = 'addnewline';
28688
28769
  return;
28689
28770
  }
28690
28771
  const { startContainer, startOffset } = editor.s.range;
28772
+ // A caret in the editor itself, as beside a horizontal line, is in no
28773
+ // paragraph, and the browsers can leave it there with text beyond (#1803)
28774
+ if (startContainer === editor.editor) {
28775
+ return;
28776
+ }
28691
28777
  // Once the browser has moved the caret, if it could. With a 0 timeout
28692
28778
  // Jodit would run this at once, before the browser moves it
28693
28779
  editor.async.setTimeout(()=>{
@@ -28696,7 +28782,7 @@ const ns = 'addnewline';
28696
28782
  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)) {
28697
28783
  return;
28698
28784
  }
28699
- const p = editor.createInside.element(editor.o.enter);
28785
+ const p = this.__newLine();
28700
28786
  forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
28701
28787
  editor.s.setCursorIn(p);
28702
28788
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
@@ -28708,7 +28794,7 @@ const ns = 'addnewline';
28708
28794
  if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
28709
28795
  const editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.offset)(editor.editor, editor, editor.ed);
28710
28796
  const top = e.pageY - editor.ew.scrollX;
28711
- const p = editor.createInside.element(editor.o.enter);
28797
+ const p = this.__newLine();
28712
28798
  if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
28713
28799
  jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
28714
28800
  } else {
@@ -28793,7 +28879,7 @@ const ns = 'addnewline';
28793
28879
  return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
28794
28880
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__onClickLine", (e)=>{
28795
28881
  const editor = this.j;
28796
- const p = editor.createInside.element(editor.o.enter);
28882
+ const p = this.__newLine();
28797
28883
  if (this.__isBeforeContent && this.__current && this.__current.parentNode) {
28798
28884
  if (this.__current === editor.editor) {
28799
28885
  jodit_modules__WEBPACK_IMPORTED_MODULE_7__.Dom.prepend(editor.editor, p);
@@ -33550,6 +33636,7 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33550
33636
  }
33551
33637
  jodit.s.expandSelection();
33552
33638
  const range = jodit.s.range;
33639
+ this.__moveEdgesIntoCells(range);
33553
33640
  const caret = this.__clearSelectedCells(range);
33554
33641
  if (caret && range.collapsed) {
33555
33642
  jodit.s.selectRange(caret);
@@ -33571,6 +33658,22 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugi
33571
33658
  jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
33572
33659
  return false;
33573
33660
  }
33661
+ /**
33662
+ * Firefox selects cells whole from their row, as after a drag into or out
33663
+ * of a table nested in a cell, and `deleteContents` would remove them. The
33664
+ * edges move into the cells, so their content is cleared instead, as in
33665
+ * Firefox's own delete
33666
+ */ __moveEdgesIntoCells(range) {
33667
+ const { startContainer, startOffset, endContainer, endOffset } = range;
33668
+ const first = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(startContainer, 'tr') ? startContainer.childNodes[startOffset] : null;
33669
+ const last = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(endContainer, 'tr') ? endContainer.childNodes[endOffset - 1] : null;
33670
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(first)) {
33671
+ range.setStart(first, 0);
33672
+ }
33673
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell(last)) {
33674
+ range.setEnd(last, last.childNodes.length);
33675
+ }
33676
+ }
33574
33677
  /**
33575
33678
  * A selection that starts or ends in a table cell clears the selected part
33576
33679
  * of each cell it covers and keeps the cells, as the browsers do.
@@ -36723,6 +36826,11 @@ function hr(editor) {
36723
36826
  return false;
36724
36827
  }
36725
36828
  const p = editor.createInside.element(editor.o.enter);
36829
+ // As Enter's new line has, so it keeps its height without clean-html's
36830
+ // fillEmptyParagraph (#1807)
36831
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, 'br')) {
36832
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(p, editor.createInside.element('br'));
36833
+ }
36726
36834
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
36727
36835
  editor.s.setCursorIn(p);
36728
36836
  return false;
@@ -42865,11 +42973,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
42865
42973
  });
42866
42974
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
42867
42975
  // The wrapper fits the media, whose size changes as its metadata loads
42868
- // and as it's resized. A percentage width is of the line, so it takes that
42976
+ // and as it's resized. It's inline, as the media is by default, so the
42977
+ // line's text-align still places it, or a block when the media is one.
42978
+ // A percentage width is of the line, so the wrapper is a block that
42979
+ // takes the line, and the media in it follows the text-align it inherits
42869
42980
  const fit = ()=>{
42981
+ const ofLine = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%');
42870
42982
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
42871
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
42872
- width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
42983
+ display: !ofLine && /^inline/.test((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(media, 'display').toString()) ? 'inline-block' : 'block',
42984
+ width: ofLine ? '' : 'fit-content',
42873
42985
  height: ''
42874
42986
  });
42875
42987
  };
@@ -45889,8 +46001,11 @@ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
45889
46001
  // is nothing measurable at all, let the wrapper size itself.
45890
46002
  const width = element.offsetWidth || attrPixelSize(element, 'width');
45891
46003
  const height = element.offsetHeight || attrPixelSize(element, 'height');
46004
+ // The wrapper takes the iframe's place in its line: inline, as an
46005
+ // iframe is by default, so the line's text-align still places it,
46006
+ // or a block when the iframe is one
45892
46007
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
45893
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
46008
+ display: /^inline/.test((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, 'display').toString()) ? 'inline-block' : 'block'
45894
46009
  });
45895
46010
  if (width) {
45896
46011
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
@@ -47224,20 +47339,13 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
47224
47339
  /**
47225
47340
  * Mouse move inside the table
47226
47341
  */ __onMove(table, e) {
47227
- var _this_j_o_shadowRoot;
47228
47342
  if (this.j.o.readonly && !this.j.isLocked) {
47229
47343
  return;
47230
47344
  }
47231
47345
  if (this.j.isLockedNotBy(key)) {
47232
47346
  return;
47233
47347
  }
47234
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
47235
- // host, so the lookup must start from the shadow root
47236
- const 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);
47237
- const cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
47238
- 'td',
47239
- 'th'
47240
- ], table);
47348
+ const cell = this.__cellUnder(e, table);
47241
47349
  if (!cell || !this.__selectedCell) {
47242
47350
  return;
47243
47351
  }
@@ -47282,32 +47390,26 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
47282
47390
  this.__isSelectionMode = false;
47283
47391
  this.__selectedCell = null;
47284
47392
  }
47393
+ // The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
47394
+ __cellUnder(e, table) {
47395
+ var _this_j_o_shadowRoot;
47396
+ // Inside Shadow DOM `document.elementFromPoint` returns the shadow
47397
+ // host, so the lookup must start from the shadow root
47398
+ const 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);
47399
+ 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);
47400
+ }
47285
47401
  /**
47286
47402
  * Stop a selection process
47287
47403
  */ __onStopSelection(table, e) {
47288
- var _this_j_o_shadowRoot;
47289
47404
  if (!this.__selectedCell) {
47290
47405
  return;
47291
47406
  }
47292
47407
  this.__isSelectionMode = false;
47293
47408
  this.j.unlock();
47294
- // Inside Shadow DOM `document.elementFromPoint` returns the shadow
47295
- // host, so the lookup must start from the shadow root
47296
- const 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);
47297
- if (!node) {
47298
- return;
47299
- }
47300
- const cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(node, [
47301
- 'td',
47302
- 'th'
47303
- ], table);
47409
+ const cell = this.__cellUnder(e, table);
47304
47410
  if (!cell) {
47305
47411
  return;
47306
47412
  }
47307
- const ownTable = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', table);
47308
- if (ownTable && ownTable !== table) {
47309
- return; // Nested tables
47310
- }
47311
47413
  this.__showCellsPopup(table, [
47312
47414
  cell,
47313
47415
  this.__selectedCell