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/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.18.1
4
+ * Version: v4.18.3
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.18.1";
1833
+ */ const APP_VERSION = "4.18.3";
1834
1834
  // prettier-ignore
1835
1835
  const ES = "es2015";
1836
1836
  const IS_ES_MODERN = true;
@@ -8860,13 +8860,13 @@ const getClassName = (obj)=>{
8860
8860
  "use strict";
8861
8861
  __webpack_require__.r(__webpack_exports__);
8862
8862
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8863
- /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
8863
+ /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.$$; },
8864
8864
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
8865
8865
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
8866
8866
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
8867
8867
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
8868
8868
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
8869
- /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
8869
+ /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_28__.LimitedStack; },
8870
8870
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
8871
8871
  /* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
8872
8872
  /* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
@@ -8878,9 +8878,9 @@ __webpack_require__.r(__webpack_exports__);
8878
8878
  /* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
8879
8879
  /* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
8880
8880
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
8881
- /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
8882
- /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
8883
- /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
8881
+ /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.call; },
8882
+ /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callPromise; },
8883
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callThis; },
8884
8884
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
8885
8885
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
8886
8886
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
@@ -8890,7 +8890,7 @@ __webpack_require__.r(__webpack_exports__);
8890
8890
  /* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
8891
8891
  /* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
8892
8892
  /* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
8893
- /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
8893
+ /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.cssPath; },
8894
8894
  /* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
8895
8895
  /* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
8896
8896
  /* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
@@ -8899,34 +8899,36 @@ __webpack_require__.r(__webpack_exports__);
8899
8899
  /* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
8900
8900
  /* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
8901
8901
  /* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
8902
- /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
8902
+ /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getDataTransfer; },
8903
8903
  /* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
8904
8904
  /* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
8905
- /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
8905
+ /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getPropertyDescriptor; },
8906
8906
  /* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
8907
- /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
8907
+ /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.getXPathByElement; },
8908
8908
  /* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
8909
8909
  /* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
8910
- /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
8910
+ /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.inView; },
8911
8911
  /* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
8912
8912
  /* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
8913
8913
  /* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
8914
- /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
8915
- /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
8914
+ /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.keys; },
8915
+ /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.loadImage; },
8916
8916
  /* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
8917
8917
  /* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
8918
8918
  /* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
8919
8919
  /* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
8920
- /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
8921
- /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
8920
+ /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.markOwner; },
8921
+ /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.memorizeExec; },
8922
8922
  /* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
8923
8923
  /* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
8924
- /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
8925
- /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
8926
- /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
8927
- /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
8928
- /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
8929
- /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
8924
+ /* harmony export */ prepareEmbedCode: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareEmbedCode; },
8925
+ /* harmony export */ prepareMedia: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareMedia; },
8926
+ /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_23__.previewBox; },
8927
+ /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.refs; },
8928
+ /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_24__.reset; },
8929
+ /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.resolveElement; },
8930
+ /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.scrollIntoViewIfNeeded; },
8931
+ /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_27__.set; },
8930
8932
  /* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
8931
8933
  /* harmony export */ });
8932
8934
  /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
@@ -8955,13 +8957,14 @@ __webpack_require__.r(__webpack_exports__);
8955
8957
  /* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
8956
8958
  /* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
8957
8959
  /* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
8958
- /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
8959
- /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
8960
- /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
8961
- /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
8962
- /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
8963
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
8964
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
8960
+ /* harmony import */ var _prepare_media__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(89214);
8961
+ /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(57075);
8962
+ /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(43379);
8963
+ /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(60898);
8964
+ /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(28723);
8965
+ /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(52144);
8966
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(42820);
8967
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(71125);
8965
8968
  /*!
8966
8969
  * Jodit Editor (https://xdsoft.net/jodit/)
8967
8970
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -8997,6 +9000,7 @@ __webpack_require__.r(__webpack_exports__);
8997
9000
 
8998
9001
 
8999
9002
 
9003
+
9000
9004
 
9001
9005
 
9002
9006
  /***/ }),
@@ -9170,6 +9174,48 @@ const isWrapper = (node, wrapper)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0
9170
9174
  /* harmony export */ ]);
9171
9175
 
9172
9176
 
9177
+ /***/ }),
9178
+
9179
+ /***/ 89214:
9180
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9181
+
9182
+ "use strict";
9183
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9184
+ /* harmony export */ prepareEmbedCode: function() { return /* binding */ prepareEmbedCode; },
9185
+ /* harmony export */ prepareMedia: function() { return /* binding */ prepareMedia; }
9186
+ /* harmony export */ });
9187
+ /* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
9188
+ /* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83314);
9189
+ /*!
9190
+ * Jodit Editor (https://xdsoft.net/jodit/)
9191
+ * Released under MIT see LICENSE.txt in the project root for license information.
9192
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
9193
+ */ /**
9194
+ * @module helpers/utils
9195
+ */
9196
+
9197
+ /**
9198
+ * Puts new media in its wrapper (see `mediaWrappers`) and aligns it with
9199
+ * `mediaDefaultAlign`. Returns the wrapper, or `element` when there is none
9200
+ */ function prepareMedia(jodit, element) {
9201
+ const media = (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__.wrapMedia)(jodit, element);
9202
+ const { mediaDefaultAlign } = jodit.o;
9203
+ if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
9204
+ (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));
9205
+ }
9206
+ return media;
9207
+ }
9208
+ /**
9209
+ * Embed code that is one element is prepared as media (see `prepareMedia`);
9210
+ * other code is returned as it is
9211
+ */ function prepareEmbedCode(jodit, code) {
9212
+ const box = jodit.createInside.div();
9213
+ box.innerHTML = code.trim();
9214
+ const element = box.firstElementChild;
9215
+ return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
9216
+ }
9217
+
9218
+
9173
9219
  /***/ }),
9174
9220
 
9175
9221
  /***/ 57075:
@@ -13407,7 +13453,9 @@ function toggleAttribute(jodit, value, elm, key, dry, mode) {
13407
13453
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, fragment);
13408
13454
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeInsertNode(range, wrapper);
13409
13455
  if (style.elementIsBlock) {
13410
- 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')) {
13456
+ // The wrapped content can bring its own `<br>` (an empty table
13457
+ // cell's), after or inside the temporary `<font>` around the selection
13458
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(wrapper) && !wrapper.querySelector('br')) {
13411
13459
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, ci.element('br'));
13412
13460
  }
13413
13461
  }
@@ -22556,13 +22604,11 @@ class Command {
22556
22604
  /* harmony export */ History: function() { return /* binding */ History; }
22557
22605
  /* harmony export */ });
