jodit 4.18.1 → 4.18.3

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 (95) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/es2015/jodit.css +7 -6
  3. package/es2015/jodit.fat.min.js +10 -10
  4. package/es2015/jodit.js +492 -189
  5. package/es2015/jodit.min.js +10 -10
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +9 -9
  13. package/es2018/jodit.min.js +9 -9
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +7 -6
  17. package/es2021/jodit.fat.min.js +16 -16
  18. package/es2021/jodit.js +432 -135
  19. package/es2021/jodit.min.js +16 -16
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +7 -6
  27. package/es2021.en/jodit.fat.min.js +16 -16
  28. package/es2021.en/jodit.js +432 -135
  29. package/es2021.en/jodit.min.js +16 -16
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +8 -7
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +555 -215
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/config.d.ts +4 -2
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/helpers/utils/index.d.ts +1 -0
  53. package/esm/core/helpers/utils/index.js +1 -0
  54. package/esm/core/helpers/utils/prepare-media.d.ts +19 -0
  55. package/esm/core/helpers/utils/prepare-media.js +31 -0
  56. package/esm/core/selection/style/api/wrap-unwrapped-text.js +3 -2
  57. package/esm/modules/history/history.d.ts +17 -2
  58. package/esm/modules/history/history.js +41 -19
  59. package/esm/modules/table/table.js +7 -2
  60. package/esm/modules/widget/file-selector/file-selector.js +2 -2
  61. package/esm/plugins/backspace/backspace.js +4 -0
  62. package/esm/plugins/clean-html/clean-html.d.ts +9 -1
  63. package/esm/plugins/clean-html/clean-html.js +41 -7
  64. package/esm/plugins/clean-html/helpers/visitor/filters/replace-old-tags.js +26 -1
  65. package/esm/plugins/dtd/before-insert/check-block-nesting.d.ts +2 -1
  66. package/esm/plugins/dtd/before-insert/check-block-nesting.js +26 -5
  67. package/esm/plugins/enter/helpers/move-cursor-out-from-specal-tags.js +8 -0
  68. package/esm/plugins/focus/focus.js +3 -0
  69. package/esm/plugins/hr/hr.js +21 -5
  70. package/esm/plugins/iframe/config.js +8 -3
  71. package/esm/plugins/inline-popup/inline-popup.d.ts +5 -0
  72. package/esm/plugins/inline-popup/inline-popup.js +26 -2
  73. package/esm/plugins/link/link.js +5 -2
  74. package/esm/plugins/media/config.d.ts +2 -1
  75. package/esm/plugins/media/media.js +21 -2
  76. package/esm/plugins/paste/helpers.d.ts +8 -0
  77. package/esm/plugins/paste/helpers.js +18 -1
  78. package/esm/plugins/paste/paste.js +2 -2
  79. package/esm/plugins/resizer/resizer.js +8 -3
  80. package/esm/plugins/select-cells/select-cells.d.ts +10 -0
  81. package/esm/plugins/select-cells/select-cells.js +54 -6
  82. package/esm/plugins/table/config.js +51 -1
  83. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +1 -1
  84. package/esm/plugins/video/config.js +6 -22
  85. package/package.json +1 -1
  86. package/types/config.d.ts +4 -2
  87. package/types/core/helpers/utils/index.d.ts +1 -0
  88. package/types/core/helpers/utils/prepare-media.d.ts +19 -0
  89. package/types/modules/history/history.d.ts +17 -2
  90. package/types/plugins/clean-html/clean-html.d.ts +9 -1
  91. package/types/plugins/dtd/before-insert/check-block-nesting.d.ts +2 -1
  92. package/types/plugins/inline-popup/inline-popup.d.ts +5 -0
  93. package/types/plugins/media/config.d.ts +2 -1
  94. package/types/plugins/paste/helpers.d.ts +8 -0
  95. package/types/plugins/select-cells/select-cells.d.ts +10 -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.18.1
4
+ * Version: v4.18.3
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.18.1";
1827
+ */ const APP_VERSION = "4.18.3";
1828
1828
  // prettier-ignore
1829
1829
  const ES = "es2021";
1830
1830
  const IS_ES_MODERN = true;
@@ -8828,13 +8828,13 @@ const getClassName = (obj)=>{
8828
8828
  "use strict";
8829
8829
  __webpack_require__.r(__webpack_exports__);
8830
8830
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8831
- /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
8831
+ /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.$$; },
8832
8832
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
8833
8833
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
8834
8834
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
8835
8835
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
8836
8836
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
8837
- /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
8837
+ /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_28__.LimitedStack; },
8838
8838
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
8839
8839
  /* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
8840
8840
  /* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
@@ -8846,9 +8846,9 @@ __webpack_require__.r(__webpack_exports__);
8846
8846
  /* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
8847
8847
  /* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
8848
8848
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
8849
- /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
8850
- /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
8851
- /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
8849
+ /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.call; },
8850
+ /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callPromise; },
8851
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callThis; },
8852
8852
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
8853
8853
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
8854
8854
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
@@ -8858,7 +8858,7 @@ __webpack_require__.r(__webpack_exports__);
8858
8858
  /* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
8859
8859
  /* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
8860
8860
  /* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
8861
- /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
8861
+ /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.cssPath; },
8862
8862
  /* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
8863
8863
  /* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
8864
8864
  /* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
@@ -8867,34 +8867,36 @@ __webpack_require__.r(__webpack_exports__);
8867
8867
  /* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
8868
8868
  /* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
8869
8869
  /* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
8870
- /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
8870
+ /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getDataTransfer; },
8871
8871
  /* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
8872
8872
  /* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
8873
- /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
8873
+ /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getPropertyDescriptor; },
8874
8874
  /* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
8875
- /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
8875
+ /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.getXPathByElement; },
8876
8876
  /* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
8877
8877
  /* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
8878
- /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
8878
+ /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.inView; },
8879
8879
  /* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
8880
8880
  /* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
8881
8881
  /* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
8882
- /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
8883
- /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
8882
+ /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.keys; },
8883
+ /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.loadImage; },
8884
8884
  /* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
8885
8885
  /* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
8886
8886
  /* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
8887
8887
  /* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
8888
- /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
8889
- /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
8888
+ /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.markOwner; },
8889
+ /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.memorizeExec; },
8890
8890
  /* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
8891
8891
  /* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
8892
- /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
8893
- /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
8894
- /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
8895
- /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
8896
- /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
8897
- /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
8892
+ /* harmony export */ prepareEmbedCode: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareEmbedCode; },
8893
+ /* harmony export */ prepareMedia: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareMedia; },
8894
+ /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_23__.previewBox; },
8895
+ /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.refs; },
8896
+ /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_24__.reset; },
8897
+ /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.resolveElement; },
8898
+ /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.scrollIntoViewIfNeeded; },
8899
+ /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_27__.set; },
8898
8900
  /* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
8899
8901
  /* harmony export */ });
