jodit 4.18.1 → 4.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/es2015/jodit.css +7 -6
  3. package/es2015/jodit.fat.min.js +10 -10
  4. package/es2015/jodit.js +492 -189
  5. package/es2015/jodit.min.js +10 -10
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +9 -9
  13. package/es2018/jodit.min.js +9 -9
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +7 -6
  17. package/es2021/jodit.fat.min.js +16 -16
  18. package/es2021/jodit.js +432 -135
  19. package/es2021/jodit.min.js +16 -16
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +7 -6
  27. package/es2021.en/jodit.fat.min.js +16 -16
  28. package/es2021.en/jodit.js +432 -135
  29. package/es2021.en/jodit.min.js +16 -16
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +8 -7
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +555 -215
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/config.d.ts +4 -2
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/helpers/utils/index.d.ts +1 -0
  53. package/esm/core/helpers/utils/index.js +1 -0
  54. package/esm/core/helpers/utils/prepare-media.d.ts +19 -0
  55. package/esm/core/helpers/utils/prepare-media.js +31 -0
  56. package/esm/core/selection/style/api/wrap-unwrapped-text.js +3 -2
  57. package/esm/modules/history/history.d.ts +17 -2
  58. package/esm/modules/history/history.js +41 -19
  59. package/esm/modules/table/table.js +7 -2
  60. package/esm/modules/widget/file-selector/file-selector.js +2 -2
  61. package/esm/plugins/backspace/backspace.js +4 -0
  62. package/esm/plugins/clean-html/clean-html.d.ts +9 -1
  63. package/esm/plugins/clean-html/clean-html.js +41 -7
  64. package/esm/plugins/clean-html/helpers/visitor/filters/replace-old-tags.js +26 -1
  65. package/esm/plugins/dtd/before-insert/check-block-nesting.d.ts +2 -1
  66. package/esm/plugins/dtd/before-insert/check-block-nesting.js +26 -5
  67. package/esm/plugins/enter/helpers/move-cursor-out-from-specal-tags.js +8 -0
  68. package/esm/plugins/focus/focus.js +3 -0
  69. package/esm/plugins/hr/hr.js +21 -5
  70. package/esm/plugins/iframe/config.js +8 -3
  71. package/esm/plugins/inline-popup/inline-popup.d.ts +5 -0
  72. package/esm/plugins/inline-popup/inline-popup.js +26 -2
  73. package/esm/plugins/link/link.js +5 -2
  74. package/esm/plugins/media/config.d.ts +2 -1
  75. package/esm/plugins/media/media.js +21 -2
  76. package/esm/plugins/paste/helpers.d.ts +8 -0
  77. package/esm/plugins/paste/helpers.js +18 -1
  78. package/esm/plugins/paste/paste.js +2 -2
  79. package/esm/plugins/resizer/resizer.js +8 -3
  80. package/esm/plugins/select-cells/select-cells.d.ts +10 -0
  81. package/esm/plugins/select-cells/select-cells.js +54 -6
  82. package/esm/plugins/table/config.js +51 -1
  83. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +1 -1
  84. package/esm/plugins/video/config.js +6 -22
  85. package/package.json +1 -1
  86. package/types/config.d.ts +4 -2
  87. package/types/core/helpers/utils/index.d.ts +1 -0
  88. package/types/core/helpers/utils/prepare-media.d.ts +19 -0
  89. package/types/modules/history/history.d.ts +17 -2
  90. package/types/plugins/clean-html/clean-html.d.ts +9 -1
  91. package/types/plugins/dtd/before-insert/check-block-nesting.d.ts +2 -1
  92. package/types/plugins/inline-popup/inline-popup.d.ts +5 -0
  93. package/types/plugins/media/config.d.ts +2 -1
  94. package/types/plugins/paste/helpers.d.ts +8 -0
  95. package/types/plugins/select-cells/select-cells.d.ts +10 -0