22558
22606
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
22559
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
22560
- /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59609);
22561
- /* harmony import */ var jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55184);
22562
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
22563
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8838);
22564
- /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46363);
22565
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33511);
22607
+ /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
22608
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
22609
+ /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8838);
22610
+ /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(46363);
22611
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33511);
22566
22612
  /*!
22567
22613
  * Jodit Editor (https://xdsoft.net/jodit/)
22568
22614
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -22577,43 +22623,45 @@ class Command {
22577
22623
 
22578
22624
 
22579
22625
 
22580
-
22581
-
22582
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22626
+ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.history = {
22583
22627
  enable: true,
22584
22628
  maxHistoryLength: Infinity,
22585
22629
  timeout: 1000
22586
22630
  };
22587
22631
  /**
22588
22632
  * The module monitors the status of the editor and creates / deletes the required number of Undo / Redo shots .
22589
- */ class History extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_2__.ViewComponent {
22633
+ */ class History extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
22590
22634
  /** @override */ className() {
22591
22635
  return 'History';
22592
22636
  }
22593
22637
  /**
22594
22638
  * Return state of the WYSIWYG editor to step back
22595
22639
  */ redo() {
22640
+ this.__processPendingChanges();
22596
22641
  if (this.__stack.redo()) {
22597
22642
  this.startValue = this.snapshot.make();
22598
22643
  this.fireChangeStack();
22599
22644
  }
22600
22645
  }
22601
22646
  canRedo() {
22602
- return this.__stack.canRedo();
22647
+ return !this.__hasPendingChanges && this.__stack.canRedo();
22603
22648
  }
22604
22649
  /**
22605
22650
  * Return the state of the WYSIWYG editor to step forward
22606
22651
  */ undo() {
22652
+ this.__processPendingChanges();
22607
22653
  if (this.__stack.undo()) {
22608
22654
  this.startValue = this.snapshot.make();
22609
22655
  this.fireChangeStack();
22610
22656
  }
22611
22657
  }
22612
22658
  canUndo() {
22613
- return this.__stack.canUndo();
22659
+ return this.__hasPendingChanges || this.__stack.canUndo();
22614
22660
  }
22615
22661
  clear() {
22616
22662
  this.startValue = this.snapshot.make();
22663
+ this.async.clearTimeout(this.__timer);
22664
+ this.__hasPendingChanges = false;
22617
22665
  this.__stack.clear();
22618
22666
  this.fireChangeStack();
22619
22667
  }
@@ -22633,9 +22681,29 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22633
22681
  this.updateTick += 1;
22634
22682
  }
22635
22683
  /**
22636
- * Push new command in stack on some changes
22684
+ * Push new command in stack on some changes. The first change opens a
22685
+ * step, and later ones join it until `history.timeout` has passed,
22686
+ * however close together they come.
22637
22687
  */ onChange() {
22638
- this.__processChanges();
22688
+ // A transaction is over by the time the step is recorded, so it is
22689
+ // checked now
22690
+ if (this.snapshot.isBlocked || this.__hasPendingChanges) {
22691
+ return;
22692
+ }
22693
+ this.__hasPendingChanges = true;
22694
+ this.__timer = this.async.setTimeout(()=>this.__processPendingChanges(), this.j.o.history.timeout);
22695
+ // With a timeout of 0 the step is already recorded. Otherwise
22696
+ // canUndo and canRedo count it from now
22697
+ if (this.__hasPendingChanges) {
22698
+ this.fireChangeStack();
22699
+ }
22700
+ }
22701
+ /**
22702
+ * Push the open step's changes now
22703
+ */ __processPendingChanges() {
22704
+ if (this.__hasPendingChanges) {
22705
+ this.__processChanges();
22706
+ }
22639
22707
  }
22640
22708
  /**
22641
22709
  * @internal
@@ -22643,13 +22711,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22643
22711
  if (this.snapshot.isBlocked || !this.j.o.history.enable) {
22644
22712
  return;
22645
22713
  }
22714
+ this.async.clearTimeout(this.__timer);
22715
+ this.__hasPendingChanges = false;
22646
22716
  this.updateStack();
22647
22717
  }
22648
22718
  /**
22649
22719
  * Update history stack
22650
22720
  */ updateStack(replace = false) {
22651
22721
  const newValue = this.snapshot.make();
22652
- if (_snapshot__WEBPACK_IMPORTED_MODULE_6__.Snapshot.equal(newValue, this.startValue)) {
22722
+ if (_snapshot__WEBPACK_IMPORTED_MODULE_4__.Snapshot.equal(newValue, this.startValue)) {
22653
22723
  return;
22654
22724
  }
22655
22725
  // Only the selection moved, for example when the selection markers
@@ -22659,7 +22729,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22659
22729
  this.startValue = newValue;
22660
22730
  return;
22661
22731
  }
22662
- const newCommand = new _command__WEBPACK_IMPORTED_MODULE_5__.Command(this.startValue, newValue, this, this.updateTick);
22732
+ const newCommand = new _command__WEBPACK_IMPORTED_MODULE_3__.Command(this.startValue, newValue, this, this.updateTick);
22663
22733
  if (replace) {
22664
22734
  const command = this.__stack.current();
22665
22735
  if (command && this.updateTick === command.tick) {
@@ -22685,8 +22755,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22685
22755
  this.snapshot.destruct();
22686
22756
  super.destruct();
22687
22757
  }
22688
- constructor(editor, stack = new _stack__WEBPACK_IMPORTED_MODULE_7__.Stack(editor.o.history.maxHistoryLength), snapshot = new _snapshot__WEBPACK_IMPORTED_MODULE_6__.Snapshot(editor)){
22689
- 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);
22758
+ constructor(editor, stack = new _stack__WEBPACK_IMPORTED_MODULE_5__.Stack(editor.o.history.maxHistoryLength), snapshot = new _snapshot__WEBPACK_IMPORTED_MODULE_4__.Snapshot(editor)){
22759
+ 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), /**
22760
+ * A step is open: changes have come in that are not in the stack yet
22761
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hasPendingChanges", false), /**
22762
+ * Records the open step `history.timeout` after its first change
22763
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__timer", 0);
22690
22764
  this.__stack = stack;
22691
22765
  this.snapshot = snapshot;
22692
22766
  if (editor.o.history.enable) {
@@ -22697,6 +22771,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22697
22771
  this.startValue = this.snapshot.make();
22698
22772
  editor.events// save selection
22699
22773
  .on('internalChange internalUpdate', ()=>{
22774
+ this.__processPendingChanges();
22700
22775
  this.startValue = this.snapshot.make();
22701
22776
  }).on(editor.editor, [
22702
22777
  'changeSelection',
@@ -22710,14 +22785,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22710
22785
  if (this.startValue.html === this.j.getNativeEditorValue()) {
22711
22786
  this.startValue = this.snapshot.make();
22712
22787
  }
22713
- }).on(this, 'change.history', this.onChange);
22788
+ }).on(this, 'change.history', ()=>this.onChange());
22714
22789
  });
22715
22790
  }
22716
22791
  }
22717
22792
  }
22718
- ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
22719
- (0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.debounce)()
22720
- ], History.prototype, "onChange", null);
22721
22793
 
22722
22794
 
22723
22795
  /***/ }),
@@ -24319,7 +24391,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24319
24391
  const columnsCount = Table.__getColumnsCount(table);
24320
24392
  row = create.element('tr');
24321
24393
  for(let j = 0; j < columnsCount; j += 1){
24322
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, create.element('td'));
24394
+ const cell = create.element('td');
24395
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24396
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, cell);
24323
24397
  }
24324
24398
  } else {
24325
24399
  row = line.cloneNode(true);
@@ -24336,6 +24410,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24336
24410
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.each(row, (cell)=>{
24337
24411
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(cell)) {
24338
24412
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.detach(cell);
24413
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24339
24414
  }
24340
24415
  });
24341
24416
  }
@@ -24424,6 +24499,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24424
24499
  const cells = box[i];
24425
24500
  if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
24426
24501
  const cell = this.j.createInside.element('td');
24502
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, this.j.createInside.element('br'));
24427
24503
  if (insertAfter) {
24428
24504
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(cells[columnIndex], cell);
24429
24505
  } else {
@@ -24647,7 +24723,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24647
24723
  Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
24648
24724
  }