8900
8902
  /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
@@ -8923,13 +8925,14 @@ __webpack_require__.r(__webpack_exports__);
8923
8925
  /* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
8924
8926
  /* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
8925
8927
  /* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
8926
- /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
8927
- /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
8928
- /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
8929
- /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
8930
- /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
8931
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
8932
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
8928
+ /* harmony import */ var _prepare_media__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(89214);
8929
+ /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(57075);
8930
+ /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(43379);
8931
+ /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(60898);
8932
+ /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(28723);
8933
+ /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(52144);
8934
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(42820);
8935
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(71125);
8933
8936
  /*!
8934
8937
  * Jodit Editor (https://xdsoft.net/jodit/)
8935
8938
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -8965,6 +8968,7 @@ __webpack_require__.r(__webpack_exports__);
8965
8968
 
8966
8969
 
8967
8970
 
8971
+
8968
8972
 
8969
8973
 
8970
8974
  /***/ }),
@@ -9136,6 +9140,48 @@ const isWrapper = (node, wrapper)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0
9136
9140
  /* harmony export */ ]);
9137
9141
 
9138
9142
 
9143
+ /***/ }),
9144
+
9145
+ /***/ 89214:
9146
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9147
+
9148
+ "use strict";
9149
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9150
+ /* harmony export */ prepareEmbedCode: function() { return /* binding */ prepareEmbedCode; },
9151
+ /* harmony export */ prepareMedia: function() { return /* binding */ prepareMedia; }
9152
+ /* harmony export */ });
9153
+ /* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
9154
+ /* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83314);
9155
+ /*!
9156
+ * Jodit Editor (https://xdsoft.net/jodit/)
9157
+ * Released under MIT see LICENSE.txt in the project root for license information.
9158
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
9159
+ */ /**
9160
+ * @module helpers/utils
9161
+ */
9162
+
9163
+ /**
9164
+ * Puts new media in its wrapper (see `mediaWrappers`) and aligns it with
9165
+ * `mediaDefaultAlign`. Returns the wrapper, or `element` when there is none
9166
+ */ function prepareMedia(jodit, element) {
9167
+ const media = (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__.wrapMedia)(jodit, element);
9168
+ const { mediaDefaultAlign } = jodit.o;
9169
+ if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
9170
+ (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
9171
+ }
9172
+ return media;
9173
+ }
9174
+ /**
9175
+ * Embed code that is one element is prepared as media (see `prepareMedia`);
9176
+ * other code is returned as it is
9177
+ */ function prepareEmbedCode(jodit, code) {
9178
+ const box = jodit.createInside.div();
9179
+ box.innerHTML = code.trim();
9180
+ const element = box.firstElementChild;
9181
+ return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
9182
+ }
9183
+
9184
+
9139
9185
  /***/ }),
9140
9186
 
9141
9187
  /***/ 57075:
@@ -13314,7 +13360,9 @@ function toggleAttribute(jodit, value, elm, key, dry, mode) {
13314
13360
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, fragment);
13315
13361
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeInsertNode(range, wrapper);
13316
13362
  if (style.elementIsBlock) {
13317
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(wrapper) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(wrapper.firstElementChild, 'br')) {
13363
+ // The wrapped content can bring its own `<br>` (an empty table
13364
+ // cell's), after or inside the temporary `<font>` around the selection
13365
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(wrapper) && !wrapper.querySelector('br')) {
13318
13366
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, ci.element('br'));
13319
13367
  }
13320
13368
  }
@@ -22368,13 +22416,11 @@ class Command {
22368
22416
  /* harmony export */ History: function() { return /* binding */ History; }
22369
22417
  /* harmony export */ });
22370
22418
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
22371
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
22372
- /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59609);
22373
- /* harmony import */ var jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55184);
22374
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
22375
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8838);
22376
- /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46363);
22377
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33511);
22419
+ /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
22420
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
22421
+ /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8838);
22422
+ /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(46363);
22423
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33511);
22378
22424
  /*!
22379
22425
  * Jodit Editor (https://xdsoft.net/jodit/)
22380
22426
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -22389,43 +22435,45 @@ class Command {
22389
22435
 
22390
22436
 
22391
22437
 
22392
-
22393
-
22394
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22438
+ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.history = {
22395
22439
  enable: true,
22396
22440
  maxHistoryLength: Infinity,
22397
22441
  timeout: 1000
22398
22442
  };
22399
22443
  /**
22400
22444
  * The module monitors the status of the editor and creates / deletes the required number of Undo / Redo shots .
22401
- */ class History extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_2__.ViewComponent {
22445
+ */ class History extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
22402
22446
  /** @override */ className() {
22403
22447
  return 'History';
22404
22448
  }
22405
22449
  /**
22406
22450
  * Return state of the WYSIWYG editor to step back
22407
22451
  */ redo() {
22452
+ this.__processPendingChanges();
22408
22453
  if (this.__stack.redo()) {
22409
22454
  this.startValue = this.snapshot.make();
22410
22455
  this.fireChangeStack();
22411
22456
  }
22412
22457
  }
22413
22458
  canRedo() {
22414
- return this.__stack.canRedo();
22459
+ return !this.__hasPendingChanges && this.__stack.canRedo();
22415
22460
  }
22416
22461
  /**
22417
22462
  * Return the state of the WYSIWYG editor to step forward
22418
22463
  */ undo() {
22464
+ this.__processPendingChanges();
22419
22465
  if (this.__stack.undo()) {
22420
22466
  this.startValue = this.snapshot.make();
22421
22467
  this.fireChangeStack();
22422
22468
  }
22423
22469
  }
22424
22470
  canUndo() {
22425
- return this.__stack.canUndo();
22471
+ return this.__hasPendingChanges || this.__stack.canUndo();
22426
22472
  }
22427
22473
  clear() {
22428
22474
  this.startValue = this.snapshot.make();
22475
+ this.async.clearTimeout(this.__timer);
22476
+ this.__hasPendingChanges = false;
22429
22477
  this.__stack.clear();
22430
22478
  this.fireChangeStack();
22431
22479
  }
@@ -22445,9 +22493,29 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22445
22493
  this.updateTick += 1;
22446
22494
  }