package/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.1
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.1";
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,16 +34970,19 @@ 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';
34887
34977
  var cleanHtml = /*#__PURE__*/ function(Plugin) {
34888
34978
  "use strict";
34889
34979
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(cleanHtml, Plugin);
34890
- function cleanHtml() {
34980
+ function cleanHtml(jodit) {
34891
34981
  (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, cleanHtml);
34892
34982
  var _this;
34893
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, cleanHtml, arguments), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "buttons", [
34983
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, cleanHtml, [
34984
+ jodit
34985
+ ]), /** @override */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "buttons", [
34894
34986
  {
34895
34987
  name: 'eraser',
34896
34988
  group: 'font-style'
@@ -34898,12 +34990,22 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34898
34990
  ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "currentSelectionNode", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "walker", new jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_11__.LazyWalker(_this.j.async, {
34899
34991
  timeout: _this.j.o.cleanHTML.timeout
34900
34992
  }));
34993
+ // `@watch` binds once the plugin is ready, which is after the initial
34994
+ // value has already gone into the editor. The handlers that keep
34995
+ // markup out of the live tree have to be there from the start, or
34996
+ // event handlers in a textarea's content run before anything
34997
+ // sanitises them.
34998
+ jodit.e.on('safeHTML', _this.onSafeHTML).on('beforeSetNativeEditorValue', _this.onBeforeSetNativeEditorValue).on('afterSetNativeEditorValue', _this.onAfterSetNativeEditorValue);
34901
34999
  return _this;
34902
35000
  }
34903
35001
  ;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(cleanHtml, [
34904
35002
  {
34905
35003
  key: "afterInit",
34906
- value: /** @override */ function afterInit(jodit) {}
35004
+ value: /** @override */ function afterInit() {
35005
+ // The walker's own `:afterInit` watcher is bound on that very event,
35006
+ // so without this the first pass waited for the first key or click
35007
+ this.onChangeCleanHTML();
35008
+ }
34907
35009
  },
34908
35010
  {
34909
35011
  key: "isEditMode",
@@ -34929,10 +35031,10 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34929
35031
  value: function startWalker() {
34930
35032
  var _this = this;
34931
35033
  var jodit = this.jodit;
34932
- var allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.getHash)(this.j.o.cleanHTML.allowTags);
34933
- 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);
34934
35036
  this.walker.on('visit', function(node) {
34935
- 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);
34936
35038
  }).on('end', function(affected) {
34937
35039
  _this.j.e.fire(affected ? 'internalChange finishedCleanHTMLWorker' : 'finishedCleanHTMLWorker');
34938
35040
  });
@@ -34943,9 +35045,9 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34943
35045
  value: function beforeCommand(command) {
34944
35046
  if (command.toLowerCase() === 'removeformat') {
34945
35047
  if (this.j.s.isCollapsed()) {
34946
- (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.removeFormatForCollapsedSelection)(this.j);
35048
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.removeFormatForCollapsedSelection)(this.j);
34947
35049
  } else {
34948
- (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.removeFormatForSelection)(this.j);
35050
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_17__.removeFormatForSelection)(this.j);
34949
35051
  }
34950
35052
  return false;
34951
35053
  }
@@ -34977,6 +35079,7 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34977
35079
  ], 2), sandBox = _ref[0], iframe = _ref[1];
34978
35080
  sandBox.innerHTML = data.value;
34979
35081
  this.j.e.fire('safeHTML', sandBox);
35082
+ this.__replaceOldTags(sandBox);
34980
35083
  data.value = sandBox.innerHTML;
34981
35084
  (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_13__.safeHTML)(sandBox, {
34982
35085
  safeJavaScriptLink: true,
@@ -34986,6 +35089,24 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34986
35089
  return false;
34987
35090
  }
34988
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
+ },
34989
35110
  {
34990
35111
  key: "onAfterGetValueFromEditor",
34991
35112
  value: /**
@@ -35079,6 +35200,7 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
35079
35200
  {
35080
35201
  key: "beforeDestruct",
35081
35202
  value: /** @override */ function beforeDestruct() {
35203
+ this.j.e.off('safeHTML', this.onSafeHTML).off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue).off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
35082
35204
  this.walker.destruct();
35083
35205
  }
35084
35206
  }
@@ -35101,16 +35223,16 @@ var cleanHtml = /*#__PURE__*/ function(Plugin) {
35101
35223
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':beforeCommand')
35102
35224
  ], cleanHtml.prototype, "beforeCommand", null);
35103
35225
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
35104
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':afterSetNativeEditorValue')
35226
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
35105
35227
  ], cleanHtml.prototype, "onAfterSetNativeEditorValue", null);
35106
35228
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
35107
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':beforeSetNativeEditorValue')
35229
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
35108
35230
  ], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
35109
35231
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
35110
35232
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':afterGetValueFromEditor')
35111
35233
  ], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
35112
35234
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
35113
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':safeHTML')
35235
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
35114
35236
  ], cleanHtml.prototype, "onSafeHTML", null);
