jodit 4.18.2 → 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 +24 -0
  2. package/es2015/jodit.css +7 -6
  3. package/es2015/jodit.fat.min.js +10 -10
  4. package/es2015/jodit.js +475 -183
  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 +415 -129
  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 +25 -25
  28. package/es2021.en/jodit.js +415 -129
  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 +536 -209
  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 +7 -0
  63. package/esm/plugins/clean-html/clean-html.js +17 -0
  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 +7 -0
  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/es5/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.18.2
4
+ * Version: v4.18.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2154,7 +2154,7 @@ __webpack_require__.r(__webpack_exports__);
2154
2154
  * @packageDocumentation
2155
2155
  * @module constants
2156
2156
  */
2157
- var APP_VERSION = "4.18.2";
2157
+ var APP_VERSION = "4.18.3";
2158
2158
  // prettier-ignore
2159
2159
  var ES = "es5";
2160
2160
  var IS_ES_MODERN = false;
@@ -9932,13 +9932,13 @@ var getClassName = function getClassName(obj) {
9932
9932
  "use strict";
9933
9933
  __webpack_require__.r(__webpack_exports__);
9934
9934
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9935
- /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
9935
+ /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.$$; },
9936
9936
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
9937
9937
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
9938
9938
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
9939
9939
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
9940
9940
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
9941
- /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
9941
+ /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_28__.LimitedStack; },
9942
9942
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
9943
9943
  /* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
9944
9944
  /* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
@@ -9950,9 +9950,9 @@ __webpack_require__.r(__webpack_exports__);
9950
9950
  /* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
9951
9951
  /* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
9952
9952
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
9953
- /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
9954
- /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
9955
- /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
9953
+ /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.call; },
9954
+ /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callPromise; },
9955
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callThis; },
9956
9956
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
9957
9957
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
9958
9958
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
@@ -9962,7 +9962,7 @@ __webpack_require__.r(__webpack_exports__);
9962
9962
  /* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
9963
9963
  /* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
9964
9964
  /* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
9965
- /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
9965
+ /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.cssPath; },
9966
9966
  /* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
9967
9967
  /* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
9968
9968
  /* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
@@ -9971,34 +9971,36 @@ __webpack_require__.r(__webpack_exports__);
9971
9971
  /* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
9972
9972
  /* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
9973
9973
  /* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
9974
- /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
9974
+ /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getDataTransfer; },
9975
9975
  /* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
9976
9976
  /* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
9977
- /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
9977
+ /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getPropertyDescriptor; },
9978
9978
  /* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
9979
- /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
9979
+ /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.getXPathByElement; },
9980
9980
  /* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
9981
9981
  /* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
9982
- /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
9982
+ /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.inView; },
9983
9983
  /* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
9984
9984
  /* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
9985
9985
  /* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
9986
- /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
9987
- /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
9986
+ /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.keys; },
9987
+ /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.loadImage; },
9988
9988
  /* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
9989
9989
  /* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
9990
9990
  /* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
9991
9991
  /* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
9992
- /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
9993
- /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
9992
+ /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.markOwner; },
9993
+ /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.memorizeExec; },
9994
9994
  /* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
9995
9995
  /* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
9996
- /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
9997
- /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
9998
- /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
9999
- /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
10000
- /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
10001
- /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
9996
+ /* harmony export */ prepareEmbedCode: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareEmbedCode; },
9997
+ /* harmony export */ prepareMedia: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareMedia; },
9998
+ /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_23__.previewBox; },
9999
+ /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.refs; },
10000
+ /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_24__.reset; },
10001
+ /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.resolveElement; },
10002
+ /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.scrollIntoViewIfNeeded; },
10003
+ /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_27__.set; },
10002
10004
  /* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
10003
10005
  /* harmony export */ });
10004
10006
  /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
@@ -10027,13 +10029,14 @@ __webpack_require__.r(__webpack_exports__);
10027
10029
  /* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
10028
10030
  /* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
10029
10031
  /* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
10030
- /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
10031
- /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
10032
- /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
10033
- /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
10034
- /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
10035
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
10036
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
10032
+ /* harmony import */ var _prepare_media__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(89214);
10033
+ /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(57075);
10034
+ /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(43379);
10035
+ /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(60898);
10036
+ /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(28723);
10037
+ /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(52144);
10038
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(42820);
10039
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(71125);
10037
10040
  /*!
10038
10041
  * Jodit Editor (https://xdsoft.net/jodit/)
10039
10042
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -10069,6 +10072,7 @@ __webpack_require__.r(__webpack_exports__);
10069
10072
 
10070
10073
 
10071
10074
 
10075
+
10072
10076
 
10073
10077
 
10074
10078
  /***/ }),
@@ -10267,6 +10271,48 @@ var isWrapper = function isWrapper(node, wrapper) {
10267
10271
  };
10268
10272
 
10269
10273
 
10274
+ /***/ }),
10275
+
10276
+ /***/ 89214:
10277
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10278
+
10279
+ "use strict";
10280
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10281
+ /* harmony export */ prepareEmbedCode: function() { return /* binding */ prepareEmbedCode; },
10282
+ /* harmony export */ prepareMedia: function() { return /* binding */ prepareMedia; }
10283
+ /* harmony export */ });
10284
+ /* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
10285
+ /* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83314);
10286
+ /*!
10287
+ * Jodit Editor (https://xdsoft.net/jodit/)
10288
+ * Released under MIT see LICENSE.txt in the project root for license information.
10289
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
10290
+ */ /**
10291
+ * @module helpers/utils
10292
+ */
10293
+
10294
+ /**
10295
+ * Puts new media in its wrapper (see `mediaWrappers`) and aligns it with
10296
+ * `mediaDefaultAlign`. Returns the wrapper, or `element` when there is none
10297
+ */ function prepareMedia(jodit, element) {
10298
+ var media = (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__.wrapMedia)(jodit, element);
10299
+ var mediaDefaultAlign = jodit.o.mediaDefaultAlign;
10300
+ if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
10301
+ (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));
10302
+ }
10303
+ return media;
10304
+ }
10305
+ /**
10306
+ * Embed code that is one element is prepared as media (see `prepareMedia`);
10307
+ * other code is returned as it is
10308
+ */ function prepareEmbedCode(jodit, code) {
10309
+ var box = jodit.createInside.div();
10310
+ box.innerHTML = code.trim();
10311
+ var element = box.firstElementChild;
10312
+ return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
10313
+ }
10314
+
10315
+
10270
10316
  /***/ }),
10271
10317
 
10272
10318
  /***/ 57075:
@@ -15349,7 +15395,9 @@ function toggleAttribute(jodit, value, elm, key, dry, mode) {
15349
15395
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, fragment);
15350
15396
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeInsertNode(range, wrapper);
15351
15397
  if (style.elementIsBlock) {
15352
- 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')) {
15398
+ // The wrapped content can bring its own `<br>` (an empty table
15399
+ // cell's), after or inside the temporary `<font>` around the selection
15400
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(wrapper) && !wrapper.querySelector('br')) {
15353
15401
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, ci.element('br'));
15354
15402
  }
15355
15403
  }
@@ -27111,13 +27159,11 @@ var Command = /*#__PURE__*/ function() {
27111
27159
  /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22248);
27112
27160
  /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(66773);