22447
22495
  /**
22448
- * Push new command in stack on some changes
22496
+ * Push new command in stack on some changes. The first change opens a
22497
+ * step, and later ones join it until `history.timeout` has passed,
22498
+ * however close together they come.
22449
22499
  */ onChange() {
22450
- this.__processChanges();
22500
+ // A transaction is over by the time the step is recorded, so it is
22501
+ // checked now
22502
+ if (this.snapshot.isBlocked || this.__hasPendingChanges) {
22503
+ return;
22504
+ }
22505
+ this.__hasPendingChanges = true;
22506
+ this.__timer = this.async.setTimeout(()=>this.__processPendingChanges(), this.j.o.history.timeout);
22507
+ // With a timeout of 0 the step is already recorded. Otherwise
22508
+ // canUndo and canRedo count it from now
22509
+ if (this.__hasPendingChanges) {
22510
+ this.fireChangeStack();
22511
+ }
22512
+ }
22513
+ /**
22514
+ * Push the open step's changes now
22515
+ */ __processPendingChanges() {
22516
+ if (this.__hasPendingChanges) {
22517
+ this.__processChanges();
22518
+ }
22451
22519
  }
22452
22520
  /**
22453
22521
  * @internal
@@ -22455,13 +22523,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22455
22523
  if (this.snapshot.isBlocked || !this.j.o.history.enable) {
22456
22524
  return;
22457
22525
  }
22526
+ this.async.clearTimeout(this.__timer);
22527
+ this.__hasPendingChanges = false;
22458
22528
  this.updateStack();
22459
22529
  }
22460
22530
  /**
22461
22531
  * Update history stack
22462
22532
  */ updateStack(replace = false) {
22463
22533
  const newValue = this.snapshot.make();
22464
- if (_snapshot__WEBPACK_IMPORTED_MODULE_6__.Snapshot.equal(newValue, this.startValue)) {
22534
+ if (_snapshot__WEBPACK_IMPORTED_MODULE_4__.Snapshot.equal(newValue, this.startValue)) {
22465
22535
  return;
22466
22536
  }
22467
22537
  // Only the selection moved, for example when the selection markers
@@ -22471,7 +22541,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22471
22541
  this.startValue = newValue;
22472
22542
  return;
22473
22543
  }
22474
- const newCommand = new _command__WEBPACK_IMPORTED_MODULE_5__.Command(this.startValue, newValue, this, this.updateTick);
22544
+ const newCommand = new _command__WEBPACK_IMPORTED_MODULE_3__.Command(this.startValue, newValue, this, this.updateTick);
22475
22545
  if (replace) {
22476
22546
  const command = this.__stack.current();
22477
22547
  if (command && this.updateTick === command.tick) {
@@ -22496,8 +22566,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22496
22566
  this.snapshot.destruct();
22497
22567
  super.destruct();
22498
22568
  }
22499
- constructor(editor, stack = new _stack__WEBPACK_IMPORTED_MODULE_7__.Stack(editor.o.history.maxHistoryLength), snapshot = new _snapshot__WEBPACK_IMPORTED_MODULE_6__.Snapshot(editor)){
22500
- super(editor), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__startValue", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__stack", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapshot", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "updateTick", 0);
22569
+ constructor(editor, stack = new _stack__WEBPACK_IMPORTED_MODULE_5__.Stack(editor.o.history.maxHistoryLength), snapshot = new _snapshot__WEBPACK_IMPORTED_MODULE_4__.Snapshot(editor)){
22570
+ super(editor), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__startValue", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__stack", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapshot", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "updateTick", 0), /**
22571
+ * A step is open: changes have come in that are not in the stack yet
22572
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hasPendingChanges", false), /**
22573
+ * Records the open step `history.timeout` after its first change
22574
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__timer", 0);
22501
22575
  this.__stack = stack;
22502
22576
  this.snapshot = snapshot;
22503
22577
  if (editor.o.history.enable) {
@@ -22508,6 +22582,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22508
22582
  this.startValue = this.snapshot.make();
22509
22583
  editor.events// save selection
22510
22584
  .on('internalChange internalUpdate', ()=>{
22585
+ this.__processPendingChanges();
22511
22586
  this.startValue = this.snapshot.make();
22512
22587
  }).on(editor.editor, [
22513
22588
  'changeSelection',
@@ -22521,14 +22596,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22521
22596
  if (this.startValue.html === this.j.getNativeEditorValue()) {
22522
22597
  this.startValue = this.snapshot.make();
22523
22598
  }
22524
- }).on(this, 'change.history', this.onChange);
22599
+ }).on(this, 'change.history', ()=>this.onChange());
22525
22600
  });
22526
22601
  }
22527
22602
  }
22528
22603
  }
22529
- ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
22530
- (0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.debounce)()
22531
- ], History.prototype, "onChange", null);
22532
22604
 
22533
22605
 
22534
22606
  /***/ }),
@@ -24127,7 +24199,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24127
24199
  const columnsCount = Table.__getColumnsCount(table);
24128
24200
  row = create.element('tr');
24129
24201
  for(let j = 0; j < columnsCount; j += 1){
24130
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, create.element('td'));
24202
+ const cell = create.element('td');
24203
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24204
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, cell);
24131
24205
  }
24132
24206
  } else {
24133
24207
  row = line.cloneNode(true);
@@ -24144,6 +24218,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24144
24218
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.each(row, (cell)=>{
24145
24219
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(cell)) {
24146
24220
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.detach(cell);
24221
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24147
24222
  }
24148
24223
  });
24149
24224
  }
@@ -24232,6 +24307,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24232
24307
  const cells = box[i];
24233
24308
  if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
24234
24309
  const cell = this.j.createInside.element('td');
24310
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, this.j.createInside.element('br'));
24235
24311
  if (insertAfter) {
24236
24312
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(cells[columnIndex], cell);
24237
24313
  } else {
@@ -24455,7 +24531,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24455
24531
  Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
24456
24532
  }
24457
24533
  }
24458
- first.innerHTML = html.join('<br/>');
24534
+ first.innerHTML = html.join('<br/>') || '<br/>';
24459
24535
  instance(jodit).addSelection(first);
24460
24536
  alreadyMerged.delete(first);
24461
24537
  Table.__unmark(__marked);
@@ -26687,8 +26763,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
26687
26763
  const box = (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
26688
26764
  // Marks this popup so its tabs auto-size to their labels (see
26689
26765
  // `.jodit-file-selector` in tabs.less) — long localized tab captions are no
26690
- // longer clipped — while leaving other tab popups (link, video …)
26691
- // untouched.
26766
+ // longer clipped — while leaving other tab popups (link …) untouched. The
26767
+ // video popup, which has an Upload tab too, uses it as well.
26692
26768
  box.classList.add('jodit-file-selector');
26693
26769
  return box;
26694
26770
  };
@@ -27769,6 +27845,10 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
27769
27845
  if (!sel.isFocused()) {
27770
27846
  sel.focus();
27771
27847
  }