35115
35237
  jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('cleanHtml', cleanHtml);
35116
35238
 
@@ -35722,10 +35844,33 @@ __webpack_require__.r(__webpack_exports__);
35722
35844
  }
35723
35845
  var tagName = list[oldParent.nodeName.toLowerCase()] || list[oldParent.nodeName];
35724
35846
  if (tagName) {
35725
- 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;
35726
35851
  }
35727
35852
  return oldParent;
35728
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
+ }
35729
35874
 
35730
35875
 
35731
35876
  /***/ }),
@@ -37923,9 +38068,32 @@ var brBoxes = new Set([
37923
38068
  * @module plugins/dtd
37924
38069
  * @internal
37925
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
+ }
37926
38093
  /**
37927
38094
  * Checks whether the insertion of an element at the current location is allowed,
37928
- * 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
37929
38097
  * @internal
37930
38098
  */ function checkBlockNesting(jodit, node) {
37931
38099
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node)) {
@@ -37955,10 +38123,7 @@ var brBoxes = new Set([
37955
38123
  parent = current;
37956
38124
  }
37957
38125
  if (parent) {
37958
- jodit.s.setCursorAfter(parent);
37959
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
37960
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
37961
- }
38126
+ moveCursorOutOf(jodit, parent);
37962
38127
  }
37963
38128
  }
37964
38129
  }
@@ -38563,7 +38728,14 @@ function brBefore(start) {
38563
38728
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(link, fake);
38564
38729
  } else if (s.cursorOnTheLeft(link, fake)) {
38565
38730
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(link, fake);
38731
+ } else {
38732
+ return;
38566
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);
38567
38739
  }
38568
38740
  }
38569
38741
 
@@ -38815,9 +38987,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
38815
38987
 
38816
38988
  "use strict";
38817
38989
  /* unused harmony export focus */
38818
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
38819
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28077);
38820
- /* 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);
38821
38994
  /*!
38822
38995
  * Jodit Editor (https://xdsoft.net/jodit/)
38823
38996
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -38829,15 +39002,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
38829
39002
  */
38830
39003
 
38831
39004
 
39005
+
38832
39006
  /**
38833
39007
  * After loading the page into the editor once the focus is set
38834
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.autofocus = false;
39008
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.autofocus = false;
38835
39009
  /**
38836
39010
  * Cursor position after autofocus
38837
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.cursorAfterAutofocus = 'end';
39011
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.cursorAfterAutofocus = 'end';
38838
39012
  /**
38839
39013
  * Save current selection on blur event
38840
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.saveSelectionOnBlur = true;
39014
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.saveSelectionOnBlur = true;
38841
39015
  function focus(editor) {
38842
39016
  if (editor.o.saveSelectionOnBlur) {
38843
39017
  // A click that brings focus back places the caret itself, and Chrome
@@ -38869,13 +39043,13 @@ function focus(editor) {
38869
39043
  var textNode = null;
38870
39044
  switch(editor.o.cursorAfterAutofocus){
38871
39045
  case 'start':
38872
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.first(editor.editor, function(node) {
38873
- 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);
38874
39048
  });
38875
39049
  break;
38876
39050
  case 'end':
38877
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.last(editor.editor, function(node) {
38878
- 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);
38879
39053
  });
38880
39054
  break;
38881
39055
  }
@@ -38894,7 +39068,8 @@ function focus(editor) {
38894
39068
  });
38895
39069
  editor.e.on('afterInit afterAddPlace', function() {
38896
39070
  editor.e.off(editor.editor, 'mousedown.autofocus').on(editor.editor, 'mousedown.autofocus', function(e) {
38897
- 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) {
38898
39073
  if (editor.editor === e.target) {
38899
39074
  editor.s.focus();
38900
39075
  } else {
@@ -38904,7 +39079,7 @@ function focus(editor) {
38904
39079
  });
38905
39080
  });
38906
39081
  }
38907
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
39082
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('focus', focus);
38908
39083
 
38909
39084
 
38910
39085
  /***/ }),
@@ -40278,18 +40453,29 @@ function hr(editor) {
40278
40453
  group: 'insert'
40279
40454
  });
40280
40455
  editor.registerCommand('insertHorizontalRule', function() {
40456
+ var _editor_o_dtd;
40281
40457
  var elm = editor.createInside.element('hr');
40282
40458
  editor.s.insertNode(elm, false, false);
40283
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);
40284
- 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()])) {
40285
40463
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, elm);
40286
40464
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(block);
40287
40465
  }