27113
27161
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34918);
27114
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
27115
- /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(59609);
27116
- /* harmony import */ var jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(55184);
27117
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5266);
27118
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8838);
27119
- /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(46363);
27120
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33511);
27162
+ /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(59609);
27163
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(5266);
27164
+ /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8838);
27165
+ /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(46363);
27166
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(33511);
27121
27167
  /*!
27122
27168
  * Jodit Editor (https://xdsoft.net/jodit/)
27123
27169
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -27138,9 +27184,7 @@ var Command = /*#__PURE__*/ function() {
27138
27184
 
27139
27185
 
27140
27186
 
27141
-
27142
-
27143
- jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27187
+ jodit_config__WEBPACK_IMPORTED_MODULE_8__.Config.prototype.history = {
27144
27188
  enable: true,
27145
27189
  maxHistoryLength: Infinity,
27146
27190
  timeout: 1000
@@ -27151,12 +27195,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27151
27195
  "use strict";
27152
27196
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__._)(History, ViewComponent);
27153
27197
  function History(editor) {
27154
- var stack = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new _stack__WEBPACK_IMPORTED_MODULE_13__.Stack(editor.o.history.maxHistoryLength), snapshot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : new _snapshot__WEBPACK_IMPORTED_MODULE_12__.Snapshot(editor);
27198
+ var stack = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new _stack__WEBPACK_IMPORTED_MODULE_11__.Stack(editor.o.history.maxHistoryLength), snapshot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : new _snapshot__WEBPACK_IMPORTED_MODULE_10__.Snapshot(editor);
27155
27199
  (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, History);
27156
27200
  var _this;
27157
27201
  _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, History, [
27158
27202
  editor
27159
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__startValue", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__stack", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "snapshot", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "updateTick", 0);
27203
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__startValue", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__stack", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "snapshot", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "updateTick", 0), /**
27204
+ * A step is open: changes have come in that are not in the stack yet
27205
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__hasPendingChanges", false), /**
27206
+ * Records the open step `history.timeout` after its first change
27207
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__timer", 0);
27160
27208
  _this.__stack = stack;
27161
27209
  _this.snapshot = snapshot;
27162
27210
  if (editor.o.history.enable) {
@@ -27167,6 +27215,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27167
27215
  _this.startValue = _this.snapshot.make();
27168
27216
  editor.events// save selection
27169
27217
  .on('internalChange internalUpdate', function() {
27218
+ _this.__processPendingChanges();
27170
27219
  _this.startValue = _this.snapshot.make();
27171
27220
  }).on(editor.editor, [
27172
27221
  'changeSelection',
@@ -27182,7 +27231,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27182
27231
  if (_this.startValue.html === _this.j.getNativeEditorValue()) {
27183
27232
  _this.startValue = _this.snapshot.make();
27184
27233
  }
27185
- }).on(_this, 'change.history', _this.onChange);
27234
+ }).on(_this, 'change.history', function() {
27235
+ return _this.onChange();
27236
+ });
27186
27237
  });
27187
27238
  }
27188
27239
  return _this;
@@ -27199,6 +27250,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27199
27250
  * Return state of the WYSIWYG editor to step back
27200
27251
  */ key: "redo",
27201
27252
  value: function redo() {
27253
+ this.__processPendingChanges();
27202
27254
  if (this.__stack.redo()) {
27203
27255
  this.startValue = this.snapshot.make();
27204
27256
  this.fireChangeStack();
@@ -27208,7 +27260,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27208
27260
  {
27209
27261
  key: "canRedo",
27210
27262
  value: function canRedo() {
27211
- return this.__stack.canRedo();
27263
+ return !this.__hasPendingChanges && this.__stack.canRedo();
27212
27264
  }
27213
27265
  },
27214
27266
  {
@@ -27216,6 +27268,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27216
27268
  * Return the state of the WYSIWYG editor to step forward
27217
27269
  */ key: "undo",
27218
27270
  value: function undo() {
27271
+ this.__processPendingChanges();
27219
27272
  if (this.__stack.undo()) {
27220
27273
  this.startValue = this.snapshot.make();
27221
27274
  this.fireChangeStack();
@@ -27225,13 +27278,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27225
27278
  {
27226
27279
  key: "canUndo",
27227
27280
  value: function canUndo() {
27228
- return this.__stack.canUndo();
27281
+ return this.__hasPendingChanges || this.__stack.canUndo();
27229
27282
  }
27230
27283
  },
27231
27284
  {
27232
27285
  key: "clear",
27233
27286
  value: function clear() {
27234
27287
  this.startValue = this.snapshot.make();
27288
+ this.async.clearTimeout(this.__timer);
27289
+ this.__hasPendingChanges = false;
27235
27290
  this.__stack.clear();
27236
27291
  this.fireChangeStack();
27237
27292
  }
@@ -27263,9 +27318,35 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27263
27318
  {
27264
27319
  key: "onChange",
27265
27320
  value: /**
27266
- * Push new command in stack on some changes
27321
+ * Push new command in stack on some changes. The first change opens a
27322
+ * step, and later ones join it until `history.timeout` has passed,
27323
+ * however close together they come.
27267
27324
  */ function onChange() {
27268
- this.__processChanges();
27325
+ var _this = this;
27326
+ // A transaction is over by the time the step is recorded, so it is
27327
+ // checked now
27328
+ if (this.snapshot.isBlocked || this.__hasPendingChanges) {
27329
+ return;
27330
+ }
27331
+ this.__hasPendingChanges = true;
27332
+ this.__timer = this.async.setTimeout(function() {
27333
+ return _this.__processPendingChanges();
27334
+ }, this.j.o.history.timeout);
27335
+ // With a timeout of 0 the step is already recorded. Otherwise
27336
+ // canUndo and canRedo count it from now
27337
+ if (this.__hasPendingChanges) {
27338
+ this.fireChangeStack();
27339
+ }
27340
+ }
27341
+ },
27342
+ {
27343
+ key: "__processPendingChanges",
27344
+ value: /**
27345
+ * Push the open step's changes now
27346
+ */ function __processPendingChanges() {
27347
+ if (this.__hasPendingChanges) {
27348
+ this.__processChanges();
27349
+ }
27269
27350
  }
27270
27351
  },
27271
27352
  {
@@ -27276,6 +27357,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27276
27357
  if (this.snapshot.isBlocked || !this.j.o.history.enable) {
27277
27358
  return;
27278
27359
  }
27360
+ this.async.clearTimeout(this.__timer);
27361
+ this.__hasPendingChanges = false;
27279
27362
  this.updateStack();
27280
27363
  }
27281
27364
  },
@@ -27286,7 +27369,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27286
27369
  */ function updateStack() {
27287
27370
  var replace = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
27288
27371
  var newValue = this.snapshot.make();
27289
- if (_snapshot__WEBPACK_IMPORTED_MODULE_12__.Snapshot.equal(newValue, this.startValue)) {
27372
+ if (_snapshot__WEBPACK_IMPORTED_MODULE_10__.Snapshot.equal(newValue, this.startValue)) {
27290
27373
  return;
27291
27374
  }
27292
27375
  // Only the selection moved, for example when the selection markers
@@ -27296,7 +27379,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27296
27379
  this.startValue = newValue;
27297
27380
  return;
27298
27381
  }
27299
- var newCommand = new _command__WEBPACK_IMPORTED_MODULE_11__.Command(this.startValue, newValue, this, this.updateTick);
27382
+ var newCommand = new _command__WEBPACK_IMPORTED_MODULE_9__.Command(this.startValue, newValue, this, this.updateTick);
27300
27383
  if (replace) {
27301
27384
  var command = this.__stack.current();
27302
27385
  if (command && this.updateTick === command.tick) {
@@ -27331,10 +27414,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.history = {
27331
27414
  }
27332
27415
  ]);
27333
27416
  return History;
27334
- }(jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_8__.ViewComponent);
27335
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
27336
- (0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_9__.debounce)()
27337
- ], History.prototype, "onChange", null);
27417
+ }(jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_7__.ViewComponent);
27338
27418
 
27339
27419
 
27340
27420
  /***/ }),
@@ -29201,6 +29281,7 @@ var Table = /*#__PURE__*/ function(ViewComponent) {
29201
29281
  var cells = box[i];
29202
29282
  if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
29203
29283
  var cell = this.j.createInside.element('td');
29284
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(cell, this.j.createInside.element('br'));
29204
29285
  if (insertAfter) {
29205
29286
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.after(cells[columnIndex], cell);
29206
29287
  } else {
@@ -29368,7 +29449,9 @@ var Table = /*#__PURE__*/ function(ViewComponent) {
29368
29449
  var columnsCount = Table.__getColumnsCount(table);
29369
29450
  row = create.element('tr');
29370
29451
  for(var j = 0; j < columnsCount; j += 1){
29371
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(row, create.element('td'));
29452
+ var cell = create.element('td');
29453
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(cell, create.element('br'));
29454
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(row, cell);
29372
29455
  }
29373
29456
  } else {
29374
29457
  row = line.cloneNode(true);
@@ -29385,6 +29468,7 @@ var Table = /*#__PURE__*/ function(ViewComponent) {
29385
29468
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.each(row, function(cell) {
29386
29469
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.isCell(cell)) {
29387
29470
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.detach(cell);
29471
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_12__.Dom.append(cell, create.element('br'));
29388
29472
  }
29389
29473
  });
29390
29474
  }
@@ -29663,7 +29747,7 @@ var Table = /*#__PURE__*/ function(ViewComponent) {
29663
29747
  Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
29664
29748
  }
29665
29749
  }
29666
- first.innerHTML = html.join('<br/>');
29750
+ first.innerHTML = html.join('<br/>') || '<br/>';
29667
29751
  instance(jodit).addSelection(first);
29668
29752
  alreadyMerged.delete(first);
29669
29753
  Table.__unmark(__marked);
@@ -32329,8 +32413,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
32329
32413
  var box = (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
32330
32414
  // Marks this popup so its tabs auto-size to their labels (see
32331
32415
  // `.jodit-file-selector` in tabs.less) — long localized tab captions are no
32332
- // longer clipped — while leaving other tab popups (link, video …)
32333
- // untouched.
32416
+ // longer clipped — while leaving other tab popups (link …) untouched. The
32417
+ // video popup, which has an Upload tab too, uses it as well.
32334
32418
  box.classList.add('jodit-file-selector');
32335
32419
  return box;
32336
32420
  };
@@ -33604,6 +33688,10 @@ var backspace = /*#__PURE__*/ function(Plugin) {
33604
33688
  if (!sel.isFocused()) {
33605
33689
  sel.focus();
33606
33690
  }
33691
+ // Focused with no range, as WebKit leaves it after a click on an embed
33692
+ if (!sel.isInsideArea) {
33693
+ return;
33694
+ }
33607
33695
  if ((0,_cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_14__.checkNotCollapsed)(jodit)) {
33608
33696
  jodit.e.fire('backSpaceAfterDelete', backspace);
33609
33697
  return false;
@@ -34855,7 +34943,8 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34855
34943
  /* harmony import */ var jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(48155);
34856
34944
  /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18855);
34857
34945
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(11173);
34858
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(54053);
34946
+ /* harmony import */ var _helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(35104);
34947
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(54053);
34859
34948
  /*!
34860
34949
  * Jodit Editor (https://xdsoft.net/jodit/)
34861
34950
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34881,6 +34970,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34881
34970
 
34882
34971
 
34883
34972
 
34973
+
34884
34974
  /**
34885
34975
  * Clean HTML after removeFormat and insertHorizontalRule command
34886
34976
  */ var TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
@@ -34941,10 +35031,10 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34941
35031
  value: function startWalker() {
34942
35032
  var _this = this;
34943
35033
  var jodit = this.jodit;
34944
- var allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.getHash)(this.j.o.cleanHTML.allowTags);
34945
- var deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.getHash)(this.j.o.cleanHTML.denyTags);
35034
+ var allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.getHash)(this.j.o.cleanHTML.allowTags);
35035
+ var deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.getHash)(this.j.o.cleanHTML.denyTags);
34946
35036
  this.walker.on('visit', function(node) {
34947
- return (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.visitNodeWalker)(jodit, node, allow, deny, _this.currentSelectionNode);
35037
+ return (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.visitNodeWalker)(jodit, node, allow, deny, _this.currentSelectionNode);
34948
35038
  }).on('end', function(affected) {
34949
35039
  _this.j.e.fire(affected ? 'internalChange finishedCleanHTMLWorker' : 'finishedCleanHTMLWorker');
34950
35040
  });