27848
+ // Focused with no range, as WebKit leaves it after a click on an embed
27849
+ if (!sel.isInsideArea) {
27850
+ return;
27851
+ }
27772
27852
  if ((0,_cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_8__.checkNotCollapsed)(jodit)) {
27773
27853
  jodit.e.fire('backSpaceAfterDelete', backspace);
27774
27854
  return false;
@@ -28964,7 +29044,8 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
28964
29044
  /* harmony import */ var jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48155);
28965
29045
  /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18855);
28966
29046
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(11173);
28967
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54053);
29047
+ /* harmony import */ var _helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(35104);
29048
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(54053);
28968
29049
  /*!
28969
29050
  * Jodit Editor (https://xdsoft.net/jodit/)
28970
29051
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28983,11 +29064,16 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
28983
29064
 
28984
29065
 
28985
29066
 
29067
+
28986
29068
  /**
28987
29069
  * Clean HTML after removeFormat and insertHorizontalRule command
28988
29070
  */ const TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
28989
29071
  class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
28990
- /** @override */ afterInit(jodit) {}
29072
+ /** @override */ afterInit() {
29073
+ // The walker's own `:afterInit` watcher is bound on that very event,
29074
+ // so without this the first pass waited for the first key or click
29075
+ this.onChangeCleanHTML();
29076
+ }
28991
29077
  get isEditMode() {
28992
29078
  return !(this.j.isInDestruct || !this.j.isEditorMode() || this.j.getReadOnly());
28993
29079
  }
@@ -29003,18 +29089,18 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29003
29089
  }
29004
29090
  startWalker() {
29005
29091
  const { jodit } = this;
29006
- const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getHash)(this.j.o.cleanHTML.allowTags);
29007
- const deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getHash)(this.j.o.cleanHTML.denyTags);
29008
- this.walker.on('visit', (node)=>(0,_helpers__WEBPACK_IMPORTED_MODULE_9__.visitNodeWalker)(jodit, node, allow, deny, this.currentSelectionNode)).on('end', (affected)=>{
29092
+ const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.allowTags);
29093
+ const deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.denyTags);
29094
+ this.walker.on('visit', (node)=>(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.visitNodeWalker)(jodit, node, allow, deny, this.currentSelectionNode)).on('end', (affected)=>{
29009
29095
  this.j.e.fire(affected ? 'internalChange finishedCleanHTMLWorker' : 'finishedCleanHTMLWorker');
29010
29096
  });
29011
29097
  }
29012
29098
  beforeCommand(command) {
29013
29099
  if (command.toLowerCase() === 'removeformat') {
29014
29100
  if (this.j.s.isCollapsed()) {
29015
- (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeFormatForCollapsedSelection)(this.j);
29101
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForCollapsedSelection)(this.j);
29016
29102
  } else {
29017
- (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeFormatForSelection)(this.j);
29103
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForSelection)(this.j);
29018
29104
  }
29019
29105
  return false;
29020
29106
  }
@@ -29040,6 +29126,7 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29040
29126
  ];
29041
29127
  sandBox.innerHTML = data.value;
29042
29128
  this.j.e.fire('safeHTML', sandBox);
29129
+ this.__replaceOldTags(sandBox);
29043
29130
  data.value = sandBox.innerHTML;
29044
29131
  (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__.safeHTML)(sandBox, {
29045
29132
  safeJavaScriptLink: true,
@@ -29048,6 +29135,20 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29048
29135
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(iframe);
29049
29136
  return false;
29050
29137
  }
29138
+ /**
29139
+ * Replace old tags (`<b>` with `<strong>`, `<i>` with `<em>`) in an
29140
+ * assigned value straight away. The walker would get to them only after
29141
+ * every node before them, seconds later on a long document, and until
29142
+ * then Bold does not treat `<b>` as bold, and the swap can move the caret.
29143
+ */ __replaceOldTags(box) {
29144
+ const { replaceOldTags: list, disableCleanFilter } = this.j.o.cleanHTML;
29145
+ if (!list || disableCleanFilter?.has('replaceOldTags')) {
29146
+ return;
29147
+ }
29148
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(box, (node)=>{
29149
+ ;(0,_helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_9__.replaceOldTags)(this.j, node, false);
29150
+ });
29151
+ }
29051
29152
  /**
29052
29153
  * Collapse a value that holds only a single empty block (e.g.
29053
29154
  * `<p><br></p>` left after deleting all content) to an empty string —
@@ -29125,10 +29226,11 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29125
29226
  ;(0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__.safeHTML)(sandBox, this.j.o.cleanHTML);
29126
29227
  }
29127
29228
  /** @override */ beforeDestruct() {
29229
+ this.j.e.off('safeHTML', this.onSafeHTML).off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue).off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
29128
29230
  this.walker.destruct();
29129
29231
  }
29130
- constructor(...args){
29131
- super(...args), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
29232
+ constructor(jodit){
29233
+ super(jodit), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
29132
29234
  {
29133
29235
  name: 'eraser',
29134
29236
  group: 'font-style'
@@ -29136,6 +29238,12 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29136
29238
  ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "currentSelectionNode", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "walker", new jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_4__.LazyWalker(this.j.async, {
29137
29239
  timeout: this.j.o.cleanHTML.timeout
29138
29240
  }));
29241
+ // `@watch` binds once the plugin is ready, which is after the initial
29242
+ // value has already gone into the editor. The handlers that keep
29243
+ // markup out of the live tree have to be there from the start, or
29244
+ // event handlers in a textarea's content run before anything
29245
+ // sanitises them.
29246
+ jodit.e.on('safeHTML', this.onSafeHTML).on('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue).on('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
29139
29247
  }
29140
29248
  }
29141
29249
  ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
@@ -29154,16 +29262,16 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29154
29262
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeCommand')
29155
29263
  ], cleanHtml.prototype, "beforeCommand", null);
29156
29264
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29157
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':afterSetNativeEditorValue')
29265
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29158
29266
  ], cleanHtml.prototype, "onAfterSetNativeEditorValue", null);
29159
29267
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29160
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeSetNativeEditorValue')
29268
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29161
29269
  ], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
29162
29270
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29163
29271
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':afterGetValueFromEditor')
29164
29272
  ], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
29165
29273
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29166
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':safeHTML')
29274
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29167
29275
  ], cleanHtml.prototype, "onSafeHTML", null);
29168
29276
  jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('cleanHtml', cleanHtml);
29169
29277
 
@@ -29773,10 +29881,33 @@ __webpack_require__.r(__webpack_exports__);
29773
29881
  }
29774
29882
  const tagName = list[oldParent.nodeName.toLowerCase()] || list[oldParent.nodeName];
29775
29883
  if (tagName) {
29776
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
29884
+ const restoreSelection = keepSelection(jodit, oldParent);
29885
+ const newParent = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
29886
+ restoreSelection?.(newParent);
29887
+ return newParent;
29777
29888
  }