40288
- var p = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.next(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor, false);
40289
- if (!p) {
40290
- p = editor.createInside.element(editor.o.enter);
40291
- 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;
40292
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;
40476
+ }
40477
+ var p = editor.createInside.element(editor.o.enter);
40478
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
40293
40479
  editor.s.setCursorIn(p);
40294
40480
  return false;
40295
40481
  });
@@ -40315,7 +40501,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
40315
40501
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
40316
40502
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
40317
40503
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
40318
- 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' + '}';
40319
40505
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
40320
40506
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
40321
40507
 
@@ -43588,18 +43774,20 @@ var align = {
43588
43774
  /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
43589
43775
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
43590
43776
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
43591
- /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42395);
43592
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31635);
43593
- /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38574);
43594
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
43595
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(27795);
43596
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
43597
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65946);
43598
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
43599
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4099);
43600
- /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(56490);
43601
- /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(4274);
43602
- /* 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);
43603
43791
  /*!
43604
43792
  * Jodit Editor (https://xdsoft.net/jodit/)
43605
43793
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -43626,6 +43814,8 @@ var align = {
43626
43814
 
43627
43815
 
43628
43816
 
43817
+
43818
+
43629
43819
  /**
43630
43820
  * Plugin for show inline popup dialog
43631
43821
  */ var inlinePopup = /*#__PURE__*/ function(Plugin) {
@@ -43638,7 +43828,7 @@ var align = {
43638
43828
  * The user pressed a button inside the selection toolbar — after the
43639
43829
  * command fires `closeAllPopups`, the toolbar should be shown again
43640
43830
  * while the selection is still there. See #1238
43641
- */ (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) {
43642
43832
  return !_this.isExcludedTarget(s);
43643
43833
  }));
43644
43834
  return _this;
@@ -43647,30 +43837,52 @@ var align = {
43647
43837
  {
43648
43838
  key: "popup",
43649
43839
  get: function get() {
43650
- 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);
43651
43841
  }
43652
43842
  },
43653
43843
  {
43654
43844
  key: "toolbar",
43655
43845
  get: function get() {
43656
- 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);
43657
43847
  }
43658
43848
  },
43659
43849
  {
43660
43850
  key: "onClick",
43661
43851
  value: function onClick(node) {
43662
43852
  var _this = this;
43663
- 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);
43664
43854
  // A media wrapper kept in the content gets the media popup
43665
43855
  var type = mediaWrapper ? 'jodit-media' : target === null || target === void 0 ? void 0 : target.nodeName.toLowerCase();
43666
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;
43667
43861
  this.showPopup(function() {
43668
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.position)(target, _this.j);
43862
+ return _this.__bound(bound, isMedia);
43669
43863
  }, type, target);
43670
43864
  return false;
43671
43865
  }
43672
43866
  }
43673
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
+ },
43674
43886
  {
43675
43887
  key: "showPopup",
43676
43888
  value: /**
@@ -43686,15 +43898,15 @@ var align = {
43686
43898
  this.previousTarget = target;
43687
43899
  var data = this.j.o.popup[type];
43688
43900
  var content;
43689
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isFunction)(data)) {
43901
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isFunction)(data)) {
43690
43902
  content = data(this.j, target, this.popup.close);
43691
43903
  } else {
43692
43904
  content = data;
43693
43905
  }
43694
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isArray)(content)) {
43906
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isArray)(content)) {
43695
43907
  var disabled = this.j.o.toolbarInlineDisabledButtons;
43696
43908
  this.toolbar.build(disabled.length ? content.filter(function(item) {
43697
- 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;
43698
43910
  return !disabled.includes(name !== null && name !== void 0 ? name : '');
43699
43911
  }) : content, target);
43700
43912
  this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
@@ -43712,7 +43924,7 @@ var align = {
43712
43924
  value: /**
43713
43925
  * Hide opened popup
43714
43926
  */ function hidePopup(type) {
43715
- 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)) {
43716
43928
  this.popup.close();
43717
43929
  }
43718
43930
  }
@@ -43740,7 +43952,7 @@ var align = {
43740
43952
  value: /**
43741
43953
  * For some elements do not show popup
43742
43954
  */ function isExcludedTarget(type) {
43743
- 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) {
43744
43956
  return a.toLowerCase();
43745
43957
  }).includes(type.toLowerCase());
43746
43958
  }