@@ -34955,9 +35045,9 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34955
35045
  value: function beforeCommand(command) {
34956
35046
  if (command.toLowerCase() === 'removeformat') {
34957
35047
  if (this.j.s.isCollapsed()) {
34958
- (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.removeFormatForCollapsedSelection)(this.j);
35048
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.removeFormatForCollapsedSelection)(this.j);
34959
35049
  } else {
34960
- (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.removeFormatForSelection)(this.j);
35050
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.removeFormatForSelection)(this.j);
34961
35051
  }
34962
35052
  return false;
34963
35053
  }
@@ -34989,6 +35079,7 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34989
35079
  ], 2), sandBox = _ref[0], iframe = _ref[1];
34990
35080
  sandBox.innerHTML = data.value;
34991
35081
  this.j.e.fire('safeHTML', sandBox);
35082
+ this.__replaceOldTags(sandBox);
34992
35083
  data.value = sandBox.innerHTML;
34993
35084
  (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_13__.safeHTML)(sandBox, {
34994
35085
  safeJavaScriptLink: true,
@@ -34998,6 +35089,24 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34998
35089
  return false;
34999
35090
  }
35000
35091
  },
35092
+ {
35093
+ key: "__replaceOldTags",
35094
+ value: /**
35095
+ * Replace old tags (`<b>` with `<strong>`, `<i>` with `<em>`) in an
35096
+ * assigned value straight away. The walker would get to them only after
35097
+ * every node before them, seconds later on a long document, and until
35098
+ * then Bold does not treat `<b>` as bold, and the swap can move the caret.
35099
+ */ function __replaceOldTags(box) {
35100
+ var _this = this;
35101
+ var _this_j_o_cleanHTML = this.j.o.cleanHTML, list = _this_j_o_cleanHTML.replaceOldTags, disableCleanFilter = _this_j_o_cleanHTML.disableCleanFilter;
35102
+ if (!list || (disableCleanFilter === null || disableCleanFilter === void 0 ? void 0 : disableCleanFilter.has('replaceOldTags'))) {
35103
+ return;
35104
+ }
35105
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.each(box, function(node) {
35106
+ ;(0,_helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_16__.replaceOldTags)(_this.j, node, false);
35107
+ });
35108
+ }
35109
+ },
35001
35110
  {
35002
35111
  key: "onAfterGetValueFromEditor",
35003
35112
  value: /**
@@ -35735,10 +35844,33 @@ __webpack_require__.r(__webpack_exports__);
35735
35844
  }
35736
35845
  var tagName = list[oldParent.nodeName.toLowerCase()] || list[oldParent.nodeName];
35737
35846
  if (tagName) {
35738
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
35847
+ var restoreSelection = keepSelection(jodit, oldParent);
35848
+ var newParent = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
35849
+ restoreSelection === null || restoreSelection === void 0 ? void 0 : restoreSelection(newParent);
35850
+ return newParent;
35739
35851
  }
35740
35852
  return oldParent;
35741
35853
  }
35854
+ /**
35855
+ * Moving the children out of an element collapses a selection inside them to
35856
+ * where the element was, so the caret jumps to the start of the text being
35857
+ * typed. Returns a callback that puts the selection back on the same nodes.
35858
+ *
35859
+ * Like `removeEmptyTextNode`, it leaves the selection alone once focus has
35860
+ * left the editor, because selecting would take focus back.
35861
+ */ function keepSelection(jodit, elm) {
35862
+ var sel = jodit.s.sel;
35863
+ if (!(sel === null || sel === void 0 ? void 0 : sel.anchorNode) || !sel.focusNode || !jodit.s.isFocused()) {
35864
+ return null;
35865
+ }
35866
+ var anchorNode = sel.anchorNode, anchorOffset = sel.anchorOffset, focusNode = sel.focusNode, focusOffset = sel.focusOffset;
35867
+ 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)) {
35868
+ return null;
35869
+ }
35870
+ return function(newElm) {
35871
+ sel.setBaseAndExtent(anchorNode === elm ? newElm : anchorNode, anchorOffset, focusNode === elm ? newElm : focusNode, focusOffset);
35872
+ };
35873
+ }
35742
35874
 
35743
35875
 
35744
35876
  /***/ }),