29778
29889
  return oldParent;
29779
29890
  }
29891
+ /**
29892
+ * Moving the children out of an element collapses a selection inside them to
29893
+ * where the element was, so the caret jumps to the start of the text being
29894
+ * typed. Returns a callback that puts the selection back on the same nodes.
29895
+ *
29896
+ * Like `removeEmptyTextNode`, it leaves the selection alone once focus has
29897
+ * left the editor, because selecting would take focus back.
29898
+ */ function keepSelection(jodit, elm) {
29899
+ const { sel } = jodit.s;
29900
+ if (!sel?.anchorNode || !sel.focusNode || !jodit.s.isFocused()) {
29901
+ return null;
29902
+ }
29903
+ const { anchorNode, anchorOffset, focusNode, focusOffset } = sel;
29904
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(elm, anchorNode) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(elm, focusNode)) {
29905
+ return null;
29906
+ }
29907
+ return (newElm)=>{
29908
+ sel.setBaseAndExtent(anchorNode === elm ? newElm : anchorNode, anchorOffset, focusNode === elm ? newElm : focusNode, focusOffset);
29909
+ };
29910
+ }
29780
29911
 
29781
29912
 
29782
29913
  /***/ }),
@@ -31728,9 +31859,31 @@ const brBoxes = new Set([
31728
31859
  * @module plugins/dtd
31729
31860
  * @internal
31730
31861
  */
31862
+ /**
31863
+ * Moves the cursor out of a block that can't hold the inserted block: before
31864
+ * or after it when the cursor is at its edge, or between its two halves when
31865
+ * the cursor is inside its content. An empty block is removed
31866
+ */ function moveCursorOutOf(jodit, parent) {
31867
+ const { s } = jodit;
31868
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
31869
+ s.setCursorAfter(parent);
31870
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
31871
+ return;
31872
+ }
31873
+ if (s.cursorOnTheRight(parent)) {
31874
+ s.setCursorAfter(parent);
31875
+ return;
31876
+ }
31877
+ if (s.cursorOnTheLeft(parent)) {
31878
+ s.setCursorBefore(parent);
31879
+ return;
31880
+ }
31881
+ s.setCursorAfter(s.splitSelection(parent) ?? parent);
31882
+ }
31731
31883
  /**
31732
31884
  * Checks whether the insertion of an element at the current location is allowed,
31733
- * if it is not allowed, it deletes an empty block element or moves the cursor after it
31885
+ * if it is not allowed, it deletes an empty block element, moves the cursor
31886
+ * before or after it, or splits it at the cursor
31734
31887
  * @internal
31735
31888
  */ function checkBlockNesting(jodit, node) {
31736
31889
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node)) {
@@ -31758,10 +31911,7 @@ const brBoxes = new Set([
31758
31911
  parent = current;
31759
31912
  }
31760
31913
  if (parent) {
31761
- jodit.s.setCursorAfter(parent);
31762
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
31763
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
31764
- }
31914
+ moveCursorOutOf(jodit, parent);
31765
31915
  }
31766
31916
  }
31767
31917
  }
@@ -32291,7 +32441,14 @@ function brBefore(start) {
32291
32441
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(link, fake);
32292
32442
  } else if (s.cursorOnTheLeft(link, fake)) {
32293
32443
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(link, fake);
32444
+ } else {
32445
+ return;
32294
32446
  }
32447
+ // The block is split at the caret, so the caret leaves the link too:
32448
+ // beside the fake, since Safari mislays a caret inside a removed node
32449
+ const range = s.createRange();
32450
+ range.setStartBefore(fake);
32451
+ s.selectRange(range);
32295
32452
  }
32296
32453
  }
32297
32454
 
@@ -32534,9 +32691,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
32534
32691
 
32535
32692
  "use strict";
32536
32693
  /* unused harmony export focus */
32537
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
32538
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28077);
32539
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
32694
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
32695
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
32696
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
32697
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5266);
32540
32698
  /*!
32541
32699
  * Jodit Editor (https://xdsoft.net/jodit/)
32542
32700
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -32548,15 +32706,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
32548
32706
  */
32549
32707
 
32550
32708
 
32709
+
32551
32710
  /**
32552
32711
  * After loading the page into the editor once the focus is set
32553
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.autofocus = false;
32712
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.autofocus = false;
32554
32713
  /**
32555
32714
  * Cursor position after autofocus
32556
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.cursorAfterAutofocus = 'end';
32715
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.cursorAfterAutofocus = 'end';
32557
32716
  /**
32558
32717
  * Save current selection on blur event
32559
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.saveSelectionOnBlur = true;
32718
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.saveSelectionOnBlur = true;
32560
32719
  function focus(editor) {
32561
32720
  if (editor.o.saveSelectionOnBlur) {
32562
32721
  // A click that brings focus back places the caret itself, and Chrome
@@ -32588,10 +32747,10 @@ function focus(editor) {
32588
32747
  let textNode = null;
32589
32748
  switch(editor.o.cursorAfterAutofocus){
32590
32749
  case 'start':
32591
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.first(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node));
32750
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node));
32592
32751
  break;
32593
32752
  case 'end':
32594
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.last(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node));
32753
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.last(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node));
32595
32754
  break;
32596
32755
  }
32597
32756
  if (textNode) {
@@ -32609,7 +32768,8 @@ function focus(editor) {
32609
32768
  });
32610
32769
  editor.e.on('afterInit afterAddPlace', ()=>{
32611
32770
  editor.e.off(editor.editor, 'mousedown.autofocus').on(editor.editor, 'mousedown.autofocus', (e)=>{
32612
- if (editor.isEditorMode() && e.target && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(e.target) && !e.target.childNodes.length) {
32771
+ // An empty block takes the caret, but a video, say, can't hold one
32772
+ if (editor.isEditorMode() && e.target && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(e.target) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(e.target, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && !e.target.childNodes.length) {
32613
32773
  if (editor.editor === e.target) {
32614
32774
  editor.s.focus();
32615
32775
  } else {
@@ -32619,7 +32779,7 @@ function focus(editor) {
32619
32779
  });
32620
32780
  });
32621
32781
  }
32622
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
32782
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('focus', focus);
32623
32783
 
32624
32784
 
32625
32785
  /***/ }),
@@ -33780,15 +33940,25 @@ function hr(editor) {
33780
33940
  const elm = editor.createInside.element('hr');
33781
33941
  editor.s.insertNode(elm, false, false);
33782
33942
  const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(elm.parentElement, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor);
33783
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor) {
33943
+ // A block that holds other blocks, such as a list item or a table
33944
+ // cell, keeps the line
33945
+ if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor && !editor.o.dtd?.blockLimits[block.nodeName.toLowerCase()]) {
33784
33946
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, elm);
33785
33947
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(block);
33786
33948
  }