24649
24725
  }
24650
- first.innerHTML = html.join('<br/>');
24726
+ first.innerHTML = html.join('<br/>') || '<br/>';
24651
24727
  instance(jodit).addSelection(first);
24652
24728
  alreadyMerged.delete(first);
24653
24729
  Table.__unmark(__marked);
@@ -26905,8 +26981,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
26905
26981
  const box = (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
26906
26982
  // Marks this popup so its tabs auto-size to their labels (see
26907
26983
  // `.jodit-file-selector` in tabs.less) — long localized tab captions are no
26908
- // longer clipped — while leaving other tab popups (link, video …)
26909
- // untouched.
26984
+ // longer clipped — while leaving other tab popups (link …) untouched. The
26985
+ // video popup, which has an Upload tab too, uses it as well.
26910
26986
  box.classList.add('jodit-file-selector');
26911
26987
  return box;
26912
26988
  };
@@ -27991,6 +28067,10 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
27991
28067
  if (!sel.isFocused()) {
27992
28068
  sel.focus();
27993
28069
  }
28070
+ // Focused with no range, as WebKit leaves it after a click on an embed
28071
+ if (!sel.isInsideArea) {
28072
+ return;
28073
+ }
27994
28074
  if ((0,_cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_8__.checkNotCollapsed)(jodit)) {
27995
28075
  jodit.e.fire('backSpaceAfterDelete', backspace);
27996
28076
  return false;
@@ -29191,7 +29271,8 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
29191
29271
  /* harmony import */ var jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48155);
29192
29272
  /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18855);
29193
29273
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(11173);
29194
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54053);
29274
+ /* harmony import */ var _helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(35104);
29275
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(54053);
29195
29276
  /*!
29196
29277
  * Jodit Editor (https://xdsoft.net/jodit/)
29197
29278
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -29210,11 +29291,16 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
29210
29291
 
29211
29292
 
29212
29293
 
29294
+
29213
29295
  /**
29214
29296
  * Clean HTML after removeFormat and insertHorizontalRule command
29215
29297
  */ const TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
29216
29298
  class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
29217
- /** @override */ afterInit(jodit) {}
29299
+ /** @override */ afterInit() {
29300
+ // The walker's own `:afterInit` watcher is bound on that very event,
29301
+ // so without this the first pass waited for the first key or click
29302
+ this.onChangeCleanHTML();
29303
+ }
29218
29304
  get isEditMode() {
29219
29305
  return !(this.j.isInDestruct || !this.j.isEditorMode() || this.j.getReadOnly());
29220
29306
  }
@@ -29230,18 +29316,18 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29230
29316
  }
29231
29317
  startWalker() {
29232
29318
  const { jodit } = this;
29233
- const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getHash)(this.j.o.cleanHTML.allowTags);
29234
- const deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getHash)(this.j.o.cleanHTML.denyTags);
29235
- this.walker.on('visit', (node)=>(0,_helpers__WEBPACK_IMPORTED_MODULE_9__.visitNodeWalker)(jodit, node, allow, deny, this.currentSelectionNode)).on('end', (affected)=>{
29319
+ const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.allowTags);
29320
+ const deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.denyTags);
29321
+ this.walker.on('visit', (node)=>(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.visitNodeWalker)(jodit, node, allow, deny, this.currentSelectionNode)).on('end', (affected)=>{
29236
29322
  this.j.e.fire(affected ? 'internalChange finishedCleanHTMLWorker' : 'finishedCleanHTMLWorker');
29237
29323
  });
29238
29324
  }
29239
29325
  beforeCommand(command) {
29240
29326
  if (command.toLowerCase() === 'removeformat') {
29241
29327
  if (this.j.s.isCollapsed()) {
29242
- (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeFormatForCollapsedSelection)(this.j);
29328
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForCollapsedSelection)(this.j);
29243
29329
  } else {
29244
- (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeFormatForSelection)(this.j);
29330
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForSelection)(this.j);
29245
29331
  }
29246
29332
  return false;
29247
29333
  }
@@ -29267,6 +29353,7 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29267
29353
  ];
29268
29354
  sandBox.innerHTML = data.value;
29269
29355
  this.j.e.fire('safeHTML', sandBox);
29356
+ this.__replaceOldTags(sandBox);
29270
29357
  data.value = sandBox.innerHTML;
29271
29358
  (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__.safeHTML)(sandBox, {
29272
29359
  safeJavaScriptLink: true,
@@ -29275,6 +29362,20 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29275
29362
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(iframe);
29276
29363
  return false;
29277
29364
  }
29365
+ /**
29366
+ * Replace old tags (`<b>` with `<strong>`, `<i>` with `<em>`) in an
29367
+ * assigned value straight away. The walker would get to them only after
29368
+ * every node before them, seconds later on a long document, and until
29369
+ * then Bold does not treat `<b>` as bold, and the swap can move the caret.
29370
+ */ __replaceOldTags(box) {
29371
+ const { replaceOldTags: list, disableCleanFilter } = this.j.o.cleanHTML;
29372
+ if (!list || (disableCleanFilter === null || disableCleanFilter === void 0 ? void 0 : disableCleanFilter.has('replaceOldTags'))) {
29373
+ return;
29374
+ }
29375
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(box, (node)=>{
29376
+ ;(0,_helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_9__.replaceOldTags)(this.j, node, false);
29377
+ });
29378
+ }
29278
29379
  /**
29279
29380
  * Collapse a value that holds only a single empty block (e.g.
29280
29381
  * `<p><br></p>` left after deleting all content) to an empty string —
@@ -29353,10 +29454,11 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29353
29454
  ;(0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__.safeHTML)(sandBox, this.j.o.cleanHTML);
29354
29455
  }
29355
29456
  /** @override */ beforeDestruct() {
29457
+ this.j.e.off('safeHTML', this.onSafeHTML).off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue).off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
29356
29458
  this.walker.destruct();
29357
29459
  }
29358
- constructor(...args){
29359
- super(...args), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
29460
+ constructor(jodit){
29461
+ super(jodit), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
29360
29462
  {
29361
29463
  name: 'eraser',
29362
29464
  group: 'font-style'
@@ -29364,6 +29466,12 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29364
29466
  ]), (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, {
29365
29467
  timeout: this.j.o.cleanHTML.timeout
29366
29468
  }));
29469
+ // `@watch` binds once the plugin is ready, which is after the initial
29470
+ // value has already gone into the editor. The handlers that keep
29471
+ // markup out of the live tree have to be there from the start, or
29472
+ // event handlers in a textarea's content run before anything
29473
+ // sanitises them.
29474
+ jodit.e.on('safeHTML', this.onSafeHTML).on('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue).on('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
29367
29475
  }
29368
29476
  }
29369
29477
  ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
@@ -29382,16 +29490,16 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29382
29490
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeCommand')
29383
29491
  ], cleanHtml.prototype, "beforeCommand", null);
29384
29492
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29385
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':afterSetNativeEditorValue')
29493
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29386
29494
  ], cleanHtml.prototype, "onAfterSetNativeEditorValue", null);
29387
29495
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29388
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeSetNativeEditorValue')
29496
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29389
29497
  ], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
29390
29498
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29391
29499
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':afterGetValueFromEditor')
29392
29500
  ], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
29393
29501
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29394
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':safeHTML')
29502
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29395
29503
  ], cleanHtml.prototype, "onSafeHTML", null);