@@ -37936,9 +38068,32 @@ var brBoxes = new Set([
37936
38068
  * @module plugins/dtd
37937
38069
  * @internal
37938
38070
  */
38071
+ /**
38072
+ * Moves the cursor out of a block that can't hold the inserted block: before
38073
+ * or after it when the cursor is at its edge, or between its two halves when
38074
+ * the cursor is inside its content. An empty block is removed
38075
+ */ function moveCursorOutOf(jodit, parent) {
38076
+ var _s_splitSelection;
38077
+ var s = jodit.s;
38078
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
38079
+ s.setCursorAfter(parent);
38080
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
38081
+ return;
38082
+ }
38083
+ if (s.cursorOnTheRight(parent)) {
38084
+ s.setCursorAfter(parent);
38085
+ return;
38086
+ }
38087
+ if (s.cursorOnTheLeft(parent)) {
38088
+ s.setCursorBefore(parent);
38089
+ return;
38090
+ }
38091
+ s.setCursorAfter((_s_splitSelection = s.splitSelection(parent)) !== null && _s_splitSelection !== void 0 ? _s_splitSelection : parent);
38092
+ }
37939
38093
  /**
37940
38094
  * Checks whether the insertion of an element at the current location is allowed,
37941
- * if it is not allowed, it deletes an empty block element or moves the cursor after it
38095
+ * if it is not allowed, it deletes an empty block element, moves the cursor
38096
+ * before or after it, or splits it at the cursor
37942
38097
  * @internal
37943
38098
  */ function checkBlockNesting(jodit, node) {
37944
38099
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node)) {
@@ -37968,10 +38123,7 @@ var brBoxes = new Set([
37968
38123
  parent = current;
37969
38124
  }
37970
38125
  if (parent) {
37971
- jodit.s.setCursorAfter(parent);
37972
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
37973
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
37974
- }
38126
+ moveCursorOutOf(jodit, parent);
37975
38127
  }
37976
38128
  }
37977
38129
  }
@@ -38576,7 +38728,14 @@ function brBefore(start) {
38576
38728
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(link, fake);
38577
38729
  } else if (s.cursorOnTheLeft(link, fake)) {
38578
38730
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(link, fake);
38731
+ } else {
38732
+ return;
38579
38733
  }
38734
+ // The block is split at the caret, so the caret leaves the link too:
38735
+ // beside the fake, since Safari mislays a caret inside a removed node
38736
+ var range = s.createRange();
38737
+ range.setStartBefore(fake);
38738
+ s.selectRange(range);
38580
38739
  }
38581
38740
  }
38582
38741
 
@@ -38828,9 +38987,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
38828
38987
 
38829
38988
  "use strict";
38830
38989
  /* unused harmony export focus */
38831
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
38832
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28077);
38833
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
38990
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
38991
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
38992
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
38993
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5266);
38834
38994
  /*!
38835
38995
  * Jodit Editor (https://xdsoft.net/jodit/)
38836
38996
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -38842,15 +39002,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
38842
39002
  */
38843
39003
 
38844
39004
 
39005
+
38845
39006
  /**
38846
39007
  * After loading the page into the editor once the focus is set
38847
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.autofocus = false;
39008
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.autofocus = false;
38848
39009
  /**
38849
39010
  * Cursor position after autofocus
38850
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.cursorAfterAutofocus = 'end';
39011
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.cursorAfterAutofocus = 'end';
38851
39012
  /**
38852
39013
  * Save current selection on blur event
38853
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.saveSelectionOnBlur = true;
39014
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.saveSelectionOnBlur = true;
38854
39015
  function focus(editor) {
38855
39016
  if (editor.o.saveSelectionOnBlur) {
38856
39017
  // A click that brings focus back places the caret itself, and Chrome
@@ -38882,13 +39043,13 @@ function focus(editor) {
38882
39043
  var textNode = null;
38883
39044
  switch(editor.o.cursorAfterAutofocus){
38884
39045
  case 'start':
38885
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.first(editor.editor, function(node) {
38886
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node);
39046
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(editor.editor, function(node) {
39047
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node);
38887
39048
  });
38888
39049
  break;
38889
39050
  case 'end':
38890
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.last(editor.editor, function(node) {
38891
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node);
39051
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.last(editor.editor, function(node) {
39052
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node);
38892
39053
  });
38893
39054
  break;
38894
39055
  }
@@ -38907,7 +39068,8 @@ function focus(editor) {
38907
39068
  });
38908
39069
  editor.e.on('afterInit afterAddPlace', function() {
38909
39070
  editor.e.off(editor.editor, 'mousedown.autofocus').on(editor.editor, 'mousedown.autofocus', function(e) {
38910
- if (editor.isEditorMode() && e.target && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(e.target) && !e.target.childNodes.length) {
39071
+ // An empty block takes the caret, but a video, say, can't hold one
39072
+ 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) {
38911
39073
  if (editor.editor === e.target) {
38912
39074
  editor.s.focus();
38913
39075
  } else {
@@ -38917,7 +39079,7 @@ function focus(editor) {
38917
39079
  });
38918
39080
  });
38919
39081
  }
38920
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
39082
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('focus', focus);
38921
39083
 
38922
39084
 
38923
39085
  /***/ }),
@@ -40291,18 +40453,29 @@ function hr(editor) {
40291
40453
  group: 'insert'
40292
40454
  });
40293
40455
  editor.registerCommand('insertHorizontalRule', function() {
40456
+ var _editor_o_dtd;
40294
40457
  var elm = editor.createInside.element('hr');
40295
40458
  editor.s.insertNode(elm, false, false);
40296
40459
  var block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(elm.parentElement, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor);
40297
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor) {
40460
+ // A block that holds other blocks, such as a list item or a table
40461
+ // cell, keeps the line
40462
+ 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()])) {
40298
40463
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, elm);
40299
40464
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(block);
40300
40465
  }
40301
- var p = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.next(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor, false);
40302
- if (!p) {
40303
- p = editor.createInside.element(editor.o.enter);
40304
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
40466
+ var next = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(elm, false);
40467
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(next)) {
40468
+ editor.s.setCursorIn(next, true);
40469
+ return false;
40470
+ }
40471
+ // In a list item or a table cell the text goes on after the line, as
40472
+ // it does with the browsers' own command
40473
+ 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))) {
40474
+ editor.s.setCursorAfter(elm);
40475
+ return false;
40305
40476
  }
40477
+ var p = editor.createInside.element(editor.o.enter);
40478
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
40306
40479
  editor.s.setCursorIn(p);
40307
40480
  return false;
40308
40481
  });
@@ -40328,7 +40501,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
40328
40501
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
40329
40502
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
40330
40503
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
40331
- 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' + '}';
40504
+ 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' + '}';
40332
40505
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
40333
40506
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
40334
40507
 
@@ -43601,18 +43774,20 @@ var align = {
43601
43774
  /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
43602
43775
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
43603
43776
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
43604
- /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42395);
43605
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31635);
43606
- /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38574);
43607
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
43608
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(27795);
43609
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
43610
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65946);
43611
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
43612
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4099);
43613
- /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(56490);
43614
- /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4274);
43615
- /* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(89873);
43777
+ /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41411);
43778
+ /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(15366);
43779
+ /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42395);
43780
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
43781
+ /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38574);
43782
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(84839);
43783
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(27795);
43784
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(28077);
43785
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65946);
43786
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(91206);
43787
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4099);
43788
+ /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(56490);
43789
+ /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(4274);
43790
+ /* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(89873);
43616
43791
  /*!
43617
43792
  * Jodit Editor (https://xdsoft.net/jodit/)
43618
43793
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43639,6 +43814,8 @@ var align = {
43639
43814
 
43640
43815
 
43641
43816
 
43817
+
43818
+
43642
43819
  /**
43643
43820
  * Plugin for show inline popup dialog
43644
43821
  */ var inlinePopup = /*#__PURE__*/ function(Plugin) {
@@ -43651,7 +43828,7 @@ var align = {
43651
43828
  * The user pressed a button inside the selection toolbar — after the
43652
43829
  * command fires `closeAllPopups`, the toolbar should be shown again
43653
43830
  * while the selection is still there. See #1238
43654
- */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__reopenSelectionPopup", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.keys)(_this.j.o.popup, false).filter(function(s) {
43831
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__reopenSelectionPopup", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.keys)(_this.j.o.popup, false).filter(function(s) {
43655
43832
  return !_this.isExcludedTarget(s);
43656
43833
  }));
43657
43834
  return _this;
@@ -43660,30 +43837,52 @@ var align = {
43660
43837
  {
43661
43838
  key: "popup",
43662
43839
  get: function get() {
43663
- return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_14__.Popup(this.jodit, false);
43840
+ return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_16__.Popup(this.jodit, false);
43664
43841
  }
43665
43842
  },
43666
43843
  {
43667
43844
  key: "toolbar",
43668
43845
  get: function get() {
43669
- return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_15__.makeCollection)(this.jodit, this.popup);
43846
+ return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_17__.makeCollection)(this.jodit, this.popup);
43670
43847
  }