@@ -43752,15 +43964,15 @@ var align = {
43752
43964
  this.j.e.on('getDiffButtons.mobile', function(toolbar) {
43753
43965
  if (_this.toolbar === toolbar) {
43754
43966
  var names = _this.toolbar.getButtonsNames();
43755
- 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) {
43756
43968
  return !_this.j.o.toolbarInlineDisabledButtons.includes(btn.name);
43757
43969
  }).filter(function(item) {
43758
- 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;
43759
43971
  return name && name !== '|' && name !== '\n' && !names.includes(name);
43760
43972
  });
43761
43973
  }
43762
43974
  }).on('hidePopup', this.hidePopup).on('showInlineToolbar', this.showInlineToolbar).on('showPopup', function(elm, rect, type) {
43763
- _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);
43764
43976
  }).on('mousedown keydown', this.onSelectionStart).on('change', function() {
43765
43977
  if (_this.popup.isOpened && _this.previousTarget && !_this.previousTarget.parentNode) {
43766
43978
  _this.hidePopup();
@@ -43779,7 +43991,7 @@ var align = {
43779
43991
  {
43780
43992
  key: "__onDocumentMouseDown",
43781
43993
  value: function __onDocumentMouseDown(e) {
43782
- 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)) {
43783
43995
  this.__reopenSelectionPopup = true;
43784
43996
  }
43785
43997
  }
@@ -43818,7 +44030,7 @@ var align = {
43818
44030
  var rect = this.j.s.range.getBoundingClientRect();
43819
44031
  var left = rect.left, top = rect.top;
43820
44032
  if (this.j.iframe) {
43821
- 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);
43822
44034
  left += offset.left;
43823
44035
  top += offset.top;
43824
44036
  }
@@ -43839,7 +44051,7 @@ var align = {
43839
44051
  {
43840
44052
  key: "onSelectionEnd",
43841
44053
  value: function onSelectionEnd(e) {
43842
- 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)) {
43843
44055
  return;
43844
44056
  }
43845
44057
  var snapRange = this.snapRange, range = this.j.s.range;
@@ -43881,7 +44093,7 @@ var align = {
43881
44093
  * In not collapsed selection - only one image
43882
44094
  */ function isSelectedTarget(r) {
43883
44095
  var sc = r.startContainer;
43884
- 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;
43885
44097
  }
43886
44098
  },
43887
44099
  {
@@ -43911,11 +44123,11 @@ var align = {
43911
44123
  var tag = param.tag;
43912
44124
  return tag.toLowerCase();
43913
44125
  });
43914
- 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)));
43915
44127
  return el.map(function(e) {
43916
- 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));
43917
44129
  }).concat(el.map(function(e) {
43918
- 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));
43919
44131
  })).join(' ');
43920
44132
  }
43921
44133
  },
@@ -43948,56 +44160,56 @@ var align = {
43948
44160
  }
43949
44161
  ]);
43950
44162
  return inlinePopup;
43951
- }((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));
43952
44164
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(inlinePopup, "requires", [
43953
44165
  'select'
43954
44166
  ]);
43955
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43956
- 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
43957
44169
  ], inlinePopup.prototype, "popup", null);
43958
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43959
- 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
43960
44172
  ], inlinePopup.prototype, "toolbar", null);
43961
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43962
- 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
43963
44175
  ], inlinePopup.prototype, "onClick", null);
43964
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43965
- (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) {
43966
44178
  return !ctx.j.isLocked;
43967
44179
  })
43968
44180
  ], inlinePopup.prototype, "showPopup", null);
43969
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43970
- (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)([
43971
44183
  ':clickEditor',
43972
44184
  ':beforeCommandDelete',
43973
44185
  ':backSpaceAfterDelete'
43974
44186
  ]),
43975
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
44187
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
43976
44188
  ], inlinePopup.prototype, "hidePopup", null);
43977
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43978
- (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')
43979
44191
  ], inlinePopup.prototype, "onOutsideClick", null);
43980
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43981
- 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
43982
44194
  ], inlinePopup.prototype, "__onDocumentMouseDown", null);
43983
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43984
- 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
43985
44197
  ], inlinePopup.prototype, "__onCloseAllPopups", null);
43986
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43987
- 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
43988
44200
  ], inlinePopup.prototype, "onSelectionStart", null);
43989
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43990
- 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
43991
44203
  ], inlinePopup.prototype, "onSelectionEnd", null);
43992
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43993
- (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) {
43994
44206
  return ctx.defaultTimeout;
43995
44207
  })