29396
29504
  jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('cleanHtml', cleanHtml);
29397
29505
 
@@ -30001,10 +30109,33 @@ __webpack_require__.r(__webpack_exports__);
30001
30109
  }
30002
30110
  const tagName = list[oldParent.nodeName.toLowerCase()] || list[oldParent.nodeName];
30003
30111
  if (tagName) {
30004
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
30112
+ const restoreSelection = keepSelection(jodit, oldParent);
30113
+ const newParent = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
30114
+ restoreSelection === null || restoreSelection === void 0 ? void 0 : restoreSelection(newParent);
30115
+ return newParent;
30005
30116
  }
30006
30117
  return oldParent;
30007
30118
  }
30119
+ /**
30120
+ * Moving the children out of an element collapses a selection inside them to
30121
+ * where the element was, so the caret jumps to the start of the text being
30122
+ * typed. Returns a callback that puts the selection back on the same nodes.
30123
+ *
30124
+ * Like `removeEmptyTextNode`, it leaves the selection alone once focus has
30125
+ * left the editor, because selecting would take focus back.
30126
+ */ function keepSelection(jodit, elm) {
30127
+ const { sel } = jodit.s;
30128
+ if (!(sel === null || sel === void 0 ? void 0 : sel.anchorNode) || !sel.focusNode || !jodit.s.isFocused()) {
30129
+ return null;
30130
+ }
30131
+ const { anchorNode, anchorOffset, focusNode, focusOffset } = sel;
30132
+ 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)) {
30133
+ return null;
30134
+ }
30135
+ return (newElm)=>{
30136
+ sel.setBaseAndExtent(anchorNode === elm ? newElm : anchorNode, anchorOffset, focusNode === elm ? newElm : focusNode, focusOffset);
30137
+ };
30138
+ }
30008
30139
 
30009
30140
 
30010
30141
  /***/ }),
@@ -31962,9 +32093,32 @@ const brBoxes = new Set([
31962
32093
  * @module plugins/dtd
31963
32094
  * @internal
31964
32095
  */
32096
+ /**
32097
+ * Moves the cursor out of a block that can't hold the inserted block: before
32098
+ * or after it when the cursor is at its edge, or between its two halves when
32099
+ * the cursor is inside its content. An empty block is removed
32100
+ */ function moveCursorOutOf(jodit, parent) {
32101
+ var _s_splitSelection;
32102
+ const { s } = jodit;
32103
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
32104
+ s.setCursorAfter(parent);
32105
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
32106
+ return;
32107
+ }
32108
+ if (s.cursorOnTheRight(parent)) {
32109
+ s.setCursorAfter(parent);
32110
+ return;
32111
+ }
32112
+ if (s.cursorOnTheLeft(parent)) {
32113
+ s.setCursorBefore(parent);
32114
+ return;
32115
+ }
32116
+ s.setCursorAfter((_s_splitSelection = s.splitSelection(parent)) !== null && _s_splitSelection !== void 0 ? _s_splitSelection : parent);
32117
+ }
31965
32118
  /**
31966
32119
  * Checks whether the insertion of an element at the current location is allowed,
31967
- * if it is not allowed, it deletes an empty block element or moves the cursor after it
32120
+ * if it is not allowed, it deletes an empty block element, moves the cursor
32121
+ * before or after it, or splits it at the cursor
31968
32122
  * @internal
31969
32123
  */ function checkBlockNesting(jodit, node) {
31970
32124
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node)) {
@@ -31994,10 +32148,7 @@ const brBoxes = new Set([
31994
32148
  parent = current;
31995
32149
  }
31996
32150
  if (parent) {
31997
- jodit.s.setCursorAfter(parent);
31998
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
31999
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
32000
- }
32151
+ moveCursorOutOf(jodit, parent);
32001
32152
  }
32002
32153
  }
32003
32154
  }
@@ -32527,7 +32678,14 @@ function brBefore(start) {
32527
32678
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(link, fake);
32528
32679
  } else if (s.cursorOnTheLeft(link, fake)) {
32529
32680
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(link, fake);
32681
+ } else {
32682
+ return;
32530
32683
  }
32684
+ // The block is split at the caret, so the caret leaves the link too:
32685
+ // beside the fake, since Safari mislays a caret inside a removed node
32686
+ const range = s.createRange();
32687
+ range.setStartBefore(fake);
32688
+ s.selectRange(range);
32531
32689
  }
32532
32690
  }
32533
32691
 
@@ -32773,9 +32931,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
32773
32931
 
32774
32932
  "use strict";
32775
32933
  /* unused harmony export focus */
32776
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
32777
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28077);
32778
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
32934
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
32935
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
32936
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
32937
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5266);
32779
32938
  /*!
32780
32939
  * Jodit Editor (https://xdsoft.net/jodit/)
32781
32940
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -32787,15 +32946,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
32787
32946
  */
32788
32947
 
32789
32948
 
32949
+
32790
32950
  /**
32791
32951
  * After loading the page into the editor once the focus is set
32792
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.autofocus = false;
32952
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.autofocus = false;
32793
32953
  /**
32794
32954
  * Cursor position after autofocus
32795
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.cursorAfterAutofocus = 'end';
32955
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.cursorAfterAutofocus = 'end';
32796
32956
  /**
32797
32957
  * Save current selection on blur event
32798
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.saveSelectionOnBlur = true;
32958
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.saveSelectionOnBlur = true;
32799
32959
  function focus(editor) {
32800
32960
  if (editor.o.saveSelectionOnBlur) {
32801
32961
  // A click that brings focus back places the caret itself, and Chrome
@@ -32827,10 +32987,10 @@ function focus(editor) {
32827
32987
  let textNode = null;
32828
32988
  switch(editor.o.cursorAfterAutofocus){
32829
32989
  case 'start':
32830
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.first(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node));
32990
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node));
32831
32991
  break;
32832
32992
  case 'end':
32833
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.last(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node));
32993
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.last(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node));
32834
32994
  break;
32835
32995
  }
32836
32996
  if (textNode) {
@@ -32848,7 +33008,8 @@ function focus(editor) {
32848
33008
  });
32849
33009
  editor.e.on('afterInit afterAddPlace', ()=>{
32850
33010
  editor.e.off(editor.editor, 'mousedown.autofocus').on(editor.editor, 'mousedown.autofocus', (e)=>{
32851
- if (editor.isEditorMode() && e.target && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(e.target) && !e.target.childNodes.length) {
33011
+ // An empty block takes the caret, but a video, say, can't hold one
33012
+ 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) {
32852
33013
  if (editor.editor === e.target) {
32853
33014
  editor.s.focus();
32854
33015
  } else {
@@ -32858,7 +33019,7 @@ function focus(editor) {
32858
33019
  });
32859
33020
  });
32860
33021
  }
32861
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
33022
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('focus', focus);
32862
33023
 
32863
33024
 
32864
33025
  /***/ }),
@@ -34038,18 +34199,29 @@ function hr(editor) {
34038
34199
  group: 'insert'
34039
34200
  });
34040
34201
  editor.registerCommand('insertHorizontalRule', ()=>{
34202
+ var _editor_o_dtd;
34041
34203
  const elm = editor.createInside.element('hr');
34042
34204
  editor.s.insertNode(elm, false, false);
34043
34205
  const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(elm.parentElement, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor);
34044
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor) {
34206
+ // A block that holds other blocks, such as a list item or a table
34207
+ // cell, keeps the line
34208
+ if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor && !((_editor_o_dtd = editor.o.dtd) === null || _editor_o_dtd === void 0 ? void 0 : _editor_o_dtd.blockLimits[block.nodeName.toLowerCase()])) {
34045
34209
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, elm);
34046
34210
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(block);
34047
34211
  }