33787
- let p = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.next(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor, false);
33788
- if (!p) {
33789
- p = editor.createInside.element(editor.o.enter);
33790
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
33949
+ const next = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(elm, false);
33950
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(next)) {
33951
+ editor.s.setCursorIn(next, true);
33952
+ return false;
33953
+ }
33954
+ // In a list item or a table cell the text goes on after the line, as
33955
+ // it does with the browsers' own command
33956
+ if (next || elm.parentNode !== editor.editor && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(elm, true))) {
33957
+ editor.s.setCursorAfter(elm);
33958
+ return false;
33791
33959
  }
33960
+ const p = editor.createInside.element(editor.o.enter);
33961
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
33792
33962
  editor.s.setCursorIn(p);
33793
33963
  return false;
33794
33964
  });
@@ -33814,7 +33984,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
33814
33984
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
33815
33985
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
33816
33986
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
33817
- jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit-wysiwyg_image-selected::selection,' + '.jodit-wysiwyg_image-selected *:not(img)::selection{' + 'background:transparent' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
33987
+ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '[data-jodit_iframe_wrapper]{' + 'display: block;' + 'user-select: none;' + 'position: relative;' + '}' + '[data-jodit_iframe_wrapper] iframe{' + 'position: relative;' + '}' + '[data-jodit_iframe_wrapper]:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '[data-jodit_iframe_wrapper][data-jodit-wrapper_active=true] iframe{' + 'z-index: 2;' + '}' + '.jodit-wysiwyg_image-selected::selection,' + '.jodit-wysiwyg_image-selected *:not(img)::selection{' + 'background:transparent' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
33818
33988
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
33819
33989
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33820
33990
 
@@ -36646,10 +36816,30 @@ const align = {
36646
36816
  // A media wrapper kept in the content gets the media popup
36647
36817
  const type = mediaWrapper ? 'jodit-media' : target?.nodeName.toLowerCase();
36648
36818
  if (target && type && this.canShowPopupForType(type)) {
36649
- this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
36819
+ const isMedia = type === 'jodit-media';
36820
+ // Beside the media in a wrapper kept in the content, which can fill
36821
+ // the line
36822
+ const bound = mediaWrapper && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(this.j, mediaWrapper) || target;
36823
+ this.showPopup(()=>this.__bound(bound, isMedia), type, target);
36650
36824
  return false;
36651
36825
  }
36652
36826
  }
36827
+ /**
36828
+ * The box the popup opens beside: the target's, with room for the
36829
+ * resizer's handles when the target gets them, so it doesn't cover them
36830
+ */ __bound(target, isMedia) {
36831
+ const bound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j);
36832
+ const resizable = this.j.o.allowResizeTags;
36833
+ if (!isMedia && !(resizable && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(target, resizable))) {
36834
+ return bound;
36835
+ }
36836
+ const room = parseInt(this.j.ow.getComputedStyle(this.j.container).getPropertyValue('--jd-resizer-handle-size'), 10) / 2 || 0;
36837
+ return {
36838
+ ...bound,
36839
+ top: bound.top - room,
36840
+ height: bound.height + room * 2
36841
+ };
36842
+ }
36653
36843
  /**
36654
36844
  * Show inline popup with some toolbar
36655
36845
  *
@@ -37946,7 +38136,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
37946
38136
  height: jodit.o.video?.defaultHeight
37947
38137
  });
37948
38138
  if (embed !== html) {
37949
- return jodit.createInside.fromHTML(embed);
38139
+ const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.prepareEmbedCode)(jodit, embed);
38140
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
37950
38141
  }
37951
38142
  }
37952
38143
  if (jodit.s.isCollapsed()) {
@@ -38432,10 +38623,27 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
38432
38623
  } else {
38433
38624
  return;
38434
38625
  }
38626
+ // Selected, as an image is, so Delete and Backspace remove it
38435
38627
  editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
38436
- editor.s.setCursorAfter(element);
38628
+ editor.s.select(element);
38437
38629
  });
38438
38630
  };
38631
+ // Media in a wrapper kept in the content let clicks through to it, as
38632
+ // jodit-media covers its media, so a click selects the media rather than
38633
+ // playing it. An inline wrapper holds it as an inline-block, unless its
38634
+ // classes or style give it a display of their own
38635
+ const wrappers = Object.values(mediaWrappers);
38636
+ if (wrappers.length) {
38637
+ editor.e.on('afterInit', ()=>{
38638
+ const selectors = (list)=>[
38639
+ ...new Set(list)
38640
+ ].join(',');
38641
+ const scoped = ({ tag, className })=>`.jodit-wysiwyg ${tag}.${className}`;
38642
+ const inline = selectors(wrappers.filter(({ tag })=>jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_INLINE.test(tag)).map(scoped));
38643
+ const media = selectors(wrappers.flatMap((wrapper)=>mediaBlocks.map((tag)=>`${scoped(wrapper)}>${tag}`)));
38644
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.getContainer)(editor, 'media-wrappers', 'style', true).innerHTML = (inline ? `:where(${inline}){display:inline-block}` : '') + `${media}{pointer-events:none}`;
38645
+ });
38646
+ }
38439
38647
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
38440
38648
  editor.e.on('afterGetValueFromEditor', (data)=>{
38441
38649
  const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
@@ -39326,12 +39534,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39326
39534
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39327
39535
  /* harmony export */ askInsertTypeDialog: function() { return /* binding */ askInsertTypeDialog; },
39328
39536
  /* harmony export */ getAllTypes: function() { return /* binding */ getAllTypes; },
39329
- /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; }
39537
+ /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; },
39538
+ /* harmony export */ removeGoogleDocsWrapper: function() { return /* binding */ removeGoogleDocsWrapper; }
39330
39539
  /* harmony export */ });
39331
39540
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
39332
39541
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
39333
- /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28686);
39334
- /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53681);
39542
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
39543
+ /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
39544
+ /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53681);
39335
39545
  /*!
39336
39546
  * Jodit Editor (https://xdsoft.net/jodit/)
39337
39547
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -39342,6 +39552,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39342
39552
 
39343
39553
 
39344
39554
 
39555
+
39345
39556
  /**
39346
39557
  * Remove special HTML comments
39347
39558
  * @private
@@ -39357,6 +39568,21 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39357
39568
  }
39358
39569
  return html;
39359
39570
  }
39571
+ /**
39572
+ * Google Docs wraps the copied content in
39573
+ * `<b style="font-weight:normal;" id="docs-internal-guid-…">`. Kept, the
39574
+ * wrapper holds the pasted blocks, and without its style it makes the whole
39575
+ * paste bold
39576
+ * @private
39577
+ */ function removeGoogleDocsWrapper(html) {
39578
+ if (!/<b\s[^>]*docs-internal-guid-/i.test(html)) {
39579
+ return html;
39580
+ }
39581
+ // An inert document: images don't load and handlers don't run
39582
+ const { body } = new DOMParser().parseFromString(html, 'text/html');
39583
+ (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__.toArray)(body.querySelectorAll('b[id^="docs-internal-guid-"]')).forEach(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap);
39584
+ return body.innerHTML;
39585
+ }
39360
39586
  /**
39361
39587
  * @private
39362
39588
  */ function isDragEvent(e) {
@@ -39373,11 +39599,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39373
39599
  editor.s.insertCursorAtPoint(e.clientX, e.clientY);
39374
39600
  }