43996
44208
  ], inlinePopup.prototype, "onSelectionChange", null);
43997
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
43998
- 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
43999
44211
  ], inlinePopup.prototype, "showInlineToolbar", null);
44000
- jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.pluginSystem.add('inlinePopup', inlinePopup);
44212
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('inlinePopup', inlinePopup);
44001
44213
 
44002
44214
 
44003
44215
  /***/ }),
@@ -45179,7 +45391,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
45179
45391
  height: (_jodit_o_video2 = jodit.o.video) === null || _jodit_o_video2 === void 0 ? void 0 : _jodit_o_video2.defaultHeight
45180
45392
  });
45181
45393
  if (embed !== html) {
45182
- 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;
45183
45396
  }
45184
45397
  }
45185
45398
  if (jodit.s.isCollapsed()) {
@@ -45629,12 +45842,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45629
45842
  "use strict";
45630
45843
  /* unused harmony export media */
45631
45844
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
45632
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
45633
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
45634
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28077);
45635
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(93640);
45636
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
45637
- /* 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);
45638
45852
  /*!
45639
45853
  * Jodit Editor (https://xdsoft.net/jodit/)
45640
45854
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -45650,41 +45864,69 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45650
45864
 
45651
45865
 
45652
45866
 
45867
+
45653
45868
  /**
45654
45869
  * Process `video` and `audio`
45655
45870
  */ function media(editor) {
45656
45871
  var keyFake = 'jodit_fake_wrapper';
45657
45872
  var _editor_options = editor.options, mediaFakeTag = _editor_options.mediaFakeTag, mediaBlocks = _editor_options.mediaBlocks, mediaInFakeBlock = _editor_options.mediaInFakeBlock, mediaWrappers = _editor_options.mediaWrappers;
45658
45873
  var wrap = function wrap(element) {
45659
- 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')) {
45660
45875
  element = element.parentNode;
45661
45876
  } else if (mediaWrappers[element.nodeName.toLowerCase()]) {
45662
45877
  var _getMediaWrapper;
45663
- 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);
45664
45879
  } else if (mediaInFakeBlock) {
45665
45880
  var wrapper = editor.createInside.element(mediaFakeTag, (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)({
45666
45881
  'data-jodit-temp': 1,
45667
45882
  contenteditable: false,
45668
45883
  draggable: true
45669
45884
  }, "data-".concat(keyFake), 1));
45670
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(element, 'style'));
45671
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(wrapper, {
45672
- 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',
45673
45888
  width: element.offsetWidth,
45674
45889
  height: element.offsetHeight
45675
45890
  });
45676
45891
  if (element.parentNode) {
45677
- 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);
45678
45893
  }
45679
- 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);
45680
45895
  element = wrapper;
45681
45896
  } else {
45682
45897
  return;
45683
45898
  }
45899
+ // Selected, as an image is, so Delete and Backspace remove it
45684
45900
  editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', function() {
45685
- editor.s.setCursorAfter(element);
45901
+ editor.s.select(element);
45686
45902
  });
45687
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
+ }
45688
45930
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
45689
45931
  editor.e.on('afterGetValueFromEditor', function(data) {
45690
45932
  var rxp = new RegExp("<".concat(mediaFakeTag, "[^>]+data-").concat(keyFake, "[^>]+>([^]+?)</").concat(mediaFakeTag, ">"), 'ig');
@@ -45692,10 +45934,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45692
45934
  data.value = data.value.replace(rxp, '$1');
45693
45935
  }
45694
45936
  }).on('change afterInit afterSetMode changePlace', editor.async.debounce(function() {
45695
- if (!editor.isDestructed && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.MODE_SOURCE) {
45696
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.$$)(mediaBlocks.join(','), editor.editor).forEach(function(elm) {
45697
- if (!(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, keyFake)) {
45698
- (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);
45699
45941
  wrap(elm);
45700
45942
  }
45701
45943
  });
@@ -45703,7 +45945,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
45703
45945
  }, editor.defaultTimeout));
45704
45946
  }
45705
45947
  }
45706
- jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('media', media);
45948
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('media', media);
45707
45949
 
45708
45950
 
45709
45951
  /***/ }),
@@ -46794,13 +47036,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46794
47036
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46795
47037
  /* harmony export */ askInsertTypeDialog: function() { return /* binding */ askInsertTypeDialog; },
46796
47038
  /* harmony export */ getAllTypes: function() { return /* binding */ getAllTypes; },