34048
- let p = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.next(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor, false);
34049
- if (!p) {
34050
- p = editor.createInside.element(editor.o.enter);
34051
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
34212
+ const next = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(elm, false);
34213
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(next)) {
34214
+ editor.s.setCursorIn(next, true);
34215
+ return false;
34216
+ }
34217
+ // In a list item or a table cell the text goes on after the line, as
34218
+ // it does with the browsers' own command
34219
+ 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))) {
34220
+ editor.s.setCursorAfter(elm);
34221
+ return false;
34052
34222
  }
34223
+ const p = editor.createInside.element(editor.o.enter);
34224
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
34053
34225
  editor.s.setCursorIn(p);
34054
34226
  return false;
34055
34227
  });
@@ -34075,7 +34247,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
34075
34247
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
34076
34248
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
34077
34249
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
34078
- 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' + '}';
34250
+ 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' + '}';
34079
34251
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
34080
34252
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
34081
34253
 
@@ -36894,16 +37066,18 @@ const align = {
36894
37066
  "use strict";
36895
37067
  /* unused harmony export inlinePopup */
36896
37068
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
36897
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
36898
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84839);
36899
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27795);
36900
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
36901
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
36902
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
36903
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4099);
36904
- /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56490);
36905
- /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4274);
36906
- /* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(89873);
37069
+ /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41411);
37070
+ /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15366);
37071
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
37072
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84839);
37073
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(27795);
37074
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
37075
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65946);
37076
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91206);
37077
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4099);
37078
+ /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(56490);
37079
+ /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4274);
37080
+ /* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(89873);
36907
37081
  /*!
36908
37082
  * Jodit Editor (https://xdsoft.net/jodit/)
36909
37083
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -36924,24 +37098,45 @@ const align = {
36924
37098
 
36925
37099
 
36926
37100
 
37101
+
37102
+
36927
37103
  /**
36928
37104
  * Plugin for show inline popup dialog
36929
- */ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
37105
+ */ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
36930
37106
  get popup() {
36931
- return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__.Popup(this.jodit, false);
37107
+ return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_10__.Popup(this.jodit, false);
36932
37108
  }
36933
37109
  get toolbar() {
36934
- return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__.makeCollection)(this.jodit, this.popup);
37110
+ return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_11__.makeCollection)(this.jodit, this.popup);
36935
37111
  }
36936
37112
  onClick(node) {
36937
- const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(this.j, node), target = mediaWrapper !== null && mediaWrapper !== void 0 ? mediaWrapper : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, elements, this.j.editor);
37113
+ const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.getMediaWrapper)(this.j, node), target = mediaWrapper !== null && mediaWrapper !== void 0 ? mediaWrapper : jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.closest(node, elements, this.j.editor);
36938
37114
  // A media wrapper kept in the content gets the media popup
36939
37115
  const type = mediaWrapper ? 'jodit-media' : target === null || target === void 0 ? void 0 : target.nodeName.toLowerCase();
36940
37116
  if (target && type && this.canShowPopupForType(type)) {
36941
- this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
37117
+ const isMedia = type === 'jodit-media';
37118
+ // Beside the media in a wrapper kept in the content, which can fill
37119
+ // the line
37120
+ const bound = mediaWrapper && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.getWrappedMedia)(this.j, mediaWrapper) || target;
37121
+ this.showPopup(()=>this.__bound(bound, isMedia), type, target);
36942
37122
  return false;
36943
37123
  }
36944
37124
  }
37125
+ /**
37126
+ * The box the popup opens beside: the target's, with room for the
37127
+ * resizer's handles when the target gets them, so it doesn't cover them
37128
+ */ __bound(target, isMedia) {
37129
+ const bound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.position)(target, this.j);
37130
+ const resizable = this.j.o.allowResizeTags;
37131
+ if (!isMedia && !(resizable && jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(target, resizable))) {
37132
+ return bound;
37133
+ }
37134
+ const room = parseInt(this.j.ow.getComputedStyle(this.j.container).getPropertyValue('--jd-resizer-handle-size'), 10) / 2 || 0;
37135
+ return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, bound), {
37136
+ top: bound.top - room,
37137
+ height: bound.height + room * 2
37138
+ });
37139
+ }
36945
37140
  /**
36946
37141
  * Show inline popup with some toolbar
36947
37142
  *
@@ -36955,15 +37150,15 @@ const align = {
36955
37150
  this.previousTarget = target;
36956
37151
  const data = this.j.o.popup[type];
36957
37152
  let content;
36958
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(data)) {
37153
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isFunction)(data)) {
36959
37154
  content = data(this.j, target, this.popup.close);
36960
37155
  } else {
36961
37156
  content = data;
36962
37157
  }
36963
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isArray)(content)) {
37158
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isArray)(content)) {
36964
37159
  const disabled = this.j.o.toolbarInlineDisabledButtons;
36965
37160
  this.toolbar.build(disabled.length ? content.filter((item)=>{
36966
- const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(item) ? item : item.name;
37161
+ const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isString)(item) ? item : item.name;
36967
37162
  return !disabled.includes(name !== null && name !== void 0 ? name : '');
36968
37163
  }) : content, target);
36969
37164
  this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
@@ -36978,7 +37173,7 @@ const align = {
36978
37173
  /**
36979
37174
  * Hide opened popup
36980
37175
  */ hidePopup(type) {
36981
- if (this.popup.isOpened && (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(type) || type === this.type)) {
37176
+ if (this.popup.isOpened && (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isString)(type) || type === this.type)) {
36982
37177
  this.popup.close();
36983
37178
  }
36984
37179
  }
@@ -36997,19 +37192,19 @@ const align = {
36997
37192
  /**
36998
37193
  * For some elements do not show popup
36999
37194
  */ isExcludedTarget(type) {
37000
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.splitArray)(this.j.o.toolbarInlineDisableFor).map((a)=>a.toLowerCase()).includes(type.toLowerCase());
37195
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.splitArray)(this.j.o.toolbarInlineDisableFor).map((a)=>a.toLowerCase()).includes(type.toLowerCase());
37001
37196
  }
37002
37197
  /** @override **/ afterInit(jodit) {
37003
37198
  this.j.e.on('getDiffButtons.mobile', (toolbar)=>{
37004
37199
  if (this.toolbar === toolbar) {
37005
37200
  const names = this.toolbar.getButtonsNames();
37006
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(jodit.registeredButtons).filter((btn)=>!this.j.o.toolbarInlineDisabledButtons.includes(btn.name)).filter((item)=>{
37007
- const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(item) ? item : item.name;
37201
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.toArray)(jodit.registeredButtons).filter((btn)=>!this.j.o.toolbarInlineDisabledButtons.includes(btn.name)).filter((item)=>{
37202
+ const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isString)(item) ? item : item.name;
37008
37203
  return name && name !== '|' && name !== '\n' && !names.includes(name);
37009
37204
  });
37010
37205
  }
37011
37206
  }).on('hidePopup', this.hidePopup).on('showInlineToolbar', this.showInlineToolbar).on('showPopup', (elm, rect, type)=>{
37012
- this.showPopup(rect, type || ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(elm) ? elm : elm.nodeName), (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(elm) ? undefined : elm);
37207
+ this.showPopup(rect, type || ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isString)(elm) ? elm : elm.nodeName), (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.isString)(elm) ? undefined : elm);
37013
37208
  }).on('mousedown keydown', this.onSelectionStart).on('change', ()=>{
37014
37209
  if (this.popup.isOpened && this.previousTarget && !this.previousTarget.parentNode) {
37015
37210
  this.hidePopup();
@@ -37025,7 +37220,7 @@ const align = {
37025
37220
  this.addListenersForElements();
37026
37221
  }
37027
37222
  __onDocumentMouseDown(e) {
37028
- if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__.Popup)) {
37223
+ if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_9__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_10__.Popup)) {
37029
37224
  this.__reopenSelectionPopup = true;
37030
37225
  }
37031
37226
  }