43671
43848
  },
43672
43849
  {
43673
43850
  key: "onClick",
43674
43851
  value: function onClick(node) {
43675
43852
  var _this = this;
43676
- var elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.getMediaWrapper)(this.j, node), target = mediaWrapper !== null && mediaWrapper !== void 0 ? mediaWrapper : jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.closest(node, elements, this.j.editor);
43853
+ var elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.getMediaWrapper)(this.j, node), target = mediaWrapper !== null && mediaWrapper !== void 0 ? mediaWrapper : jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(node, elements, this.j.editor);
43677
43854
  // A media wrapper kept in the content gets the media popup
43678
43855
  var type = mediaWrapper ? 'jodit-media' : target === null || target === void 0 ? void 0 : target.nodeName.toLowerCase();
43679
43856
  if (target && type && this.canShowPopupForType(type)) {
43857
+ var isMedia = type === 'jodit-media';
43858
+ // Beside the media in a wrapper kept in the content, which can fill
43859
+ // the line
43860
+ var bound = mediaWrapper && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.getWrappedMedia)(this.j, mediaWrapper) || target;
43680
43861
  this.showPopup(function() {
43681
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.position)(target, _this.j);
43862
+ return _this.__bound(bound, isMedia);
43682
43863
  }, type, target);
43683
43864
  return false;
43684
43865
  }
43685
43866
  }
43686
43867
  },
43868
+ {
43869
+ key: "__bound",
43870
+ value: /**
43871
+ * The box the popup opens beside: the target's, with room for the
43872
+ * resizer's handles when the target gets them, so it doesn't cover them
43873
+ */ function __bound(target, isMedia) {
43874
+ var bound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.position)(target, this.j);
43875
+ var resizable = this.j.o.allowResizeTags;
43876
+ if (!isMedia && !(resizable && jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(target, resizable))) {
43877
+ return bound;
43878
+ }
43879
+ var room = parseInt(this.j.ow.getComputedStyle(this.j.container).getPropertyValue('--jd-resizer-handle-size'), 10) / 2 || 0;
43880
+ return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_6__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_5__._)({}, bound), {
43881
+ top: bound.top - room,
43882
+ height: bound.height + room * 2
43883
+ });
43884
+ }
43885
+ },
43687
43886
  {
43688
43887
  key: "showPopup",
43689
43888
  value: /**
@@ -43699,15 +43898,15 @@ var align = {
43699
43898
  this.previousTarget = target;
43700
43899
  var data = this.j.o.popup[type];
43701
43900
  var content;
43702
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isFunction)(data)) {
43901
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isFunction)(data)) {
43703
43902
  content = data(this.j, target, this.popup.close);
43704
43903
  } else {
43705
43904
  content = data;
43706
43905
  }
43707
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isArray)(content)) {
43906
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isArray)(content)) {
43708
43907
  var disabled = this.j.o.toolbarInlineDisabledButtons;
43709
43908
  this.toolbar.build(disabled.length ? content.filter(function(item) {
43710
- var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(item) ? item : item.name;
43909
+ var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(item) ? item : item.name;
43711
43910
  return !disabled.includes(name !== null && name !== void 0 ? name : '');
43712
43911
  }) : content, target);
43713
43912
  this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
@@ -43725,7 +43924,7 @@ var align = {
43725
43924
  value: /**
43726
43925
  * Hide opened popup
43727
43926
  */ function hidePopup(type) {
43728
- if (this.popup.isOpened && (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(type) || type === this.type)) {
43927
+ if (this.popup.isOpened && (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(type) || type === this.type)) {
43729
43928
  this.popup.close();
43730
43929
  }
43731
43930
  }
@@ -43753,7 +43952,7 @@ var align = {
43753
43952
  value: /**
43754
43953
  * For some elements do not show popup
43755
43954
  */ function isExcludedTarget(type) {
43756
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.splitArray)(this.j.o.toolbarInlineDisableFor).map(function(a) {
43955
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.splitArray)(this.j.o.toolbarInlineDisableFor).map(function(a) {
43757
43956
  return a.toLowerCase();
43758
43957
  }).includes(type.toLowerCase());
43759
43958
  }
@@ -43765,15 +43964,15 @@ var align = {
43765
43964
  this.j.e.on('getDiffButtons.mobile', function(toolbar) {
43766
43965
  if (_this.toolbar === toolbar) {
43767
43966
  var names = _this.toolbar.getButtonsNames();
43768
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.toArray)(jodit.registeredButtons).filter(function(btn) {
43967
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.toArray)(jodit.registeredButtons).filter(function(btn) {
43769
43968
  return !_this.j.o.toolbarInlineDisabledButtons.includes(btn.name);
43770
43969
  }).filter(function(item) {
43771
- var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(item) ? item : item.name;
43970
+ var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(item) ? item : item.name;
43772
43971
  return name && name !== '|' && name !== '\n' && !names.includes(name);
43773
43972
  });
43774
43973
  }
43775
43974
  }).on('hidePopup', this.hidePopup).on('showInlineToolbar', this.showInlineToolbar).on('showPopup', function(elm, rect, type) {
43776
- _this.showPopup(rect, type || ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(elm) ? elm : elm.nodeName), (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(elm) ? undefined : elm);
43975
+ _this.showPopup(rect, type || ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(elm) ? elm : elm.nodeName), (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(elm) ? undefined : elm);
43777
43976
  }).on('mousedown keydown', this.onSelectionStart).on('change', function() {
43778
43977
  if (_this.popup.isOpened && _this.previousTarget && !_this.previousTarget.parentNode) {
43779
43978
  _this.hidePopup();
@@ -43792,7 +43991,7 @@ var align = {
43792
43991
  {
43793
43992
  key: "__onDocumentMouseDown",
43794
43993
  value: function __onDocumentMouseDown(e) {
43795
- if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_14__.Popup)) {
43994
+ if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_15__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_16__.Popup)) {
43796
43995
  this.__reopenSelectionPopup = true;
43797
43996
  }
43798
43997
  }
@@ -43831,7 +44030,7 @@ var align = {
43831
44030
  var rect = this.j.s.range.getBoundingClientRect();
43832
44031
  var left = rect.left, top = rect.top;
43833
44032
  if (this.j.iframe) {
43834
- var offset = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.position)(this.j.iframe, this.j, true);
44033
+ var offset = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.position)(this.j.iframe, this.j, true);
43835
44034
  left += offset.left;
43836
44035
  top += offset.top;
43837
44036
  }
@@ -43852,7 +44051,7 @@ var align = {
43852
44051
  {
43853
44052
  key: "onSelectionEnd",
43854
44053
  value: function onSelectionEnd(e) {
43855
- if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_14__.Popup)) {
44054
+ if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_15__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_16__.Popup)) {
43856
44055
  return;
43857
44056
  }
43858
44057
  var snapRange = this.snapRange, range = this.j.s.range;
@@ -43894,7 +44093,7 @@ var align = {
43894
44093
  * In not collapsed selection - only one image
43895
44094
  */ function isSelectedTarget(r) {
43896
44095
  var sc = r.startContainer;
43897
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isElement(sc) && sc === r.endContainer && jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(sc.childNodes[r.startOffset], new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.keys)(this.j.o.popup, false))) && r.startOffset === r.endOffset - 1;
44096
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isElement(sc) && sc === r.endContainer && jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(sc.childNodes[r.startOffset], new Set((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.keys)(this.j.o.popup, false))) && r.startOffset === r.endOffset - 1;
43898
44097
  }
43899
44098
  },
43900
44099
  {
@@ -43924,11 +44123,11 @@ var align = {
43924
44123
  var tag = param.tag;
43925
44124
  return tag.toLowerCase();
43926
44125
  });
43927
- var el = (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_5__._)(new Set(this.elmsList.concat(wrapperTags)));
44126
+ var el = (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_7__._)(new Set(this.elmsList.concat(wrapperTags)));
43928
44127
  return el.map(function(e) {
43929
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.camelCase)("click_".concat(e));
44128
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.camelCase)("click_".concat(e));
43930
44129
  }).concat(el.map(function(e) {
43931
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.camelCase)("touchstart_".concat(e));
44130
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.camelCase)("touchstart_".concat(e));
43932
44131
  })).join(' ');