46797
- /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; }
47039
+ /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; },
47040
+ /* harmony export */ removeGoogleDocsWrapper: function() { return /* binding */ removeGoogleDocsWrapper; }
46798
47041
  /* harmony export */ });
46799
47042
  /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42395);
46800
47043
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
46801
47044
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23211);
46802
- /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
46803
- /* 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);
46804
47048
  /*!
46805
47049
  * Jodit Editor (https://xdsoft.net/jodit/)
46806
47050
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -46812,6 +47056,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46812
47056
 
46813
47057
 
46814
47058
 
47059
+
46815
47060
  /**
46816
47061
  * Remove special HTML comments
46817
47062
  * @private
@@ -46827,6 +47072,21 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46827
47072
  }
46828
47073
  return html;
46829
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
+ }
46830
47090
  /**
46831
47091
  * @private
46832
47092
  */ function isDragEvent(e) {
@@ -46843,11 +47103,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46843
47103
  editor.s.insertCursorAtPoint(e.clientX, e.clientY);
46844
47104
  }
46845
47105
  var result = editor.e.fire('beforePasteInsert', html);
46846
- 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))) {
46847
47107
  html = result;
46848
47108
  }
46849
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(html)) {
46850
- html = removeExtraFragments(html);
47109
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_4__.isString)(html)) {
47110
+ html = removeExtraFragments(removeGoogleDocsWrapper(html));
46851
47111
  }
46852
47112
  editor.s.insertHTML(html);
46853
47113
  }
@@ -46857,7 +47117,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46857
47117
  */ function getAllTypes(dt) {
46858
47118
  var types = dt.types;
46859
47119
  var types_str = '';
46860
- 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]') {
46861
47121
  for(var i = 0; i < types.length; i += 1){
46862
47122
  types_str += types[i] + ';';
46863
47123
  }
@@ -46876,7 +47136,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46876
47136
  var dialog = jodit.confirm('<div style="word-break: normal; white-space: normal">'.concat(jodit.i18n(msg), "</div>"), jodit.i18n(title));
46877
47137
  var buttons = buttonList.map(function(param) {
46878
47138
  var text = param.text, value = param.value;
46879
- 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, {
46880
47140
  text: text,
46881
47141
  name: text.toLowerCase(),
46882
47142
  tabIndex: 0
@@ -46893,7 +47153,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
46893
47153
  }
46894
47154
  jodit.e.fire('afterClosePasteDialog', dialog);
46895
47155
  });
46896
- 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, {
46897
47157
  text: 'Cancel',
46898
47158
  tabIndex: 0
46899
47159
  }).onAction(function() {
@@ -47108,7 +47368,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
47108
47368
  this.j.buffer.set(jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.CLIPBOARD_ID, html);
47109
47369
  switch(action){
47110
47370
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INSERT_CLEAR_HTML:
47111
- 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));
47112
47372
  break;
47113
47373
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INSERT_ONLY_TEXT:
47114
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);
@@ -48519,7 +48779,7 @@ var keyBInd = '__jodit-resizer_binded';
48519
48779
  var _this = this;
48520
48780
  var editor = this.j;
48521
48781
  editor.e.off(editor.editor, '.resizer').off(editor.ow, '.resizer').on(editor.editor, 'keydown.resizer', function(e) {
48522
- 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')) {
48523
48783
  _this.onDelete(e);
48524
48784
  }
48525
48785
  }).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize).on([
@@ -48760,8 +49020,12 @@ var keyBInd = '__jodit-resizer_binded';
48760
49020
  this.j.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', function() {
48761
49021
  _this.j.s.select(element);
48762
49022
  }).off(element, 'changesize').on(element, 'changesize', function() {
48763
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(iframe, 'width', element.offsetWidth + 'px');
48764
- (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
+ }
48765
49029
  });
48766
49030
  }
48767
49031
  this.j.e.on(element, 'dragstart', this.hide);
@@ -50527,18 +50791,26 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50527
50791
  break;
50528
50792
  case 'empty':
50529
50793
  cells1.forEach(function(td) {
50530
- 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'));
50531
50796
  });
50532
50797
  break;
50533
50798
  case 'bin':
50534
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(table);
50799
+ this.__removeTable(table);
50535
50800
  break;
50536
50801
  case 'binrow':
50537
- new Set(cells1.map(function(td) {
50538
- return td.parentNode;
50539
- })).forEach(function(row) {
50540
- _this.__tableModule.removeRow(table, row.rowIndex);
50541
- });
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
+ }
50542
50814
  break;