@@ -37055,7 +37250,7 @@ const align = {
37055
37250
  const rect = this.j.s.range.getBoundingClientRect();
37056
37251
  let { left, top } = rect;
37057
37252
  if (this.j.iframe) {
37058
- const offset = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(this.j.iframe, this.j, true);
37253
+ const offset = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.position)(this.j.iframe, this.j, true);
37059
37254
  left += offset.left;
37060
37255
  top += offset.top;
37061
37256
  }
@@ -37070,7 +37265,7 @@ const align = {
37070
37265
  this.snapRange = this.j.s.range.cloneRange();
37071
37266
  }
37072
37267
  onSelectionEnd(e) {
37073
- if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__.Popup)) {
37268
+ if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_9__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_10__.Popup)) {
37074
37269
  return;
37075
37270
  }
37076
37271
  const { snapRange } = this, { range } = this.j.s;
@@ -37103,7 +37298,7 @@ const align = {
37103
37298
  * In not collapsed selection - only one image
37104
37299
  */ isSelectedTarget(r) {
37105
37300
  const sc = r.startContainer;
37106
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isElement(sc) && sc === r.endContainer && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(sc.childNodes[r.startOffset], new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.keys)(this.j.o.popup, false))) && r.startOffset === r.endOffset - 1;
37301
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isElement(sc) && sc === r.endContainer && jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(sc.childNodes[r.startOffset], new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.keys)(this.j.o.popup, false))) && r.startOffset === r.endOffset - 1;
37107
37302
  }
37108
37303
  /**
37109
37304
  * Shortcut for Table module
@@ -37127,7 +37322,7 @@ const align = {
37127
37322
  const el = [
37128
37323
  ...new Set(this.elmsList.concat(wrapperTags))
37129
37324
  ];
37130
- return el.map((e)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.camelCase)(`click_${e}`)).concat(el.map((e)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.camelCase)(`touchstart_${e}`))).join(' ');
37325
+ return el.map((e)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.camelCase)(`click_${e}`)).concat(el.map((e)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.camelCase)(`touchstart_${e}`))).join(' ');
37131
37326
  }
37132
37327
  addListenersForElements() {
37133
37328
  this.j.e.on(this._eventsList(), this.onClick);
@@ -37151,54 +37346,54 @@ const align = {
37151
37346
  * The user pressed a button inside the selection toolbar — after the
37152
37347
  * command fires `closeAllPopups`, the toolbar should be shown again
37153
37348
  * while the selection is still there. See #1238
37154
- */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.keys)(this.j.o.popup, false).filter((s)=>!this.isExcludedTarget(s)));
37349
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.keys)(this.j.o.popup, false).filter((s)=>!this.isExcludedTarget(s)));
37155
37350
  }
37156
37351
  }
37157
37352
  ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(inlinePopup, "requires", [
37158
37353
  'select'
37159
37354
  ]);
37160
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37161
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
37355
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37356
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cache
37162
37357
  ], inlinePopup.prototype, "popup", null);
37163
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37164
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
37358
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37359
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.cache
37165
37360
  ], inlinePopup.prototype, "toolbar", null);
37166
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37167
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37361
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37362
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37168
37363
  ], inlinePopup.prototype, "onClick", null);
37169
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37170
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.wait)((ctx)=>!ctx.j.isLocked)
37364
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37365
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.wait)((ctx)=>!ctx.j.isLocked)
37171
37366
  ], inlinePopup.prototype, "showPopup", null);
37172
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37173
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
37367
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37368
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.watch)([
37174
37369
  ':clickEditor',
37175
37370
  ':beforeCommandDelete',
37176
37371
  ':backSpaceAfterDelete'
37177
37372
  ]),
37178
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37373
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37179
37374
  ], inlinePopup.prototype, "hidePopup", null);
37180
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37181
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':outsideClick')
37375
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37376
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.watch)(':outsideClick')
37182
37377
  ], inlinePopup.prototype, "onOutsideClick", null);
37183
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37184
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37378
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37379
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37185
37380
  ], inlinePopup.prototype, "__onDocumentMouseDown", null);
37186
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37187
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37381
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37382
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37188
37383
  ], inlinePopup.prototype, "__onCloseAllPopups", null);
37189
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37190
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37384
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37385
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37191
37386
  ], inlinePopup.prototype, "onSelectionStart", null);
37192
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37193
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37387
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37388
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37194
37389
  ], inlinePopup.prototype, "onSelectionEnd", null);
37195
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37196
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.debounce)((ctx)=>ctx.defaultTimeout)
37390
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37391
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.debounce)((ctx)=>ctx.defaultTimeout)
37197
37392
  ], inlinePopup.prototype, "onSelectionChange", null);
37198
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37199
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
37393
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
37394
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.autobind
37200
37395
  ], inlinePopup.prototype, "showInlineToolbar", null);
37201
- jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('inlinePopup', inlinePopup);
37396
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_6__.pluginSystem.add('inlinePopup', inlinePopup);
37202
37397
 
37203
37398
 
37204
37399
  /***/ }),
@@ -38242,7 +38437,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
38242
38437
  height: (_jodit_o_video2 = jodit.o.video) === null || _jodit_o_video2 === void 0 ? void 0 : _jodit_o_video2.defaultHeight
38243
38438
  });
38244
38439
  if (embed !== html) {
38245
- return jodit.createInside.fromHTML(embed);
38440
+ const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.prepareEmbedCode)(jodit, embed);
38441
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
38246
38442
  }
38247
38443
  }
38248
38444
  if (jodit.s.isCollapsed()) {
@@ -38730,10 +38926,27 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
38730
38926
  } else {
38731
38927
  return;
38732
38928
  }
38929
+ // Selected, as an image is, so Delete and Backspace remove it
38733
38930
  editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
38734
- editor.s.setCursorAfter(element);
38931
+ editor.s.select(element);
38735
38932
  });
38736
38933
  };