39375
39601
  const result = editor.e.fire('beforePasteInsert', html);
39376
- if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isVoid)(result) && ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isString)(result) || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isNumber)(result) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isNode(result))) {
39602
+ if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isVoid)(result) && ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(result) || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isNumber)(result) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isNode(result))) {
39377
39603
  html = result;
39378
39604
  }
39379
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isString)(html)) {
39380
- html = removeExtraFragments(html);
39605
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(html)) {
39606
+ html = removeExtraFragments(removeGoogleDocsWrapper(html));
39381
39607
  }
39382
39608
  editor.s.insertHTML(html);
39383
39609
  }
@@ -39387,7 +39613,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39387
39613
  */ function getAllTypes(dt) {
39388
39614
  const types = dt.types;
39389
39615
  let types_str = '';
39390
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
39616
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
39391
39617
  for(let i = 0; i < types.length; i += 1){
39392
39618
  types_str += types[i] + ';';
39393
39619
  }
@@ -39404,7 +39630,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39404
39630
  return;
39405
39631
  }
39406
39632
  const dialog = jodit.confirm(`<div style="word-break: normal; white-space: normal">${jodit.i18n(msg)}</div>`, jodit.i18n(title));
39407
- const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__.Button)(jodit, {
39633
+ const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
39408
39634
  text,
39409
39635
  name: text.toLowerCase(),
39410
39636
  tabIndex: 0
@@ -39420,7 +39646,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39420
39646
  }
39421
39647
  jodit.e.fire('afterClosePasteDialog', dialog);
39422
39648
  });
39423
- const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__.Button)(jodit, {
39649
+ const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
39424
39650
  text: 'Cancel',
39425
39651
  tabIndex: 0
39426
39652
  }).onAction(()=>{
@@ -39572,7 +39798,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
39572
39798
  this.j.buffer.set(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.CLIPBOARD_ID, html);
39573
39799
  switch(action){
39574
39800
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSERT_CLEAR_HTML:
39575
- html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.cleanFromWord)(html);
39801
+ html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.cleanFromWord)((0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeGoogleDocsWrapper)(html));
39576
39802
  break;
39577
39803
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSERT_ONLY_TEXT:
39578
39804
  html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.stripTags)(html, this.j.ed, new Set(this.j.o.pasteExcludeStripTags), this.j.o.nl2brInPlainText);
@@ -40729,7 +40955,7 @@ const keyBInd = '__jodit-resizer_binded';
40729
40955
  addEventListeners() {
40730
40956
  const editor = this.j;
40731
40957
  editor.e.off(editor.editor, '.resizer').off(editor.ow, '.resizer').on(editor.editor, 'keydown.resizer', (e)=>{
40732
- if (this.isShown && e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DELETE && this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'table')) {
40958
+ if (this.isShown && (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DELETE || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_BACKSPACE) && this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'table')) {
40733
40959
  this.onDelete(e);
40734
40960
  }
40735
40961
  }).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize).on([
@@ -40936,8 +41162,12 @@ const keyBInd = '__jodit-resizer_binded';
40936
41162
  this.j.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
40937
41163
  this.j.s.select(element);
40938
41164
  }).off(element, 'changesize').on(element, 'changesize', ()=>{
40939
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'width', element.offsetWidth + 'px');
40940
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'height', element.offsetHeight + 'px');
41165
+ // Only a resize sets the embed's size, and as the plain numbers
41166
+ // the attributes take, so a click leaves `width="100%"` alone
41167
+ if (this.isResizeMode) {
41168
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'width', element.offsetWidth);
41169
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'height', element.offsetHeight);
41170
+ }
40941
41171
  });
40942
41172
  }
40943
41173
  this.j.e.on(element, 'dragstart', this.hide);
@@ -42288,15 +42518,23 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42288
42518
  this.__tableModule.mergeSelected(table);
42289
42519
  break;
42290
42520
  case 'empty':
42291
- cells.forEach((td)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(td));
42521
+ cells.forEach((td)=>{
42522
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(td);
42523
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(td, this.j.createInside.element('br'));
42524
+ });
42292
42525
  break;
42293
42526
  case 'bin':
42294
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(table);
42527
+ this.__removeTable(table);
42295
42528
  break;
42296
42529
  case 'binrow':
42297
- new Set(cells.map((td)=>td.parentNode)).forEach((row)=>{
42298
- this.__tableModule.removeRow(table, row.rowIndex);
42299
- });
42530
+ {
42531
+ const rows = new Set(cells.map((td)=>td.parentNode));
42532
+ const next = this.__nearestCell(table, cell, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(rows).map((row)=>row.rowIndex), true);
42533
+ rows.forEach((row)=>{
42534
+ this.__tableModule.removeRow(table, row.rowIndex);
42535
+ });
42536
+ next && this.j.s.setCursorIn(next);
42537
+ }
42300
42538
  break;
42301
42539
  case 'bincolumn':
42302
42540
  {
@@ -42309,9 +42547,11 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42309
42547
  columnsSet.add(col);
42310
42548
  }
42311
42549
  });
42550
+ const next = this.__nearestCell(table, cell, columns, false);
42312
42551
  columns.sort((a, b)=>b - a).forEach((col)=>{
42313
42552
  this.__tableModule.removeColumn(table, col);
42314
42553
  });
42554
+ next && this.j.s.setCursorIn(next);
42315
42555
  }
42316
42556
  break;
42317
42557
  case 'addcolumnafter':
@@ -42323,10 +42563,36 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42323
42563
  this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
42324
42564
  break;
42325
42565
  }
42566
+ if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
42567
+ this.__removeTable(table);
42568
+ }
42326
42569
  }
42327
42570
  return false;
42328
42571
  }
42329
42572
  }