50543
50815
  case 'bincolumn':
50544
50816
  {
@@ -50551,11 +50823,13 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50551
50823
  columnsSet.add(col);
50552
50824
  }
50553
50825
  });
50826
+ var next1 = this.__nearestCell(table, cell, columns, false);
50554
50827
  columns.sort(function(a, b) {
50555
50828
  return b - a;
50556
50829
  }).forEach(function(col) {
50557
50830
  _this.__tableModule.removeColumn(table, col);
50558
50831
  });
50832
+ next1 && this.j.s.setCursorIn(next1);
50559
50833
  }
50560
50834
  break;
50561
50835
  case 'addcolumnafter':
@@ -50567,11 +50841,42 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50567
50841
  this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
50568
50842
  break;
50569
50843
  }
50844
+ if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
50845
+ this.__removeTable(table);
50846
+ }
50570
50847
  }
50571
50848
  return false;
50572
50849
  }
50573
50850
  }
50574
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
+ },
50575
50880
  {
50576
50881
  key: "onAfterCommand",
50577
50882
  value: /**
@@ -50584,6 +50889,17 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
50584
50889
  }
50585
50890
  }
50586
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
+ },
50587
50903
  {
50588
50904
  key: "beforeDestruct",
50589
50905
  value: /** @override */ function beforeDestruct(jodit) {
@@ -54423,7 +54739,7 @@ var WORK_KEYS = new Set([
54423
54739
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.append(next, first);
54424
54740
  editor.s.setCursorBefore(first);
54425
54741
  } else {
54426
- 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)) {
54427
54743
  editor.s.select(next, true);
54428
54744
  } else {
54429
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);
@@ -54495,6 +54811,37 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.table = {
54495
54811
  useExtraClassesOptions: false
54496
54812
  };
54497
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
+ }
54498
54845
  jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
54499
54846
  data: {
54500
54847
  cols: 10,
@@ -54596,7 +54943,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
54596
54943
  editor.s.removeMarkers();
54597
54944
  editor.editor.normalize();
54598
54945
  editor.history.snapshot.restore(snapshot);
54599
- 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);
54600
54951
  if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmpty(block)) {
54601
54952
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.replace(block, table, undefined, false, true);
54602
54953
  } else {
@@ -54618,6 +54969,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
54618
54969
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_2__.Dom.after(block, table);
54619
54970
  }
54620
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);
54621
54975
  } else {
54622
54976
  editor.s.insertNode(table, false);
54623
54977
  }
@@ -54922,34 +55276,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_11__.pluginSystem.add('toolbarNavigat
54922
55276
 
54923
55277
 
54924
55278
 
54925
- // Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
54926
- // with `mediaDefaultAlign`
54927
- function prepareMedia(jodit, element) {
54928
- var media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
54929
- var mediaDefaultAlign = jodit.o.mediaDefaultAlign;
54930
- if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
54931
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
54932
- }
54933
- return media;
54934
- }
54935
55279
  function insertVideos(data) {
54936
55280
  var _this = this;
54937
55281
  var _data_files;
54938
55282
  (_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach(function(file) {
54939
- _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', {
54940
55284
  controls: '',
54941
55285
  src: data.baseurl + file
54942
55286
  })));
54943
55287
  });
54944
55288
  }
54945
- // Embed code that is one element is prepared as media; other code goes in as
54946
- // it is
54947
- function prepareEmbedCode(jodit, code) {
54948
- var box = jodit.createInside.div();
54949
- box.innerHTML = code.trim();
54950
- var element = box.firstElementChild;
54951
- return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
54952
- }
54953
55289
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
54954
55290
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
54955
55291
  defaultWidth: 400,
@@ -54991,7 +55327,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
54991
55327
  ])
54992
55328
  ]), tabs = [], insertCode = function insertCode(code) {
54993
55329
  jodit.s.restore();
54994
- jodit.s.insertHTML(prepareEmbedCode(jodit, code));
55330
+ jodit.s.insertHTML((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareEmbedCode)(jodit, code));
54995
55331
  close();
54996
55332
  };
54997
55333
  jodit.s.save();
@@ -55028,7 +55364,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
55028
55364
  formCode.onSubmit(function(data) {
55029
55365
  insertCode(data.code);
55030
55366
  });
55031
- 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;
55032
55372
  },
55033
55373
  tags: [
55034
55374
  'iframe'