38934
+ // Media in a wrapper kept in the content let clicks through to it, as
38935
+ // jodit-media covers its media, so a click selects the media rather than
38936
+ // playing it. An inline wrapper holds it as an inline-block, unless its
38937
+ // classes or style give it a display of their own
38938
+ const wrappers = Object.values(mediaWrappers);
38939
+ if (wrappers.length) {
38940
+ editor.e.on('afterInit', ()=>{
38941
+ const selectors = (list)=>[
38942
+ ...new Set(list)
38943
+ ].join(',');
38944
+ const scoped = ({ tag, className })=>`.jodit-wysiwyg ${tag}.${className}`;
38945
+ const inline = selectors(wrappers.filter(({ tag })=>jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_INLINE.test(tag)).map(scoped));
38946
+ const media = selectors(wrappers.flatMap((wrapper)=>mediaBlocks.map((tag)=>`${scoped(wrapper)}>${tag}`)));
38947
+ (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}`;
38948
+ });
38949
+ }
38737
38950
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
38738
38951
  editor.e.on('afterGetValueFromEditor', (data)=>{
38739
38952
  const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
@@ -39635,12 +39848,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39635
39848
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39636
39849
  /* harmony export */ askInsertTypeDialog: function() { return /* binding */ askInsertTypeDialog; },
39637
39850
  /* harmony export */ getAllTypes: function() { return /* binding */ getAllTypes; },
39638
- /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; }
39851
+ /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; },
39852
+ /* harmony export */ removeGoogleDocsWrapper: function() { return /* binding */ removeGoogleDocsWrapper; }
39639
39853
  /* harmony export */ });
39640
39854
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
39641
39855
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
39642
- /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28686);
39643
- /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53681);
39856
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
39857
+ /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
39858
+ /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53681);
39644
39859
  /*!
39645
39860
  * Jodit Editor (https://xdsoft.net/jodit/)
39646
39861
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -39651,6 +39866,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39651
39866
 
39652
39867
 
39653
39868
 
39869
+
39654
39870
  /**
39655
39871
  * Remove special HTML comments
39656
39872
  * @private
@@ -39666,6 +39882,21 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39666
39882
  }
39667
39883
  return html;
39668
39884
  }
39885
+ /**
39886
+ * Google Docs wraps the copied content in
39887
+ * `<b style="font-weight:normal;" id="docs-internal-guid-…">`. Kept, the
39888
+ * wrapper holds the pasted blocks, and without its style it makes the whole
39889
+ * paste bold
39890
+ * @private
39891
+ */ function removeGoogleDocsWrapper(html) {
39892
+ if (!/<b\s[^>]*docs-internal-guid-/i.test(html)) {
39893
+ return html;
39894
+ }
39895
+ // An inert document: images don't load and handlers don't run
39896
+ const { body } = new DOMParser().parseFromString(html, 'text/html');
39897
+ (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);
39898
+ return body.innerHTML;
39899
+ }
39669
39900
  /**
39670
39901
  * @private
39671
39902
  */ function isDragEvent(e) {
@@ -39682,11 +39913,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39682
39913
  editor.s.insertCursorAtPoint(e.clientX, e.clientY);
39683
39914
  }
39684
39915
  const result = editor.e.fire('beforePasteInsert', html);
39685
- 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))) {
39916
+ 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))) {
39686
39917
  html = result;
39687
39918
  }
39688
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isString)(html)) {
39689
- html = removeExtraFragments(html);
39919
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(html)) {
39920
+ html = removeExtraFragments(removeGoogleDocsWrapper(html));
39690
39921
  }
39691
39922
  editor.s.insertHTML(html);
39692
39923
  }
@@ -39696,7 +39927,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39696
39927
  */ function getAllTypes(dt) {
39697
39928
  const types = dt.types;
39698
39929
  let types_str = '';
39699
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
39930
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
39700
39931
  for(let i = 0; i < types.length; i += 1){
39701
39932
  types_str += types[i] + ';';
39702
39933
  }
@@ -39713,7 +39944,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39713
39944
  return;
39714
39945
  }
39715
39946
  const dialog = jodit.confirm(`<div style="word-break: normal; white-space: normal">${jodit.i18n(msg)}</div>`, jodit.i18n(title));
39716
- const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__.Button)(jodit, {
39947
+ const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
39717
39948
  text,
39718
39949
  name: text.toLowerCase(),
39719
39950
  tabIndex: 0
@@ -39729,7 +39960,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39729
39960
  }
39730
39961
  jodit.e.fire('afterClosePasteDialog', dialog);
39731
39962
  });
39732
- const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__.Button)(jodit, {
39963
+ const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
39733
39964
  text: 'Cancel',
39734
39965
  tabIndex: 0
39735
39966
  }).onAction(()=>{
@@ -39881,7 +40112,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.paste = {
39881
40112
  this.j.buffer.set(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.CLIPBOARD_ID, html);
39882
40113
  switch(action){
39883
40114
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSERT_CLEAR_HTML:
39884
- html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.cleanFromWord)(html);
40115
+ html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.cleanFromWord)((0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeGoogleDocsWrapper)(html));
39885
40116
  break;
39886
40117
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSERT_ONLY_TEXT:
39887
40118
  html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.stripTags)(html, this.j.ed, new Set(this.j.o.pasteExcludeStripTags), this.j.o.nl2brInPlainText);
@@ -41040,7 +41271,7 @@ const keyBInd = '__jodit-resizer_binded';
41040
41271
  addEventListeners() {
41041
41272
  const editor = this.j;
41042
41273
  editor.e.off(editor.editor, '.resizer').off(editor.ow, '.resizer').on(editor.editor, 'keydown.resizer', (e)=>{
41043
- 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')) {
41274
+ 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')) {
41044
41275
  this.onDelete(e);
41045
41276
  }
41046
41277
  }).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize).on([
@@ -41247,8 +41478,12 @@ const keyBInd = '__jodit-resizer_binded';
41247
41478
  this.j.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
41248
41479
  this.j.s.select(element);
41249
41480
  }).off(element, 'changesize').on(element, 'changesize', ()=>{
41250
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'width', element.offsetWidth + 'px');
41251
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'height', element.offsetHeight + 'px');
41481
+ // Only a resize sets the embed's size, and as the plain numbers
41482
+ // the attributes take, so a click leaves `width="100%"` alone
41483
+ if (this.isResizeMode) {
41484
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'width', element.offsetWidth);
41485
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'height', element.offsetHeight);
41486
+ }
41252
41487
  });
41253
41488
  }
41254
41489
  this.j.e.on(element, 'dragstart', this.hide);
@@ -42633,15 +42868,23 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42633
42868
  this.__tableModule.mergeSelected(table);
42634
42869
  break;
42635
42870
  case 'empty':
42636
- cells.forEach((td)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(td));
42871
+ cells.forEach((td)=>{
42872
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(td);
42873
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(td, this.j.createInside.element('br'));
42874
+ });
42637
42875
  break;
42638
42876
  case 'bin':
42639
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(table);
42877
+ this.__removeTable(table);
42640
42878
  break;
42641
42879
  case 'binrow':
42642
- new Set(cells.map((td)=>td.parentNode)).forEach((row)=>{
42643
- this.__tableModule.removeRow(table, row.rowIndex);
42644
- });
42880
+ {
42881
+ const rows = new Set(cells.map((td)=>td.parentNode));
42882
+ const next = this.__nearestCell(table, cell, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(rows).map((row)=>row.rowIndex), true);
42883
+ rows.forEach((row)=>{
42884
+ this.__tableModule.removeRow(table, row.rowIndex);
42885
+ });
42886
+ next && this.j.s.setCursorIn(next);
42887
+ }
42645
42888
  break;
42646
42889
  case 'bincolumn':
42647
42890
  {
@@ -42654,9 +42897,11 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42654
42897
  columnsSet.add(col);
42655
42898
  }
42656
42899
  });
42900
+ const next = this.__nearestCell(table, cell, columns, false);
42657
42901
  columns.sort((a, b)=>b - a).forEach((col)=>{
42658
42902
  this.__tableModule.removeColumn(table, col);
42659
42903
  });
42904
+ next && this.j.s.setCursorIn(next);
42660
42905
  }
42661
42906
  break;
42662
42907
  case 'addcolumnafter':
@@ -42668,10 +42913,36 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42668
42913
  this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
42669
42914
  break;
42670
42915
  }
42916
+ if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
42917
+ this.__removeTable(table);
42918
+ }
42671
42919
  }
42672
42920
  return false;
42673
42921
  }
42674
42922
  }
42923
+ /**
42924
+ * The cell that takes the caret when rows or columns are deleted: the next
42925
+ * one in the same column (or row) that is not deleted, else the previous one
42926
+ */ __nearestCell(table, cell, deleted, isRow) {
42927
+ const box = this.__tableModule.formalMatrix(table);
42928
+ const [row, column] = this.__tableModule.formalCoordinate(table, cell);
42929
+ const start = isRow ? row : column;
42930
+ const count = isRow ? box.length : box[row].length;
42931
+ const find = (i)=>!deleted.includes(i) && (isRow ? box[i][column] : box[row][i]) || null;
42932
+ for(let i = start + 1; i < count; i += 1){
42933
+ const next = find(i);
42934
+ if (next) {
42935
+ return next;
42936
+ }
42937
+ }
42938
+ for(let i = start - 1; i >= 0; i -= 1){
42939
+ const prev = find(i);
42940
+ if (prev) {
42941
+ return prev;
42942
+ }
42943
+ }
42944
+ return null;
42945
+ }
42675
42946
  /**
42676
42947
  * Add some align after native command
42677
42948
  */ onAfterCommand(command) {
@@ -42679,6 +42950,14 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
42679
42950
  this.__tableModule.getAllSelectedCells().forEach((elm)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.alignElement)(command, elm));
42680
42951
  }
42681
42952
  }
42953
+ /**
42954
+ * Remove the table and put the caret where it stood: at the start of what
42955
+ * follows it, else at the end of what precedes it
42956
+ */ __removeTable(table) {
42957
+ 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);
42958
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(table);
42959
+ this.j.s.setCursorIn(next || prev || parent, Boolean(next));
42960
+ }
42682
42961
  /** @override */ beforeDestruct(jodit) {
42683
42962
  this.__onRemoveSelection();
42684
42963
  jodit.e.off('.select-cells');
@@ -46012,7 +46291,7 @@ const WORK_KEYS = new Set([
46012
46291
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(next, first);
46013
46292
  editor.s.setCursorBefore(first);
46014
46293
  } else {
46015
- if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
46294
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(next)) {
46016
46295
  editor.s.select(next, true);
46017
46296
  } else {
46018
46297
  editor.s.setCursorIn(next, key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN);
@@ -46080,6 +46359,37 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
46080
46359
  useExtraClassesOptions: false
46081
46360
  };
46082
46361
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
46362
+ /**
46363
+ * Elements in `dtd.blockLimits` that hold only rows, cells or list items, so
46364
+ * a table can't go directly inside them
46365
+ */ const ROW_AND_ITEM_HOLDERS = new Set([
46366
+ 'table',
46367
+ 'thead',
46368
+ 'tbody',
46369
+ 'tfoot',
46370
+ 'tr',
46371
+ 'ul',
46372
+ 'ol',
46373
+ 'dl'
46374
+ ]);
46375
+ /**
46376
+ * The nearest block around the cursor that can hold the new table: an element
46377
+ * in `dtd.blockLimits`, such as a table cell, a list item or a `<div>`. The
46378
+ * cursor's own block of the `enter` tag is a line, not a container, as in the
46379
+ * dtd plugin's `checkBlockNesting`
46380
+ */ function findTableContainer(editor, current) {
46381
+ const line = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
46382
+ const container = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, (node)=>{
46383
+ var _editor_o_dtd;
46384
+ 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)) {
46385
+ return false;
46386
+ }
46387
+ const tag = node.nodeName.toLowerCase();
46388
+ return Boolean((_editor_o_dtd = editor.o.dtd) === null || _editor_o_dtd === void 0 ? void 0 : _editor_o_dtd.blockLimits[tag]) && !ROW_AND_ITEM_HOLDERS.has(tag);
46389
+ }, editor.editor);
46390
+ // With the cursor between two rows, `current` is the next row's text
46391
+ return container && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(container, editor.s.range.startContainer) ? container : null;
46392
+ }
46083
46393
  jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
46084
46394
  data: {
46085
46395
  cols: 10,
@@ -46177,7 +46487,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
46177
46487
  editor.s.removeMarkers();
46178
46488
  editor.editor.normalize();
46179
46489
  editor.history.snapshot.restore(snapshot);
46180
- 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);
46490
+ const current = editor.s.current();
46491
+ // The table goes into the cell, list item or box holding the
46492
+ // cursor, and only a block inside it is split
46493
+ const container = findTableContainer(editor, current);
46494
+ 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 !== null && container !== void 0 ? container : editor.editor);
46181
46495
  if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
46182
46496
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
46183
46497
  } else {
@@ -46199,6 +46513,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
46199
46513
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
46200
46514
  }
46201
46515
  }
46516
+ } else if (container && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(container) && !editor.o.table.splitBlockOnInsertTable) {
46517
+ // With no block to go after, the table goes after the text
46518
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(container, table);
46202
46519
  } else {
46203
46520
  editor.s.insertNode(table, false);
46204
46521
  }
@@ -46460,33 +46777,15 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
46460
46777
 
46461
46778
 
46462
46779
 
46463
- // Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
46464
- // with `mediaDefaultAlign`
46465
- function prepareMedia(jodit, element) {
46466
- const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
46467
- const { mediaDefaultAlign } = jodit.o;
46468
- if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
46469
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
46470
- }
46471
- return media;
46472
- }
46473
46780
  function insertVideos(data) {
46474
46781
  var _data_files;
46475
46782
  (_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach((file)=>{
46476
- this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
46783
+ this.s.insertNode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareMedia)(this, this.createInside.element('video', {
46477
46784
  controls: '',
46478
46785
  src: data.baseurl + file
46479
46786
  })));
46480
46787
  });
46481
46788
  }
46482
- // Embed code that is one element is prepared as media; other code goes in as
46483
- // it is
46484
- function prepareEmbedCode(jodit, code) {
46485
- const box = jodit.createInside.div();
46486
- box.innerHTML = code.trim();
46487
- const element = box.firstElementChild;
46488
- return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
46489
- }
46490
46789
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
46491
46790
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
46492
46791
  defaultWidth: 400,
@@ -46524,7 +46823,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
46524
46823
  ])
46525
46824
  ]), tabs = [], insertCode = (code)=>{
46526
46825
  jodit.s.restore();
46527
- jodit.s.insertHTML(prepareEmbedCode(jodit, code));
46826
+ jodit.s.insertHTML((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareEmbedCode)(jodit, code));
46528
46827
  close();
46529
46828
  };
46530
46829
  jodit.s.save();
@@ -46561,7 +46860,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
46561
46860
  formCode.onSubmit((data)=>{
46562
46861
  insertCode(data.code);
46563
46862
  });
46564
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
46863
+ const box = (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
46864
+ // Its tabs are sized to their labels, as the file selector's are, since
46865
+ // "Upload" doesn't fit a third of the popup
46866
+ box.classList.add('jodit-file-selector');
46867
+ return box;
46565
46868
  },
46566
46869
  tags: [
46567
46870
  'iframe'