43933
44132
  }
43934
44133
  },
@@ -43961,56 +44160,56 @@ var align = {
43961
44160
  }
43962
44161
  ]);
43963
44162
  return inlinePopup;
43964
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_7__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__.Plugin));
44163
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_9__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_14__.Plugin));
43965
44164
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(inlinePopup, "requires", [
43966
44165
  'select'
43967
44166
  ]);
43968
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43969
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.cache
44167
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44168
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.cache
43970
44169
  ], inlinePopup.prototype, "popup", null);
43971
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43972
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.cache
44170
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44171
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.cache
43973
44172
  ], inlinePopup.prototype, "toolbar", null);
43974
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43975
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44173
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44174
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
43976
44175
  ], inlinePopup.prototype, "onClick", null);
43977
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43978
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.wait)(function(ctx) {
44176
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44177
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.wait)(function(ctx) {
43979
44178
  return !ctx.j.isLocked;
43980
44179
  })
43981
44180
  ], inlinePopup.prototype, "showPopup", null);
43982
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43983
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)([
44181
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44182
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.watch)([
43984
44183
  ':clickEditor',
43985
44184
  ':beforeCommandDelete',
43986
44185
  ':backSpaceAfterDelete'
43987
44186
  ]),
43988
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44187
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
43989
44188
  ], inlinePopup.prototype, "hidePopup", null);
43990
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43991
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':outsideClick')
44189
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44190
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.watch)(':outsideClick')
43992
44191
  ], inlinePopup.prototype, "onOutsideClick", null);
43993
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43994
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44192
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44193
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
43995
44194
  ], inlinePopup.prototype, "__onDocumentMouseDown", null);
43996
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43997
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44195
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44196
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
43998
44197
  ], inlinePopup.prototype, "__onCloseAllPopups", null);
43999
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
44000
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44198
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44199
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
44001
44200
  ], inlinePopup.prototype, "onSelectionStart", null);
44002
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
44003
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44201
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44202
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
44004
44203
  ], inlinePopup.prototype, "onSelectionEnd", null);
44005
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
44006
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.debounce)(function(ctx) {
44204
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44205
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.debounce)(function(ctx) {
44007
44206
  return ctx.defaultTimeout;
44008
44207
  })
44009
44208
  ], inlinePopup.prototype, "onSelectionChange", null);
44010
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
44011
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44209
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_8__.__decorate)([
44210
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
44012
44211
  ], inlinePopup.prototype, "showInlineToolbar", null);
44013
- jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.pluginSystem.add('inlinePopup', inlinePopup);
44212
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('inlinePopup', inlinePopup);
44014
44213
 
44015
44214
 
44016
44215
  /***/ }),
@@ -45192,7 +45391,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
45192
45391
  height: (_jodit_o_video2 = jodit.o.video) === null || _jodit_o_video2 === void 0 ? void 0 : _jodit_o_video2.defaultHeight
45193
45392
  });
45194
45393
  if (embed !== html) {
45195
- return jodit.createInside.fromHTML(embed);
45394
+ var media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.prepareEmbedCode)(jodit, embed);
45395
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
45196
45396
  }
45197
45397
  }
45198
45398
  if (jodit.s.isCollapsed()) {
@@ -45642,12 +45842,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45642
45842
  "use strict";
45643
45843
  /* unused harmony export media */
45644
45844
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
45645
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
45646
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
45647
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28077);
45648
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
45649
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
45650
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(51730);
45845
+ /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42395);
45846
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
45847
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23211);
45848
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
45849
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93640);
45850
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
45851
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(51730);
45651
45852
  /*!
45652
45853
  * Jodit Editor (https://xdsoft.net/jodit/)
45653
45854
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -45663,41 +45864,69 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45663
45864
 
45664
45865
 
45665
45866
 
45867
+
45666
45868
  /**
45667
45869
  * Process `video` and `audio`
45668
45870
  */ function media(editor) {
45669
45871
  var keyFake = 'jodit_fake_wrapper';
45670
45872
  var _editor_options = editor.options, mediaFakeTag = _editor_options.mediaFakeTag, mediaBlocks = _editor_options.mediaBlocks, mediaInFakeBlock = _editor_options.mediaInFakeBlock, mediaWrappers = _editor_options.mediaWrappers;
45671
45873
  var wrap = function wrap(element) {
45672
- if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
45874
+ if (element.parentNode && (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.attr)(element.parentNode, 'data-jodit_iframe_wrapper')) {
45673
45875
  element = element.parentNode;
45674
45876
  } else if (mediaWrappers[element.nodeName.toLowerCase()]) {
45675
45877
  var _getMediaWrapper;
45676
- element = (_getMediaWrapper = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.getMediaWrapper)(editor, element)) !== null && _getMediaWrapper !== void 0 ? _getMediaWrapper : (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.wrapMedia)(editor, element);
45878
+ element = (_getMediaWrapper = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(editor, element)) !== null && _getMediaWrapper !== void 0 ? _getMediaWrapper : (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.wrapMedia)(editor, element);
45677
45879
  } else if (mediaInFakeBlock) {
45678
45880
  var wrapper = editor.createInside.element(mediaFakeTag, (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)({
45679
45881
  'data-jodit-temp': 1,
45680
45882
  contenteditable: false,
45681
45883
  draggable: true
45682
45884
  }, "data-".concat(keyFake), 1));
45683
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
45684
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
45685
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block',
45885
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.attr)(element, 'style'));
45886
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
45887
+ display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block',
45686
45888
  width: element.offsetWidth,
45687
45889
  height: element.offsetHeight
45688
45890
  });
45689
45891
  if (element.parentNode) {
45690
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.before(element, wrapper);
45892
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(element, wrapper);
45691
45893
  }
45692
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(wrapper, element);
45894
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(wrapper, element);
45693
45895
  element = wrapper;
45694
45896
  } else {
45695
45897
  return;
45696
45898
  }
45899
+ // Selected, as an image is, so Delete and Backspace remove it
45697
45900
  editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', function() {
45698
- editor.s.setCursorAfter(element);
45901
+ editor.s.select(element);
45699
45902
  });
45700
45903
  };
45904
+ // Media in a wrapper kept in the content let clicks through to it, as
45905
+ // jodit-media covers its media, so a click selects the media rather than
45906
+ // playing it. An inline wrapper holds it as an inline-block, unless its
45907
+ // classes or style give it a display of their own
45908
+ var wrappers = Object.values(mediaWrappers);
45909
+ if (wrappers.length) {
45910
+ editor.e.on('afterInit', function() {
45911
+ var selectors = function selectors(list) {
45912
+ return (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_1__._)(new Set(list)).join(',');
45913
+ };
45914
+ var scoped = function scoped(param) {
45915
+ var tag = param.tag, className = param.className;
45916
+ return ".jodit-wysiwyg ".concat(tag, ".").concat(className);
45917
+ };
45918
+ var inline = selectors(wrappers.filter(function(param) {
45919
+ var tag = param.tag;
45920
+ return jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.IS_INLINE.test(tag);
45921
+ }).map(scoped));
45922
+ var _$media = selectors(wrappers.flatMap(function(wrapper) {
45923
+ return mediaBlocks.map(function(tag) {
45924
+ return "".concat(scoped(wrapper), ">").concat(tag);
45925
+ });
45926
+ }));
45927
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(editor, 'media-wrappers', 'style', true).innerHTML = (inline ? ":where(".concat(inline, "){display:inline-block}") : '') + "".concat(_$media, "{pointer-events:none}");
45928
+ });
45929
+ }
45701
45930
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
45702
45931
  editor.e.on('afterGetValueFromEditor', function(data) {
45703
45932
  var rxp = new RegExp("<".concat(mediaFakeTag, "[^>]+data-").concat(keyFake, "[^>]+>([^]+?)</").concat(mediaFakeTag, ">"), 'ig');
@@ -45705,10 +45934,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45705
45934
  data.value = data.value.replace(rxp, '$1');
45706
45935
  }
45707
45936
  }).on('change afterInit afterSetMode changePlace', editor.async.debounce(function() {
45708
- if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.MODE_SOURCE) {
45709
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach(function(elm) {
45710
- if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
45711
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake, true);
45937
+ if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE) {
45938
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.$$)(mediaBlocks.join(','), editor.editor).forEach(function(elm) {
45939
+ if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.dataBind)(elm, keyFake)) {
45940
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_5__.dataBind)(elm, keyFake, true);
45712
45941
  wrap(elm);
45713
45942
  }
45714
45943
  });