42573
+ /**
42574
+ * The cell that takes the caret when rows or columns are deleted: the next
42575
+ * one in the same column (or row) that is not deleted, else the previous one
42576
+ */ __nearestCell(table, cell, deleted, isRow) {
42577
+ const box = this.__tableModule.formalMatrix(table);
42578
+ const [row, column] = this.__tableModule.formalCoordinate(table, cell);
42579
+ const start = isRow ? row : column;
42580
+ const count = isRow ? box.length : box[row].length;
42581
+ const find = (i)=>!deleted.includes(i) && (isRow ? box[i][column] : box[row][i]) || null;
42582
+ for(let i = start + 1; i < count; i += 1){
42583
+ const next = find(i);
42584
+ if (next) {
42585
+ return next;
42586
+ }
42587
+ }
42588
+ for(let i = start - 1; i >= 0; i -= 1){
42589
+ const prev = find(i);
42590
+ if (prev) {
42591
+ return prev;
42592
+ }
42593
+ }
42594
+ return null;
42595
+ }
42330
42596
  /**
42331
42597
  * Add some align after native command
42332
42598
  */ onAfterCommand(command) {
@@ -42334,6 +42600,14 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42334
42600
  this.__tableModule.getAllSelectedCells().forEach((elm)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.alignElement)(command, elm));
42335
42601
  }
42336
42602
  }
42603
+ /**
42604
+ * Remove the table and put the caret where it stood: at the start of what
42605
+ * follows it, else at the end of what precedes it
42606
+ */ __removeTable(table) {
42607
+ const parent = table.parentNode, next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.findNotEmptySibling(table, false), prev = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.findNotEmptySibling(table, true);
42608
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(table);
42609
+ this.j.s.setCursorIn(next || prev || parent, Boolean(next));
42610
+ }
42337
42611
  /** @override */ beforeDestruct(jodit) {
42338
42612
  this.__onRemoveSelection();
42339
42613
  jodit.e.off('.select-cells');
@@ -45644,7 +45918,7 @@ const WORK_KEYS = new Set([
45644
45918
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(next, first);
45645
45919
  editor.s.setCursorBefore(first);
45646
45920
  } else {
45647
- if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
45921
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(next)) {
45648
45922
  editor.s.select(next, true);
45649
45923
  } else {
45650
45924
  editor.s.setCursorIn(next, key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN);
@@ -45712,6 +45986,36 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
45712
45986
  useExtraClassesOptions: false
45713
45987
  };
45714
45988
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
45989
+ /**
45990
+ * Elements in `dtd.blockLimits` that hold only rows, cells or list items, so
45991
+ * a table can't go directly inside them
45992
+ */ const ROW_AND_ITEM_HOLDERS = new Set([
45993
+ 'table',
45994
+ 'thead',
45995
+ 'tbody',
45996
+ 'tfoot',
45997
+ 'tr',
45998
+ 'ul',
45999
+ 'ol',
46000
+ 'dl'
46001
+ ]);
46002
+ /**
46003
+ * The nearest block around the cursor that can hold the new table: an element
46004
+ * in `dtd.blockLimits`, such as a table cell, a list item or a `<div>`. The
46005
+ * cursor's own block of the `enter` tag is a line, not a container, as in the
46006
+ * dtd plugin's `checkBlockNesting`
46007
+ */ function findTableContainer(editor, current) {
46008
+ const line = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
46009
+ const container = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, (node)=>{
46010
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) || node === line && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, editor.o.enter)) {
46011
+ return false;
46012
+ }
46013
+ const tag = node.nodeName.toLowerCase();
46014
+ return Boolean(editor.o.dtd?.blockLimits[tag]) && !ROW_AND_ITEM_HOLDERS.has(tag);
46015
+ }, editor.editor);
46016
+ // With the cursor between two rows, `current` is the next row's text
46017
+ return container && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(container, editor.s.range.startContainer) ? container : null;
46018
+ }
45715
46019
  jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
45716
46020
  data: {
45717
46021
  cols: 10,
@@ -45809,7 +46113,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
45809
46113
  editor.s.removeMarkers();
45810
46114
  editor.editor.normalize();
45811
46115
  editor.history.snapshot.restore(snapshot);
45812
- const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(editor.s.current(), jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
46116
+ const current = editor.s.current();
46117
+ // The table goes into the cell, list item or box holding the
46118
+ // cursor, and only a block inside it is split
46119
+ const container = findTableContainer(editor, current);
46120
+ const block = container === current ? null : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, container ?? editor.editor);
45813
46121
  if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
45814
46122
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
45815
46123
  } else {
@@ -45831,6 +46139,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
45831
46139
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
45832
46140
  }
45833
46141
  }
46142
+ } else if (container && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(container) && !editor.o.table.splitBlockOnInsertTable) {
46143
+ // With no block to go after, the table goes after the text
46144
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(container, table);
45834
46145
  } else {
45835
46146
  editor.s.insertNode(table, false);
45836
46147
  }
@@ -46092,32 +46403,14 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
46092
46403
 
46093
46404
 
46094
46405
 
46095
- // Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
46096
- // with `mediaDefaultAlign`
46097
- function prepareMedia(jodit, element) {
46098
- const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
46099
- const { mediaDefaultAlign } = jodit.o;
46100
- if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
46101
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
46102
- }
46103
- return media;
46104
- }
46105
46406
  function insertVideos(data) {
46106
46407
  data.files?.forEach((file)=>{
46107
- this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
46408
+ this.s.insertNode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareMedia)(this, this.createInside.element('video', {
46108
46409
  controls: '',
46109
46410
  src: data.baseurl + file
46110
46411
  })));
46111
46412
  });
46112
46413
  }
46113
- // Embed code that is one element is prepared as media; other code goes in as
46114
- // it is
46115
- function prepareEmbedCode(jodit, code) {
46116
- const box = jodit.createInside.div();
46117
- box.innerHTML = code.trim();
46118
- const element = box.firstElementChild;
46119
- return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
46120
- }
46121
46414
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
46122
46415
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
46123
46416
  defaultWidth: 400,
@@ -46155,7 +46448,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
46155
46448
  ])
46156
46449
  ]), tabs = [], insertCode = (code)=>{
46157
46450
  jodit.s.restore();
46158
- jodit.s.insertHTML(prepareEmbedCode(jodit, code));
46451
+ jodit.s.insertHTML((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareEmbedCode)(jodit, code));
46159
46452
  close();
46160
46453
  };
46161
46454
  jodit.s.save();
@@ -46188,7 +46481,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
46188
46481
  formCode.onSubmit((data)=>{
46189
46482
  insertCode(data.code);
46190
46483
  });
46191
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
46484
+ const box = (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
46485
+ // Its tabs are sized to their labels, as the file selector's are, since
46486
+ // "Upload" doesn't fit a third of the popup
46487
+ box.classList.add('jodit-file-selector');
46488
+ return box;
46192
46489
  },
46193
46490
  tags: [
46194
46491
  'iframe'