@@ -45716,7 +45945,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45716
45945
  }, editor.defaultTimeout));
45717
45946
  }
45718
45947
  }
45719
- jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('media', media);
45948
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('media', media);
45720
45949
 
45721
45950
 
45722
45951
  /***/ }),
@@ -46807,13 +47036,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46807
47036
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46808
47037
  /* harmony export */ askInsertTypeDialog: function() { return /* binding */ askInsertTypeDialog; },
46809
47038
  /* harmony export */ getAllTypes: function() { return /* binding */ getAllTypes; },
46810
- /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; }
47039
+ /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; },
47040
+ /* harmony export */ removeGoogleDocsWrapper: function() { return /* binding */ removeGoogleDocsWrapper; }
46811
47041
  /* harmony export */ });
46812
47042
  /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42395);
46813
47043
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
46814
47044
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
46815
- /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
46816
- /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53681);
47045
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(88475);
47046
+ /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28686);
47047
+ /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53681);
46817
47048
  /*!
46818
47049
  * Jodit Editor (https://xdsoft.net/jodit/)
46819
47050
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -46825,6 +47056,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46825
47056
 
46826
47057
 
46827
47058
 
47059
+
46828
47060
  /**
46829
47061
  * Remove special HTML comments
46830
47062
  * @private
@@ -46840,6 +47072,21 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46840
47072
  }
46841
47073
  return html;
46842
47074
  }
47075
+ /**
47076
+ * Google Docs wraps the copied content in
47077
+ * `<b style="font-weight:normal;" id="docs-internal-guid-…">`. Kept, the
47078
+ * wrapper holds the pasted blocks, and without its style it makes the whole
47079
+ * paste bold
47080
+ * @private
47081
+ */ function removeGoogleDocsWrapper(html) {
47082
+ if (!/<b\s[^>]*docs-internal-guid-/i.test(html)) {
47083
+ return html;
47084
+ }
47085
+ // An inert document: images don't load and handlers don't run
47086
+ var body = new DOMParser().parseFromString(html, 'text/html').body;
47087
+ (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_3__.toArray)(body.querySelectorAll('b[id^="docs-internal-guid-"]')).forEach(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.unwrap);
47088
+ return body.innerHTML;
47089
+ }
46843
47090
  /**
46844
47091
  * @private
46845
47092
  */ function isDragEvent(e) {
@@ -46856,11 +47103,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46856
47103
  editor.s.insertCursorAtPoint(e.clientX, e.clientY);
46857
47104
  }
46858
47105
  var result = editor.e.fire('beforePasteInsert', html);
46859
- 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_2__.Dom.isNode(result))) {
47106
+ if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__.isVoid)(result) && ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__.isString)(result) || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__.isNumber)(result) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isNode(result))) {
46860
47107
  html = result;
46861
47108
  }
46862
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(html)) {
46863
- html = removeExtraFragments(html);
47109
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__.isString)(html)) {
47110
+ html = removeExtraFragments(removeGoogleDocsWrapper(html));
46864
47111
  }
46865
47112
  editor.s.insertHTML(html);
46866
47113
  }
@@ -46870,7 +47117,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46870
47117
  */ function getAllTypes(dt) {
46871
47118
  var types = dt.types;
46872
47119
  var types_str = '';
46873
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
47120
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
46874
47121
  for(var i = 0; i < types.length; i += 1){
46875
47122
  types_str += types[i] + ';';
46876
47123
  }
@@ -46889,7 +47136,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46889
47136
  var dialog = jodit.confirm('<div style="word-break: normal; white-space: normal">'.concat(jodit.i18n(msg), "</div>"), jodit.i18n(title));
46890
47137
  var buttons = buttonList.map(function(param) {
46891
47138
  var text = param.text, value = param.value;
46892
- return (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
47139
+ return (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
46893
47140
  text: text,
46894
47141
  name: text.toLowerCase(),
46895
47142
  tabIndex: 0
@@ -46906,7 +47153,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46906
47153
  }
46907
47154
  jodit.e.fire('afterClosePasteDialog', dialog);
46908
47155
  });
46909
- var cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
47156
+ var cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_5__.Button)(jodit, {
46910
47157
  text: 'Cancel',
46911
47158
  tabIndex: 0
46912
47159
  }).onAction(function() {
@@ -47121,7 +47368,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
47121
47368
  this.j.buffer.set(jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.CLIPBOARD_ID, html);
47122
47369
  switch(action){
47123
47370
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INSERT_CLEAR_HTML:
47124
- html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.cleanFromWord)(html);
47371
+ html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.cleanFromWord)((0,_helpers__WEBPACK_IMPORTED_MODULE_14__.removeGoogleDocsWrapper)(html));
47125
47372
  break;
47126
47373
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INSERT_ONLY_TEXT:
47127
47374
  html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.stripTags)(html, this.j.ed, new Set(this.j.o.pasteExcludeStripTags), this.j.o.nl2brInPlainText);
@@ -48532,7 +48779,7 @@ var keyBInd = '__jodit-resizer_binded';
48532
48779
  var _this = this;
48533
48780
  var editor = this.j;
48534
48781
  editor.e.off(editor.editor, '.resizer').off(editor.ow, '.resizer').on(editor.editor, 'keydown.resizer', function(e) {
48535
- if (_this.isShown && e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_DELETE && _this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(_this.element, 'table')) {
48782
+ if (_this.isShown && (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_DELETE || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_BACKSPACE) && _this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(_this.element, 'table')) {
48536
48783
  _this.onDelete(e);
48537
48784
  }
48538
48785
  }).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize).on([
@@ -48773,8 +49020,12 @@ var keyBInd = '__jodit-resizer_binded';
48773
49020
  this.j.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', function() {
48774
49021
  _this.j.s.select(element);
48775
49022
  }).off(element, 'changesize').on(element, 'changesize', function() {
48776
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(iframe, 'width', element.offsetWidth + 'px');
48777
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(iframe, 'height', element.offsetHeight + 'px');
49023
+ // Only a resize sets the embed's size, and as the plain numbers
49024
+ // the attributes take, so a click leaves `width="100%"` alone
49025
+ if (_this.isResizeMode) {
49026
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(iframe, 'width', element.offsetWidth);
49027
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(iframe, 'height', element.offsetHeight);
49028
+ }
48778
49029
  });
48779
49030
  }
48780
49031
  this.j.e.on(element, 'dragstart', this.hide);
@@ -50540,18 +50791,26 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50540
50791
  break;
50541
50792
  case 'empty':
50542
50793
  cells1.forEach(function(td) {
50543
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.detach(td);
50794
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.detach(td);
50795
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.append(td, _this.j.createInside.element('br'));
50544
50796
  });
50545
50797
  break;
50546
50798
  case 'bin':
50547
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(table);
50799
+ this.__removeTable(table);
50548
50800
  break;
50549
50801
  case 'binrow':
50550
- new Set(cells1.map(function(td) {
50551
- return td.parentNode;
50552
- })).forEach(function(row) {
50553
- _this.__tableModule.removeRow(table, row.rowIndex);
50554
- });
50802
+ {
50803
+ var rows = new Set(cells1.map(function(td) {
50804
+ return td.parentNode;
50805
+ }));
50806
+ var next = this.__nearestCell(table, cell, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_12__.toArray)(rows).map(function(row) {
50807
+ return row.rowIndex;
50808
+ }), true);
50809
+ rows.forEach(function(row) {
50810
+ _this.__tableModule.removeRow(table, row.rowIndex);
50811
+ });
50812
+ next && this.j.s.setCursorIn(next);
50813
+ }
50555
50814
  break;
50556
50815
  case 'bincolumn':
50557
50816
  {
@@ -50564,11 +50823,13 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50564
50823
  columnsSet.add(col);
50565
50824
  }
50566
50825
  });
50826
+ var next1 = this.__nearestCell(table, cell, columns, false);
50567
50827
  columns.sort(function(a, b) {
50568
50828
  return b - a;
50569
50829
  }).forEach(function(col) {
50570
50830
  _this.__tableModule.removeColumn(table, col);
50571
50831
  });
50832
+ next1 && this.j.s.setCursorIn(next1);
50572
50833
  }
50573
50834
  break;
50574
50835
  case 'addcolumnafter':
@@ -50580,11 +50841,42 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50580
50841
  this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
50581
50842
  break;
50582
50843
  }
50844
+ if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
50845
+ this.__removeTable(table);
50846
+ }
50583
50847
  }
50584
50848
  return false;
50585
50849
  }
50586
50850
  }
50587
50851
  },
50852
+ {
50853
+ key: "__nearestCell",
50854
+ value: /**
50855
+ * The cell that takes the caret when rows or columns are deleted: the next
50856
+ * one in the same column (or row) that is not deleted, else the previous one
50857
+ */ function __nearestCell(table, cell, deleted, isRow) {
50858
+ var box = this.__tableModule.formalMatrix(table);
50859
+ var _this___tableModule_formalCoordinate = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(this.__tableModule.formalCoordinate(table, cell), 2), row = _this___tableModule_formalCoordinate[0], column = _this___tableModule_formalCoordinate[1];
50860
+ var start = isRow ? row : column;
50861
+ var count = isRow ? box.length : box[row].length;
50862
+ var find = function find(i) {
50863
+ return !deleted.includes(i) && (isRow ? box[i][column] : box[row][i]) || null;
50864
+ };
50865
+ for(var i = start + 1; i < count; i += 1){
50866
+ var next = find(i);
50867
+ if (next) {
50868
+ return next;
50869
+ }
50870
+ }
50871
+ for(var i1 = start - 1; i1 >= 0; i1 -= 1){
50872
+ var prev = find(i1);
50873
+ if (prev) {
50874
+ return prev;
50875
+ }
50876
+ }
50877
+ return null;
50878
+ }
50879
+ },
50588
50880
  {
50589
50881
  key: "onAfterCommand",
50590
50882
  value: /**
@@ -50597,6 +50889,17 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50597
50889
  }
50598
50890
  }
50599
50891
  },
50892
+ {
50893
+ key: "__removeTable",
50894
+ value: /**
50895
+ * Remove the table and put the caret where it stood: at the start of what
50896
+ * follows it, else at the end of what precedes it
50897
+ */ function __removeTable(table) {
50898
+ var parent = table.parentNode, next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.findNotEmptySibling(table, false), prev = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.findNotEmptySibling(table, true);
50899
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(table);
50900
+ this.j.s.setCursorIn(next || prev || parent, Boolean(next));
50901
+ }
50902
+ },
50600
50903
  {
50601
50904
  key: "beforeDestruct",
50602
50905
  value: /** @override */ function beforeDestruct(jodit) {
@@ -54436,7 +54739,7 @@ var WORK_KEYS = new Set([
54436
54739
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(next, first);
54437
54740
  editor.s.setCursorBefore(first);
54438
54741
  } else {
54439
- if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_TAB) {
54742
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_TAB && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmpty(next)) {
54440
54743
  editor.s.select(next, true);
54441
54744
  } else {
54442
54745
  editor.s.setCursorIn(next, key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_DOWN);
@@ -54508,6 +54811,37 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.table = {
54508
54811
  useExtraClassesOptions: false
54509
54812
  };
54510
54813
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_7___default()));
54814
+ /**
54815
+ * Elements in `dtd.blockLimits` that hold only rows, cells or list items, so
54816
+ * a table can't go directly inside them
54817
+ */ var ROW_AND_ITEM_HOLDERS = new Set([
54818
+ 'table',
54819
+ 'thead',
54820
+ 'tbody',
54821
+ 'tfoot',
54822
+ 'tr',
54823
+ 'ul',
54824
+ 'ol',
54825
+ 'dl'
54826
+ ]);
54827
+ /**
54828
+ * The nearest block around the cursor that can hold the new table: an element
54829
+ * in `dtd.blockLimits`, such as a table cell, a list item or a `<div>`. The
54830
+ * cursor's own block of the `enter` tag is a line, not a container, as in the
54831
+ * dtd plugin's `checkBlockNesting`
54832
+ */ function findTableContainer(editor, current) {
54833
+ var line = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, editor.editor);
54834
+ var container = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(current, function(node) {
54835
+ var _editor_o_dtd;
54836
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isElement(node) || node === line && jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(node, editor.o.enter)) {
54837
+ return false;
54838
+ }
54839
+ var tag = node.nodeName.toLowerCase();
54840
+ 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);
54841
+ }, editor.editor);
54842
+ // With the cursor between two rows, `current` is the next row's text
54843
+ return container && jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(container, editor.s.range.startContainer) ? container : null;
54844
+ }
54511
54845
  jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
54512
54846
  data: {
54513
54847
  cols: 10,
@@ -54609,7 +54943,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
54609
54943
  editor.s.removeMarkers();
54610
54944
  editor.editor.normalize();
54611
54945
  editor.history.snapshot.restore(snapshot);
54612
- var block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.furthest(editor.s.current(), jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, editor.editor);
54946
+ var current = editor.s.current();
54947
+ // The table goes into the cell, list item or box holding the
54948
+ // cursor, and only a block inside it is split
54949
+ var container = findTableContainer(editor, current);
54950
+ var block = container === current ? null : jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.furthest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock, container !== null && container !== void 0 ? container : editor.editor);
54613
54951
  if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmpty(block)) {
54614
54952
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.replace(block, table, undefined, false, true);
54615
54953
  } else {
@@ -54631,6 +54969,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
54631
54969
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.after(block, table);
54632
54970
  }
54633
54971
  }
54972
+ } else if (container && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmpty(container) && !editor.o.table.splitBlockOnInsertTable) {
54973
+ // With no block to go after, the table goes after the text
54974
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(container, table);
54634
54975
  } else {
54635
54976
  editor.s.insertNode(table, false);
54636
54977
  }
@@ -54935,34 +55276,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_11__.pluginSystem.add('toolbarNavigat
54935
55276
 
54936
55277
 
54937
55278
 
54938
- // Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
54939
- // with `mediaDefaultAlign`
54940
- function prepareMedia(jodit, element) {
54941
- var media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
54942
- var mediaDefaultAlign = jodit.o.mediaDefaultAlign;
54943
- if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
54944
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
54945
- }
54946
- return media;
54947
- }
54948
55279
  function insertVideos(data) {
54949
55280
  var _this = this;
54950
55281
  var _data_files;
54951
55282
  (_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach(function(file) {
54952
- _this.s.insertNode(prepareMedia(_this, _this.createInside.element('video', {
55283
+ _this.s.insertNode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareMedia)(_this, _this.createInside.element('video', {
54953
55284
  controls: '',
54954
55285
  src: data.baseurl + file
54955
55286
  })));
54956
55287
  });
54957
55288
  }
54958
- // Embed code that is one element is prepared as media; other code goes in as
54959
- // it is
54960
- function prepareEmbedCode(jodit, code) {
54961
- var box = jodit.createInside.div();
54962
- box.innerHTML = code.trim();
54963
- var element = box.firstElementChild;
54964
- return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
54965
- }
54966
55289
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
54967
55290
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
54968
55291
  defaultWidth: 400,
@@ -55004,7 +55327,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
55004
55327
  ])
55005
55328
  ]), tabs = [], insertCode = function insertCode(code) {
55006
55329
  jodit.s.restore();
55007
- jodit.s.insertHTML(prepareEmbedCode(jodit, code));
55330
+ jodit.s.insertHTML((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareEmbedCode)(jodit, code));
55008
55331
  close();
55009
55332
  };
55010
55333
  jodit.s.save();
@@ -55041,7 +55364,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
55041
55364
  formCode.onSubmit(function(data) {
55042
55365
  insertCode(data.code);
55043
55366
  });
55044
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
55367
+ var box = (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
55368
+ // Its tabs are sized to their labels, as the file selector's are, since
55369
+ // "Upload" doesn't fit a third of the popup
55370
+ box.classList.add('jodit-file-selector');
55371
+ return box;
55045
55372
  },
55046
55373
  tags: [
55047
55374
  'iframe'