jodit 4.18.2 → 4.18.4

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 (226) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/es2015/jodit.css +66 -6
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +36 -11
  5. package/es2015/jodit.js +1435 -327
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +41 -16
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +36 -11
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +36 -11
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +66 -6
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +45 -20
  23. package/es2021/jodit.js +1365 -271
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +45 -20
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +66 -6
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +51 -26
  35. package/es2021.en/jodit.js +1339 -245
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +51 -26
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +82 -7
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +1629 -354
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/config.d.ts +29 -28
  60. package/esm/config.js +19 -21
  61. package/esm/core/constants.js +1 -1
  62. package/esm/core/helpers/utils/align.d.ts +1 -1
  63. package/esm/core/helpers/utils/align.js +2 -3
  64. package/esm/core/helpers/utils/index.d.ts +1 -0
  65. package/esm/core/helpers/utils/index.js +1 -0
  66. package/esm/core/helpers/utils/prepare-media.d.ts +19 -0
  67. package/esm/core/helpers/utils/prepare-media.js +31 -0
  68. package/esm/core/selection/style/api/wrap-unwrapped-text.js +3 -2
  69. package/esm/jodit.js +14 -4
  70. package/esm/langs/ar.d.ts +7 -0
  71. package/esm/langs/ar.js +8 -1
  72. package/esm/langs/az.d.ts +7 -0
  73. package/esm/langs/az.js +8 -1
  74. package/esm/langs/cs_cz.d.ts +7 -0
  75. package/esm/langs/cs_cz.js +9 -1
  76. package/esm/langs/de.d.ts +7 -0
  77. package/esm/langs/de.js +8 -1
  78. package/esm/langs/es.d.ts +7 -0
  79. package/esm/langs/es.js +8 -1
  80. package/esm/langs/fa.d.ts +7 -0
  81. package/esm/langs/fa.js +8 -1
  82. package/esm/langs/fi.d.ts +7 -0
  83. package/esm/langs/fi.js +8 -1
  84. package/esm/langs/fr.d.ts +7 -0
  85. package/esm/langs/fr.js +8 -1
  86. package/esm/langs/he.d.ts +7 -0
  87. package/esm/langs/he.js +8 -1
  88. package/esm/langs/hu.d.ts +7 -0
  89. package/esm/langs/hu.js +8 -1
  90. package/esm/langs/id.d.ts +7 -0
  91. package/esm/langs/id.js +8 -1
  92. package/esm/langs/it.d.ts +7 -0
  93. package/esm/langs/it.js +8 -1
  94. package/esm/langs/ja.d.ts +7 -0
  95. package/esm/langs/ja.js +8 -1
  96. package/esm/langs/ko.d.ts +7 -0
  97. package/esm/langs/ko.js +8 -1
  98. package/esm/langs/mn.d.ts +7 -0
  99. package/esm/langs/mn.js +8 -1
  100. package/esm/langs/nl.d.ts +7 -0
  101. package/esm/langs/nl.js +8 -1
  102. package/esm/langs/no.d.ts +7 -0
  103. package/esm/langs/no.js +8 -1
  104. package/esm/langs/pl.d.ts +7 -0
  105. package/esm/langs/pl.js +8 -1
  106. package/esm/langs/pt_br.d.ts +7 -0
  107. package/esm/langs/pt_br.js +8 -1
  108. package/esm/langs/ru.d.ts +7 -0
  109. package/esm/langs/ru.js +8 -1
  110. package/esm/langs/sk.d.ts +7 -0
  111. package/esm/langs/sk.js +8 -1
  112. package/esm/langs/sv.d.ts +7 -0
  113. package/esm/langs/sv.js +8 -1
  114. package/esm/langs/tr.d.ts +7 -0
  115. package/esm/langs/tr.js +8 -1
  116. package/esm/langs/ua.d.ts +7 -0
  117. package/esm/langs/ua.js +8 -1
  118. package/esm/langs/zh_cn.d.ts +7 -0
  119. package/esm/langs/zh_cn.js +8 -1
  120. package/esm/langs/zh_tw.d.ts +7 -0
  121. package/esm/langs/zh_tw.js +8 -1
  122. package/esm/modules/history/history.d.ts +17 -2
  123. package/esm/modules/history/history.js +41 -19
  124. package/esm/modules/table/table.js +7 -2
  125. package/esm/modules/widget/file-selector/file-selector.js +2 -2
  126. package/esm/plugins/all.d.ts +1 -0
  127. package/esm/plugins/all.js +1 -0
  128. package/esm/plugins/backspace/backspace.js +4 -0
  129. package/esm/plugins/clean-html/clean-html.d.ts +7 -0
  130. package/esm/plugins/clean-html/clean-html.js +17 -0
  131. package/esm/plugins/clean-html/helpers/visitor/filters/replace-old-tags.js +26 -1
  132. package/esm/plugins/dtd/before-insert/check-block-nesting.d.ts +2 -1
  133. package/esm/plugins/dtd/before-insert/check-block-nesting.js +26 -5
  134. package/esm/plugins/enter/helpers/move-cursor-out-from-specal-tags.js +8 -0
  135. package/esm/plugins/focus/focus.js +3 -0
  136. package/esm/plugins/hr/hr.js +21 -5
  137. package/esm/plugins/iframe/config.js +8 -3
  138. package/esm/plugins/image-processor/image-processor.d.ts +4 -1
  139. package/esm/plugins/image-processor/image-processor.js +9 -3
  140. package/esm/plugins/image-properties/readers/align.d.ts +2 -2
  141. package/esm/plugins/index.d.ts +1 -0
  142. package/esm/plugins/inline-popup/config/items/iframe.d.ts +9 -1
  143. package/esm/plugins/inline-popup/config/items/iframe.js +15 -0
  144. package/esm/plugins/inline-popup/inline-popup.d.ts +5 -0
  145. package/esm/plugins/inline-popup/inline-popup.js +26 -2
  146. package/esm/plugins/link/link.js +5 -2
  147. package/esm/plugins/media/config.d.ts +2 -1
  148. package/esm/plugins/media/media.js +37 -9
  149. package/esm/plugins/paste/helpers.d.ts +8 -0
  150. package/esm/plugins/paste/helpers.js +18 -1
  151. package/esm/plugins/paste/paste.js +2 -2
  152. package/esm/plugins/resizer/config.d.ts +5 -3
  153. package/esm/plugins/resizer/config.js +8 -2
  154. package/esm/plugins/resizer/resizer.d.ts +10 -0
  155. package/esm/plugins/resizer/resizer.js +72 -18
  156. package/esm/plugins/select-cells/select-cells.d.ts +10 -0
  157. package/esm/plugins/select-cells/select-cells.js +54 -6
  158. package/esm/plugins/table/config.js +51 -1
  159. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +1 -1
  160. package/esm/plugins/video/config.d.ts +6 -0
  161. package/esm/plugins/video/config.js +78 -82
  162. package/esm/plugins/video-properties/interface.d.ts +31 -0
  163. package/esm/plugins/video-properties/interface.js +6 -0
  164. package/esm/plugins/video-properties/readers.d.ts +26 -0
  165. package/esm/plugins/video-properties/readers.js +65 -0
  166. package/esm/plugins/video-properties/replace.d.ts +15 -0
  167. package/esm/plugins/video-properties/replace.js +97 -0
  168. package/esm/plugins/video-properties/ui/ui-video-form.d.ts +41 -0
  169. package/esm/plugins/video-properties/ui/ui-video-form.js +228 -0
  170. package/esm/plugins/video-properties/video-properties.d.ts +37 -0
  171. package/esm/plugins/video-properties/video-properties.js +175 -0
  172. package/esm/plugins/video-properties/writers.d.ts +15 -0
  173. package/esm/plugins/video-properties/writers.js +73 -0
  174. package/esm/types/types.d.ts +1 -1
  175. package/package.json +1 -1
  176. package/types/config.d.ts +29 -28
  177. package/types/core/helpers/utils/align.d.ts +1 -1
  178. package/types/core/helpers/utils/index.d.ts +1 -0
  179. package/types/core/helpers/utils/prepare-media.d.ts +19 -0
  180. package/types/langs/ar.d.ts +7 -0
  181. package/types/langs/az.d.ts +7 -0
  182. package/types/langs/cs_cz.d.ts +7 -0
  183. package/types/langs/de.d.ts +7 -0
  184. package/types/langs/es.d.ts +7 -0
  185. package/types/langs/fa.d.ts +7 -0
  186. package/types/langs/fi.d.ts +7 -0
  187. package/types/langs/fr.d.ts +7 -0
  188. package/types/langs/he.d.ts +7 -0
  189. package/types/langs/hu.d.ts +7 -0
  190. package/types/langs/id.d.ts +7 -0
  191. package/types/langs/it.d.ts +7 -0
  192. package/types/langs/ja.d.ts +7 -0
  193. package/types/langs/ko.d.ts +7 -0
  194. package/types/langs/mn.d.ts +7 -0
  195. package/types/langs/nl.d.ts +7 -0
  196. package/types/langs/no.d.ts +7 -0
  197. package/types/langs/pl.d.ts +7 -0
  198. package/types/langs/pt_br.d.ts +7 -0
  199. package/types/langs/ru.d.ts +7 -0
  200. package/types/langs/sk.d.ts +7 -0
  201. package/types/langs/sv.d.ts +7 -0
  202. package/types/langs/tr.d.ts +7 -0
  203. package/types/langs/ua.d.ts +7 -0
  204. package/types/langs/zh_cn.d.ts +7 -0
  205. package/types/langs/zh_tw.d.ts +7 -0
  206. package/types/modules/history/history.d.ts +17 -2
  207. package/types/plugins/clean-html/clean-html.d.ts +7 -0
  208. package/types/plugins/dtd/before-insert/check-block-nesting.d.ts +2 -1
  209. package/types/plugins/image-processor/image-processor.d.ts +4 -1
  210. package/types/plugins/image-properties/readers/align.d.ts +2 -2
  211. package/types/plugins/index.d.ts +1 -0
  212. package/types/plugins/inline-popup/config/items/iframe.d.ts +9 -1
  213. package/types/plugins/inline-popup/inline-popup.d.ts +5 -0
  214. package/types/plugins/media/config.d.ts +2 -1
  215. package/types/plugins/paste/helpers.d.ts +8 -0
  216. package/types/plugins/resizer/config.d.ts +5 -3
  217. package/types/plugins/resizer/resizer.d.ts +10 -0
  218. package/types/plugins/select-cells/select-cells.d.ts +10 -0
  219. package/types/plugins/video/config.d.ts +6 -0
  220. package/types/plugins/video-properties/interface.d.ts +31 -0
  221. package/types/plugins/video-properties/readers.d.ts +26 -0
  222. package/types/plugins/video-properties/replace.d.ts +15 -0
  223. package/types/plugins/video-properties/ui/ui-video-form.d.ts +41 -0
  224. package/types/plugins/video-properties/video-properties.d.ts +37 -0
  225. package/types/plugins/video-properties/writers.d.ts +15 -0
  226. package/types/types/types.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.18.2
4
+ * Version: v4.18.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -733,28 +733,18 @@ let ConfigPrototype = {};
733
733
  * them unaligned
734
734
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "imageDefaultAlign", 'normal');
735
735
  /**
736
- * Class names to align images with, instead of an inline `float` or
737
- * `margin`. Aligning an image removes every class listed here and adds the
738
- * chosen alignment's, which can be several separated by spaces. An
739
- * alignment can also list several such sets, to recognise each of them;
740
- * aligning writes the first. `alignClasses.img` takes its place when set.
741
- *
742
- * ```javascript
743
- * Jodit.make('#editor', {
744
- * imageAlignClasses: {
745
- * left: 'align-left',
746
- * right: 'align-right',
747
- * center: ['align-center', 'centered']
748
- * }
749
- * });
750
- * ```
736
+ * @deprecated Use `alignClasses.img`, which takes the same value. When
737
+ * `alignClasses.img` isn't set, the editor copies this into it.
751
738
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "imageAlignClasses", null);
752
739
  /**
753
- * Class names to align elements with, by tag name, as `imageAlignClasses`
754
- * does for images: `img`, and `video`, `audio` and `iframe` in the media
755
- * popup. A media wrapper (see `mediaWrappers`), and Jodit's own `jodit` and
756
- * `jodit-media` wrappers, are aligned with the classes for the media in
757
- * them.
740
+ * Class names to align elements with, by tag name, instead of an inline
741
+ * `float` or `margin`: `img`, and `video`, `audio` and `iframe` in the
742
+ * media popup. Aligning an element removes every class listed for its tag
743
+ * and adds the chosen alignment's, which can be several separated by
744
+ * spaces. An alignment can also list several such sets, to recognise each
745
+ * of them; aligning writes the first. A media wrapper (see
746
+ * `mediaWrappers`), and Jodit's own `jodit` and `jodit-media` wrappers,
747
+ * are aligned with the classes for the media in them.
758
748
  *
759
749
  * ```javascript
760
750
  * const media = {
@@ -764,7 +754,15 @@ let ConfigPrototype = {};
764
754
  * };
765
755
  *
766
756
  * Jodit.make('#editor', {
767
- * alignClasses: { video: media, iframe: media }
757
+ * alignClasses: {
758
+ * img: {
759
+ * left: 'align-left',
760
+ * right: 'align-right',
761
+ * center: ['align-center', 'centered']
762
+ * },
763
+ * video: media,
764
+ * iframe: media
765
+ * }
768
766
  * });
769
767
  * ```
770
768
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "alignClasses", {});
@@ -1824,7 +1822,7 @@ __webpack_require__.r(__webpack_exports__);
1824
1822
  * ```
1825
1823
  * @packageDocumentation
1826
1824
  * @module constants
1827
- */ const APP_VERSION = "4.18.2";
1825
+ */ const APP_VERSION = "4.18.4";
1828
1826
  // prettier-ignore
1829
1827
  const ES = "es2021";
1830
1828
  const IS_ES_MODERN = true;
@@ -7628,7 +7626,7 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
7628
7626
  /**
7629
7627
  * The class names to align `elm` with: `alignClasses` for its tag, or for the
7630
7628
  * media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
7631
- * `jodit-media`), falling back to `imageAlignClasses` for an image
7629
+ * `jodit-media`)
7632
7630
  */ function getAlignClasses(jodit, elm) {
7633
7631
  if (!elm) {
7634
7632
  return null;
@@ -7637,8 +7635,7 @@ const classSets = (value)=>((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPO
7637
7635
  'jodit',
7638
7636
  'jodit-media'
7639
7637
  ])) ? elm.firstElementChild : (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_4__.getWrappedMedia)(jodit, elm);
7640
- const tag = (media ?? elm).nodeName.toLowerCase();
7641
- return jodit.o.alignClasses?.[tag] ?? (tag === 'img' ? jodit.o.imageAlignClasses : null);
7638
+ return jodit.o.alignClasses?.[(media ?? elm).nodeName.toLowerCase()] ?? null;
7642
7639
  }
7643
7640
  /**
7644
7641
  * Align image, with `classes` (see `alignClasses`) instead of inline styles
@@ -8828,13 +8825,13 @@ const getClassName = (obj)=>{
8828
8825
  "use strict";
8829
8826
  __webpack_require__.r(__webpack_exports__);
8830
8827
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8831
- /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.$$; },
8828
+ /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.$$; },
8832
8829
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
8833
8830
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
8834
8831
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
8835
8832
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
8836
8833
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
8837
- /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_27__.LimitedStack; },
8834
+ /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_28__.LimitedStack; },
8838
8835
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.OptionsError; },
8839
8836
  /* harmony export */ UNSAFE_PROTO_KEYS: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.UNSAFE_PROTO_KEYS; },
8840
8837
  /* harmony export */ abort: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.abort; },
@@ -8846,9 +8843,9 @@ __webpack_require__.r(__webpack_exports__);
8846
8843
  /* harmony export */ attrRaw: function() { return /* reexport safe */ _attr__WEBPACK_IMPORTED_MODULE_3__.attrRaw; },
8847
8844
  /* harmony export */ browser: function() { return /* reexport safe */ _browser__WEBPACK_IMPORTED_MODULE_4__.browser; },
8848
8845
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
8849
- /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.call; },
8850
- /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callPromise; },
8851
- /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.callThis; },
8846
+ /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.call; },
8847
+ /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callPromise; },
8848
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.callThis; },
8852
8849
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
8853
8850
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
8854
8851
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.cns; },
@@ -8858,7 +8855,7 @@ __webpack_require__.r(__webpack_exports__);
8858
8855
  /* harmony export */ createMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.createMediaWrapper; },
8859
8856
  /* harmony export */ css: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.css; },
8860
8857
  /* harmony export */ cssInline: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.cssInline; },
8861
- /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.cssPath; },
8858
+ /* harmony export */ cssPath: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.cssPath; },
8862
8859
  /* harmony export */ ctrlKey: function() { return /* reexport safe */ _ctrl_key__WEBPACK_IMPORTED_MODULE_10__.ctrlKey; },
8863
8860
  /* harmony export */ dataBind: function() { return /* reexport safe */ _data_bind__WEBPACK_IMPORTED_MODULE_11__.dataBind; },
8864
8861
  /* harmony export */ defaultLanguage: function() { return /* reexport safe */ _default_language__WEBPACK_IMPORTED_MODULE_12__.defaultLanguage; },
@@ -8867,34 +8864,36 @@ __webpack_require__.r(__webpack_exports__);
8867
8864
  /* harmony export */ get: function() { return /* reexport safe */ _get__WEBPACK_IMPORTED_MODULE_15__.get; },
8868
8865
  /* harmony export */ getAlignClasses: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses; },
8869
8866
  /* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
8870
- /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getDataTransfer; },
8867
+ /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getDataTransfer; },
8871
8868
  /* harmony export */ getHAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
8872
8869
  /* harmony export */ getMediaWrapper: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getMediaWrapper; },
8873
- /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.getPropertyDescriptor; },
8870
+ /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.getPropertyDescriptor; },
8874
8871
  /* harmony export */ getWrappedMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.getWrappedMedia; },
8875
- /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.getXPathByElement; },
8872
+ /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.getXPathByElement; },
8876
8873
  /* harmony export */ hAlignElement: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
8877
8874
  /* harmony export */ humanSizeToBytes: function() { return /* reexport safe */ _human_size_to_bytes__WEBPACK_IMPORTED_MODULE_17__.humanSizeToBytes; },
8878
- /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.inView; },
8875
+ /* harmony export */ inView: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.inView; },
8879
8876
  /* harmony export */ isAtom: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.isAtom; },
8880
8877
  /* harmony export */ isUnsafeProtoKey: function() { return /* reexport safe */ _is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_18__.isUnsafeProtoKey; },
8881
8878
  /* harmony export */ keepNames: function() { return /* reexport safe */ _get_class_name__WEBPACK_IMPORTED_MODULE_16__.keepNames; },
8882
- /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.keys; },
8883
- /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.loadImage; },
8879
+ /* harmony export */ keys: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.keys; },
8880
+ /* harmony export */ loadImage: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.loadImage; },
8884
8881
  /* harmony export */ loadNext: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNext; },
8885
8882
  /* harmony export */ loadNextStyle: function() { return /* reexport safe */ _append_script__WEBPACK_IMPORTED_MODULE_1__.loadNextStyle; },
8886
8883
  /* harmony export */ markAsAtomic: function() { return /* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_14__.markAsAtomic; },
8887
8884
  /* harmony export */ markDeprecated: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__.markDeprecated; },
8888
- /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.markOwner; },
8889
- /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_28__.memorizeExec; },
8885
+ /* harmony export */ markOwner: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.markOwner; },
8886
+ /* harmony export */ memorizeExec: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_29__.memorizeExec; },
8890
8887
  /* harmony export */ options: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.options; },
8891
8888
  /* harmony export */ parseQuery: function() { return /* reexport safe */ _parse_query__WEBPACK_IMPORTED_MODULE_21__.parseQuery; },
8892
- /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_22__.previewBox; },
8893
- /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.refs; },
8894
- /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_23__.reset; },
8895
- /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_25__.resolveElement; },
8896
- /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__.scrollIntoViewIfNeeded; },
8897
- /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_26__.set; },
8889
+ /* harmony export */ prepareEmbedCode: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareEmbedCode; },
8890
+ /* harmony export */ prepareMedia: function() { return /* reexport safe */ _prepare_media__WEBPACK_IMPORTED_MODULE_22__.prepareMedia; },
8891
+ /* harmony export */ previewBox: function() { return /* reexport safe */ _print__WEBPACK_IMPORTED_MODULE_23__.previewBox; },
8892
+ /* harmony export */ refs: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.refs; },
8893
+ /* harmony export */ reset: function() { return /* reexport safe */ _reset__WEBPACK_IMPORTED_MODULE_24__.reset; },
8894
+ /* harmony export */ resolveElement: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_26__.resolveElement; },
8895
+ /* harmony export */ scrollIntoViewIfNeeded: function() { return /* reexport safe */ _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__.scrollIntoViewIfNeeded; },
8896
+ /* harmony export */ set: function() { return /* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_27__.set; },
8898
8897
  /* harmony export */ wrapMedia: function() { return /* reexport safe */ _media_wrapper__WEBPACK_IMPORTED_MODULE_20__.wrapMedia; }
8899
8898
  /* harmony export */ });
8900
8899
  /* harmony import */ var _align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
@@ -8923,13 +8922,14 @@ __webpack_require__.r(__webpack_exports__);
8923
8922
  /* harmony import */ var _mark_deprecated__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49385);
8924
8923
  /* harmony import */ var _media_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(83314);
8925
8924
  /* harmony import */ var _parse_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(36310);
8926
- /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(57075);
8927
- /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(43379);
8928
- /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(60898);
8929
- /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(28723);
8930
- /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(52144);
8931
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(42820);
8932
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(71125);
8925
+ /* harmony import */ var _prepare_media__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(89214);
8926
+ /* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(57075);
8927
+ /* harmony import */ var _reset__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(43379);
8928
+ /* harmony import */ var _scroll_into_view__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(60898);
8929
+ /* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(28723);
8930
+ /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(52144);
8931
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(42820);
8932
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(71125);
8933
8933
  /*!
8934
8934
  * Jodit Editor (https://xdsoft.net/jodit/)
8935
8935
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -8965,6 +8965,7 @@ __webpack_require__.r(__webpack_exports__);
8965
8965
 
8966
8966
 
8967
8967
 
8968
+
8968
8969
 
8969
8970
 
8970
8971
  /***/ }),
@@ -9136,6 +9137,48 @@ const isWrapper = (node, wrapper)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0
9136
9137
  /* harmony export */ ]);
9137
9138
 
9138
9139
 
9140
+ /***/ }),
9141
+
9142
+ /***/ 89214:
9143
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9144
+
9145
+ "use strict";
9146
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9147
+ /* harmony export */ prepareEmbedCode: function() { return /* binding */ prepareEmbedCode; },
9148
+ /* harmony export */ prepareMedia: function() { return /* binding */ prepareMedia; }
9149
+ /* harmony export */ });
9150
+ /* harmony import */ var jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16849);
9151
+ /* harmony import */ var jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83314);
9152
+ /*!
9153
+ * Jodit Editor (https://xdsoft.net/jodit/)
9154
+ * Released under MIT see LICENSE.txt in the project root for license information.
9155
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
9156
+ */ /**
9157
+ * @module helpers/utils
9158
+ */
9159
+
9160
+ /**
9161
+ * Puts new media in its wrapper (see `mediaWrappers`) and aligns it with
9162
+ * `mediaDefaultAlign`. Returns the wrapper, or `element` when there is none
9163
+ */ function prepareMedia(jodit, element) {
9164
+ const media = (0,jodit_core_helpers_utils_media_wrapper__WEBPACK_IMPORTED_MODULE_1__.wrapMedia)(jodit, element);
9165
+ const { mediaDefaultAlign } = jodit.o;
9166
+ if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
9167
+ (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));
9168
+ }
9169
+ return media;
9170
+ }
9171
+ /**
9172
+ * Embed code that is one element is prepared as media (see `prepareMedia`);
9173
+ * other code is returned as it is
9174
+ */ function prepareEmbedCode(jodit, code) {
9175
+ const box = jodit.createInside.div();
9176
+ box.innerHTML = code.trim();
9177
+ const element = box.firstElementChild;
9178
+ return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
9179
+ }
9180
+
9181
+
9139
9182
  /***/ }),
9140
9183
 
9141
9184
  /***/ 57075:
@@ -13314,7 +13357,9 @@ function toggleAttribute(jodit, value, elm, key, dry, mode) {
13314
13357
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, fragment);
13315
13358
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeInsertNode(range, wrapper);
13316
13359
  if (style.elementIsBlock) {
13317
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(wrapper) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(wrapper.firstElementChild, 'br')) {
13360
+ // The wrapped content can bring its own `<br>` (an empty table
13361
+ // cell's), after or inside the temporary `<font>` around the selection
13362
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(wrapper) && !wrapper.querySelector('br')) {
13318
13363
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(wrapper, ci.element('br'));
13319
13364
  }
13320
13365
  }
@@ -17875,6 +17920,18 @@ const __defaultClassesKey = 'data-jodit-default-classes';
17875
17920
  const NOEDIT = {
17876
17921
  contenteditable: false
17877
17922
  };
17923
+ /**
17924
+ * The editor's options, with the deprecated `imageAlignClasses` copied into
17925
+ * `alignClasses.img` when that isn't set
17926
+ */ function makeOptions(options) {
17927
+ const opt = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions);
17928
+ if (opt.imageAlignClasses && !opt.alignClasses?.img) {
17929
+ opt.alignClasses = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)({
17930
+ img: opt.imageAlignClasses
17931
+ }, opt.alignClasses);
17932
+ }
17933
+ return opt;
17934
+ }
17878
17935
  class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar {
17879
17936
  /** @override */ className() {
17880
17937
  return 'Jodit';
@@ -18643,7 +18700,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18643
18700
  // do nothing
18644
18701
  }
18645
18702
  /** @override **/ initOptions(options) {
18646
- this.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions);
18703
+ this.options = makeOptions(options);
18647
18704
  }
18648
18705
  /** @override **/ initOwners() {
18649
18706
  // in iframe, it can be changed
@@ -18757,7 +18814,7 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
18757
18814
  right: rightSlot
18758
18815
  },
18759
18816
  statusbar: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.StatusBar(this, container),
18760
- options: this.isReady ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions) : this.options,
18817
+ options: this.isReady ? makeOptions(options) : this.options,
18761
18818
  history: new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.History(this),
18762
18819
  editorWindow: this.ow
18763
18820
  };
@@ -22344,13 +22401,11 @@ class Command {
22344
22401
  /* harmony export */ History: function() { return /* binding */ History; }
22345
22402
  /* harmony export */ });
22346
22403
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
22347
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
22348
- /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59609);
22349
- /* harmony import */ var jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55184);
22350
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5266);
22351
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8838);
22352
- /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46363);
22353
- /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33511);
22404
+ /* harmony import */ var jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59609);
22405
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
22406
+ /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8838);
22407
+ /* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(46363);
22408
+ /* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33511);
22354
22409
  /*!
22355
22410
  * Jodit Editor (https://xdsoft.net/jodit/)
22356
22411
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -22365,43 +22420,45 @@ class Command {
22365
22420
 
22366
22421
 
22367
22422
 
22368
-
22369
-
22370
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22423
+ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.history = {
22371
22424
  enable: true,
22372
22425
  maxHistoryLength: Infinity,
22373
22426
  timeout: 1000
22374
22427
  };
22375
22428
  /**
22376
22429
  * The module monitors the status of the editor and creates / deletes the required number of Undo / Redo shots .
22377
- */ class History extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_2__.ViewComponent {
22430
+ */ class History extends jodit_core_component_view_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
22378
22431
  /** @override */ className() {
22379
22432
  return 'History';
22380
22433
  }
22381
22434
  /**
22382
22435
  * Return state of the WYSIWYG editor to step back
22383
22436
  */ redo() {
22437
+ this.__processPendingChanges();
22384
22438
  if (this.__stack.redo()) {
22385
22439
  this.startValue = this.snapshot.make();
22386
22440
  this.fireChangeStack();
22387
22441
  }
22388
22442
  }
22389
22443
  canRedo() {
22390
- return this.__stack.canRedo();
22444
+ return !this.__hasPendingChanges && this.__stack.canRedo();
22391
22445
  }
22392
22446
  /**
22393
22447
  * Return the state of the WYSIWYG editor to step forward
22394
22448
  */ undo() {
22449
+ this.__processPendingChanges();
22395
22450
  if (this.__stack.undo()) {
22396
22451
  this.startValue = this.snapshot.make();
22397
22452
  this.fireChangeStack();
22398
22453
  }
22399
22454
  }
22400
22455
  canUndo() {
22401
- return this.__stack.canUndo();
22456
+ return this.__hasPendingChanges || this.__stack.canUndo();
22402
22457
  }
22403
22458
  clear() {
22404
22459
  this.startValue = this.snapshot.make();
22460
+ this.async.clearTimeout(this.__timer);
22461
+ this.__hasPendingChanges = false;
22405
22462
  this.__stack.clear();
22406
22463
  this.fireChangeStack();
22407
22464
  }
@@ -22421,9 +22478,29 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22421
22478
  this.updateTick += 1;
22422
22479
  }
22423
22480
  /**
22424
- * Push new command in stack on some changes
22481
+ * Push new command in stack on some changes. The first change opens a
22482
+ * step, and later ones join it until `history.timeout` has passed,
22483
+ * however close together they come.
22425
22484
  */ onChange() {
22426
- this.__processChanges();
22485
+ // A transaction is over by the time the step is recorded, so it is
22486
+ // checked now
22487
+ if (this.snapshot.isBlocked || this.__hasPendingChanges) {
22488
+ return;
22489
+ }
22490
+ this.__hasPendingChanges = true;
22491
+ this.__timer = this.async.setTimeout(()=>this.__processPendingChanges(), this.j.o.history.timeout);
22492
+ // With a timeout of 0 the step is already recorded. Otherwise
22493
+ // canUndo and canRedo count it from now
22494
+ if (this.__hasPendingChanges) {
22495
+ this.fireChangeStack();
22496
+ }
22497
+ }
22498
+ /**
22499
+ * Push the open step's changes now
22500
+ */ __processPendingChanges() {
22501
+ if (this.__hasPendingChanges) {
22502
+ this.__processChanges();
22503
+ }
22427
22504
  }
22428
22505
  /**
22429
22506
  * @internal
@@ -22431,13 +22508,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22431
22508
  if (this.snapshot.isBlocked || !this.j.o.history.enable) {
22432
22509
  return;
22433
22510
  }
22511
+ this.async.clearTimeout(this.__timer);
22512
+ this.__hasPendingChanges = false;
22434
22513
  this.updateStack();
22435
22514
  }
22436
22515
  /**
22437
22516
  * Update history stack
22438
22517
  */ updateStack(replace = false) {
22439
22518
  const newValue = this.snapshot.make();
22440
- if (_snapshot__WEBPACK_IMPORTED_MODULE_6__.Snapshot.equal(newValue, this.startValue)) {
22519
+ if (_snapshot__WEBPACK_IMPORTED_MODULE_4__.Snapshot.equal(newValue, this.startValue)) {
22441
22520
  return;
22442
22521
  }
22443
22522
  // Only the selection moved, for example when the selection markers
@@ -22447,7 +22526,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22447
22526
  this.startValue = newValue;
22448
22527
  return;
22449
22528
  }
22450
- const newCommand = new _command__WEBPACK_IMPORTED_MODULE_5__.Command(this.startValue, newValue, this, this.updateTick);
22529
+ const newCommand = new _command__WEBPACK_IMPORTED_MODULE_3__.Command(this.startValue, newValue, this, this.updateTick);
22451
22530
  if (replace) {
22452
22531
  const command = this.__stack.current();
22453
22532
  if (command && this.updateTick === command.tick) {
@@ -22472,8 +22551,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22472
22551
  this.snapshot.destruct();
22473
22552
  super.destruct();
22474
22553
  }
22475
- constructor(editor, stack = new _stack__WEBPACK_IMPORTED_MODULE_7__.Stack(editor.o.history.maxHistoryLength), snapshot = new _snapshot__WEBPACK_IMPORTED_MODULE_6__.Snapshot(editor)){
22476
- super(editor), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__startValue", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__stack", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapshot", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "updateTick", 0);
22554
+ constructor(editor, stack = new _stack__WEBPACK_IMPORTED_MODULE_5__.Stack(editor.o.history.maxHistoryLength), snapshot = new _snapshot__WEBPACK_IMPORTED_MODULE_4__.Snapshot(editor)){
22555
+ super(editor), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__startValue", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__stack", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapshot", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "updateTick", 0), /**
22556
+ * A step is open: changes have come in that are not in the stack yet
22557
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hasPendingChanges", false), /**
22558
+ * Records the open step `history.timeout` after its first change
22559
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__timer", 0);
22477
22560
  this.__stack = stack;
22478
22561
  this.snapshot = snapshot;
22479
22562
  if (editor.o.history.enable) {
@@ -22484,6 +22567,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22484
22567
  this.startValue = this.snapshot.make();
22485
22568
  editor.events// save selection
22486
22569
  .on('internalChange internalUpdate', ()=>{
22570
+ this.__processPendingChanges();
22487
22571
  this.startValue = this.snapshot.make();
22488
22572
  }).on(editor.editor, [
22489
22573
  'changeSelection',
@@ -22497,14 +22581,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.history = {
22497
22581
  if (this.startValue.html === this.j.getNativeEditorValue()) {
22498
22582
  this.startValue = this.snapshot.make();
22499
22583
  }
22500
- }).on(this, 'change.history', this.onChange);
22584
+ }).on(this, 'change.history', ()=>this.onChange());
22501
22585
  });
22502
22586
  }
22503
22587
  }
22504
22588
  }
22505
- ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
22506
- (0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.debounce)()
22507
- ], History.prototype, "onChange", null);
22508
22589
 
22509
22590
 
22510
22591
  /***/ }),
@@ -24103,7 +24184,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24103
24184
  const columnsCount = Table.__getColumnsCount(table);
24104
24185
  row = create.element('tr');
24105
24186
  for(let j = 0; j < columnsCount; j += 1){
24106
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, create.element('td'));
24187
+ const cell = create.element('td');
24188
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24189
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, cell);
24107
24190
  }
24108
24191
  } else {
24109
24192
  row = line.cloneNode(true);
@@ -24120,6 +24203,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24120
24203
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.each(row, (cell)=>{
24121
24204
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(cell)) {
24122
24205
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.detach(cell);
24206
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24123
24207
  }
24124
24208
  });
24125
24209
  }
@@ -24208,6 +24292,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24208
24292
  const cells = box[i];
24209
24293
  if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
24210
24294
  const cell = this.j.createInside.element('td');
24295
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, this.j.createInside.element('br'));
24211
24296
  if (insertAfter) {
24212
24297
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(cells[columnIndex], cell);
24213
24298
  } else {
@@ -24431,7 +24516,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24431
24516
  Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
24432
24517
  }
24433
24518
  }
24434
- first.innerHTML = html.join('<br/>');
24519
+ first.innerHTML = html.join('<br/>') || '<br/>';
24435
24520
  instance(jodit).addSelection(first);
24436
24521
  alreadyMerged.delete(first);
24437
24522
  Table.__unmark(__marked);
@@ -26663,8 +26748,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
26663
26748
  const box = (0,jodit_modules_widget_tabs_tabs__WEBPACK_IMPORTED_MODULE_3__.TabsWidget)(editor, tabs);
26664
26749
  // Marks this popup so its tabs auto-size to their labels (see
26665
26750
  // `.jodit-file-selector` in tabs.less) — long localized tab captions are no
26666
- // longer clipped — while leaving other tab popups (link, video …)
26667
- // untouched.
26751
+ // longer clipped — while leaving other tab popups (link …) untouched. The
26752
+ // video popup, which has an Upload tab too, uses it as well.
26668
26753
  box.classList.add('jodit-file-selector');
26669
26754
  return box;
26670
26755
  };
@@ -27695,6 +27780,10 @@ class backspace extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugin {
27695
27780
  if (!sel.isFocused()) {
27696
27781
  sel.focus();
27697
27782
  }
27783
+ // Focused with no range, as WebKit leaves it after a click on an embed
27784
+ if (!sel.isInsideArea) {
27785
+ return;
27786
+ }
27698
27787
  if ((0,_cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_8__.checkNotCollapsed)(jodit)) {
27699
27788
  jodit.e.fire('backSpaceAfterDelete', backspace);
27700
27789
  return false;
@@ -28890,7 +28979,8 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
28890
28979
  /* harmony import */ var jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48155);
28891
28980
  /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(18855);
28892
28981
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(11173);
28893
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54053);
28982
+ /* harmony import */ var _helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(35104);
28983
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(54053);
28894
28984
  /*!
28895
28985
  * Jodit Editor (https://xdsoft.net/jodit/)
28896
28986
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -28909,6 +28999,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
28909
28999
 
28910
29000
 
28911
29001
 
29002
+
28912
29003
  /**
28913
29004
  * Clean HTML after removeFormat and insertHorizontalRule command
28914
29005
  */ const TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
@@ -28933,18 +29024,18 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
28933
29024
  }
28934
29025
  startWalker() {
28935
29026
  const { jodit } = this;
28936
- const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getHash)(this.j.o.cleanHTML.allowTags);
28937
- const deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getHash)(this.j.o.cleanHTML.denyTags);
28938
- this.walker.on('visit', (node)=>(0,_helpers__WEBPACK_IMPORTED_MODULE_9__.visitNodeWalker)(jodit, node, allow, deny, this.currentSelectionNode)).on('end', (affected)=>{
29027
+ const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.allowTags);
29028
+ const deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.denyTags);
29029
+ this.walker.on('visit', (node)=>(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.visitNodeWalker)(jodit, node, allow, deny, this.currentSelectionNode)).on('end', (affected)=>{
28939
29030
  this.j.e.fire(affected ? 'internalChange finishedCleanHTMLWorker' : 'finishedCleanHTMLWorker');
28940
29031
  });
28941
29032
  }
28942
29033
  beforeCommand(command) {
28943
29034
  if (command.toLowerCase() === 'removeformat') {
28944
29035
  if (this.j.s.isCollapsed()) {
28945
- (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeFormatForCollapsedSelection)(this.j);
29036
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForCollapsedSelection)(this.j);
28946
29037
  } else {
28947
- (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeFormatForSelection)(this.j);
29038
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removeFormatForSelection)(this.j);
28948
29039
  }
28949
29040
  return false;
28950
29041
  }
@@ -28970,6 +29061,7 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
28970
29061
  ];
28971
29062
  sandBox.innerHTML = data.value;
28972
29063
  this.j.e.fire('safeHTML', sandBox);
29064
+ this.__replaceOldTags(sandBox);
28973
29065
  data.value = sandBox.innerHTML;
28974
29066
  (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_6__.safeHTML)(sandBox, {
28975
29067
  safeJavaScriptLink: true,
@@ -28978,6 +29070,20 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
28978
29070
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(iframe);
28979
29071
  return false;
28980
29072
  }
29073
+ /**
29074
+ * Replace old tags (`<b>` with `<strong>`, `<i>` with `<em>`) in an
29075
+ * assigned value straight away. The walker would get to them only after
29076
+ * every node before them, seconds later on a long document, and until
29077
+ * then Bold does not treat `<b>` as bold, and the swap can move the caret.
29078
+ */ __replaceOldTags(box) {
29079
+ const { replaceOldTags: list, disableCleanFilter } = this.j.o.cleanHTML;
29080
+ if (!list || disableCleanFilter?.has('replaceOldTags')) {
29081
+ return;
29082
+ }
29083
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(box, (node)=>{
29084
+ ;(0,_helpers_visitor_filters_replace_old_tags__WEBPACK_IMPORTED_MODULE_9__.replaceOldTags)(this.j, node, false);
29085
+ });
29086
+ }
28981
29087
  /**
28982
29088
  * Collapse a value that holds only a single empty block (e.g.
28983
29089
  * `<p><br></p>` left after deleting all content) to an empty string —
@@ -29710,10 +29816,33 @@ __webpack_require__.r(__webpack_exports__);
29710
29816
  }
29711
29817
  const tagName = list[oldParent.nodeName.toLowerCase()] || list[oldParent.nodeName];
29712
29818
  if (tagName) {
29713
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
29819
+ const restoreSelection = keepSelection(jodit, oldParent);
29820
+ const newParent = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(oldParent, tagName, jodit.createInside, true, false);
29821
+ restoreSelection?.(newParent);
29822
+ return newParent;
29714
29823
  }
29715
29824
  return oldParent;
29716
29825
  }
29826
+ /**
29827
+ * Moving the children out of an element collapses a selection inside them to
29828
+ * where the element was, so the caret jumps to the start of the text being
29829
+ * typed. Returns a callback that puts the selection back on the same nodes.
29830
+ *
29831
+ * Like `removeEmptyTextNode`, it leaves the selection alone once focus has
29832
+ * left the editor, because selecting would take focus back.
29833
+ */ function keepSelection(jodit, elm) {
29834
+ const { sel } = jodit.s;
29835
+ if (!sel?.anchorNode || !sel.focusNode || !jodit.s.isFocused()) {
29836
+ return null;
29837
+ }
29838
+ const { anchorNode, anchorOffset, focusNode, focusOffset } = sel;
29839
+ 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)) {
29840
+ return null;
29841
+ }
29842
+ return (newElm)=>{
29843
+ sel.setBaseAndExtent(anchorNode === elm ? newElm : anchorNode, anchorOffset, focusNode === elm ? newElm : focusNode, focusOffset);
29844
+ };
29845
+ }
29717
29846
 
29718
29847
 
29719
29848
  /***/ }),
@@ -31352,9 +31481,31 @@ const brBoxes = new Set([
31352
31481
  * @module plugins/dtd
31353
31482
  * @internal
31354
31483
  */
31484
+ /**
31485
+ * Moves the cursor out of a block that can't hold the inserted block: before
31486
+ * or after it when the cursor is at its edge, or between its two halves when
31487
+ * the cursor is inside its content. An empty block is removed
31488
+ */ function moveCursorOutOf(jodit, parent) {
31489
+ const { s } = jodit;
31490
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
31491
+ s.setCursorAfter(parent);
31492
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
31493
+ return;
31494
+ }
31495
+ if (s.cursorOnTheRight(parent)) {
31496
+ s.setCursorAfter(parent);
31497
+ return;
31498
+ }
31499
+ if (s.cursorOnTheLeft(parent)) {
31500
+ s.setCursorBefore(parent);
31501
+ return;
31502
+ }
31503
+ s.setCursorAfter(s.splitSelection(parent) ?? parent);
31504
+ }
31355
31505
  /**
31356
31506
  * Checks whether the insertion of an element at the current location is allowed,
31357
- * if it is not allowed, it deletes an empty block element or moves the cursor after it
31507
+ * if it is not allowed, it deletes an empty block element, moves the cursor
31508
+ * before or after it, or splits it at the cursor
31358
31509
  * @internal
31359
31510
  */ function checkBlockNesting(jodit, node) {
31360
31511
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isFragment(node)) {
@@ -31382,10 +31533,7 @@ const brBoxes = new Set([
31382
31533
  parent = current;
31383
31534
  }
31384
31535
  if (parent) {
31385
- jodit.s.setCursorAfter(parent);
31386
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)) {
31387
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
31388
- }
31536
+ moveCursorOutOf(jodit, parent);
31389
31537
  }
31390
31538
  }
31391
31539
  }
@@ -31915,7 +32063,14 @@ function brBefore(start) {
31915
32063
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(link, fake);
31916
32064
  } else if (s.cursorOnTheLeft(link, fake)) {
31917
32065
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(link, fake);
32066
+ } else {
32067
+ return;
31918
32068
  }
32069
+ // The block is split at the caret, so the caret leaves the link too:
32070
+ // beside the fake, since Safari mislays a caret inside a removed node
32071
+ const range = s.createRange();
32072
+ range.setStartBefore(fake);
32073
+ s.selectRange(range);
31919
32074
  }
31920
32075
  }
31921
32076
 
@@ -32158,9 +32313,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
32158
32313
 
32159
32314
  "use strict";
32160
32315
  /* unused harmony export focus */
32161
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
32162
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28077);
32163
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5266);
32316
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
32317
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27795);
32318
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28077);
32319
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5266);
32164
32320
  /*!
32165
32321
  * Jodit Editor (https://xdsoft.net/jodit/)
32166
32322
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -32172,15 +32328,16 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
32172
32328
  */
32173
32329
 
32174
32330
 
32331
+
32175
32332
  /**
32176
32333
  * After loading the page into the editor once the focus is set
32177
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.autofocus = false;
32334
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.autofocus = false;
32178
32335
  /**
32179
32336
  * Cursor position after autofocus
32180
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.cursorAfterAutofocus = 'end';
32337
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.cursorAfterAutofocus = 'end';
32181
32338
  /**
32182
32339
  * Save current selection on blur event
32183
- */ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.saveSelectionOnBlur = true;
32340
+ */ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.saveSelectionOnBlur = true;
32184
32341
  function focus(editor) {
32185
32342
  if (editor.o.saveSelectionOnBlur) {
32186
32343
  // A click that brings focus back places the caret itself, and Chrome
@@ -32212,10 +32369,10 @@ function focus(editor) {
32212
32369
  let textNode = null;
32213
32370
  switch(editor.o.cursorAfterAutofocus){
32214
32371
  case 'start':
32215
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.first(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node));
32372
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node));
32216
32373
  break;
32217
32374
  case 'end':
32218
- textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.last(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(node));
32375
+ textNode = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.last(editor.editor, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node));
32219
32376
  break;
32220
32377
  }
32221
32378
  if (textNode) {
@@ -32233,7 +32390,8 @@ function focus(editor) {
32233
32390
  });
32234
32391
  editor.e.on('afterInit afterAddPlace', ()=>{
32235
32392
  editor.e.off(editor.editor, 'mousedown.autofocus').on(editor.editor, 'mousedown.autofocus', (e)=>{
32236
- if (editor.isEditorMode() && e.target && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(e.target) && !e.target.childNodes.length) {
32393
+ // An empty block takes the caret, but a video, say, can't hold one
32394
+ 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) {
32237
32395
  if (editor.editor === e.target) {
32238
32396
  editor.s.focus();
32239
32397
  } else {
@@ -32243,7 +32401,7 @@ function focus(editor) {
32243
32401
  });
32244
32402
  });
32245
32403
  }
32246
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('focus', focus);
32404
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('focus', focus);
32247
32405
 
32248
32406
 
32249
32407
  /***/ }),
@@ -33404,15 +33562,25 @@ function hr(editor) {
33404
33562
  const elm = editor.createInside.element('hr');
33405
33563
  editor.s.insertNode(elm, false, false);
33406
33564
  const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(elm.parentElement, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor);
33407
- if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor) {
33565
+ // A block that holds other blocks, such as a list item or a table
33566
+ // cell, keeps the line
33567
+ if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(block) && block !== editor.editor && !editor.o.dtd?.blockLimits[block.nodeName.toLowerCase()]) {
33408
33568
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(block, elm);
33409
33569
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(block);
33410
33570
  }
33411
- let p = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.next(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, editor.editor, false);
33412
- if (!p) {
33413
- p = editor.createInside.element(editor.o.enter);
33414
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
33571
+ const next = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findNotEmptySibling(elm, false);
33572
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(next)) {
33573
+ editor.s.setCursorIn(next, true);
33574
+ return false;
33415
33575
  }
33576
+ // In a list item or a table cell the text goes on after the line, as
33577
+ // it does with the browsers' own command
33578
+ 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))) {
33579
+ editor.s.setCursorAfter(elm);
33580
+ return false;
33581
+ }
33582
+ const p = editor.createInside.element(editor.o.enter);
33583
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(elm, p);
33416
33584
  editor.s.setCursorIn(p);
33417
33585
  return false;
33418
33586
  });
@@ -33438,7 +33606,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
33438
33606
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
33439
33607
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
33440
33608
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
33441
- 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' + '}';
33609
+ 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' + '}';
33442
33610
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
33443
33611
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33444
33612
 
@@ -33684,6 +33852,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
33684
33852
  const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
33685
33853
  const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
33686
33854
  const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
33855
+ const SELECTED_TAGS = new Set([
33856
+ 'img',
33857
+ 'jodit',
33858
+ 'jodit-media'
33859
+ ]);
33687
33860
  /**
33688
33861
  * Change editor's size after load all images
33689
33862
  */ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
@@ -33725,7 +33898,10 @@ const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
33725
33898
  }
33726
33899
  /**
33727
33900
  * While the selection is an image, only the image is highlighted: Safari
33728
- * paints the rest of a block image's line with its parent's highlight. See #1528
33901
+ * paints the rest of a block image's line with its parent's highlight. See #1528.
33902
+ * Media in a wrapper (`jodit-media`, the resizer's `jodit` for an embed, or
33903
+ * one from `mediaWrappers`) isn't highlighted either, as Safari paints its
33904
+ * wrapper's whole line, and its resize frame shows it's selected
33729
33905
  */ onSelectionChange() {
33730
33906
  const { jodit } = this;
33731
33907
  jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
@@ -33778,7 +33954,8 @@ function isImageSelected(jodit) {
33778
33954
  return false;
33779
33955
  }
33780
33956
  const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
33781
- return startContainer === endContainer && endOffset === startOffset + 1 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(startContainer.childNodes[startOffset], 'img') && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(jodit.editor, startContainer);
33957
+ const node = startContainer.childNodes[startOffset];
33958
+ return startContainer === endContainer && endOffset === startOffset + 1 && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, SELECTED_TAGS) || Boolean((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(jodit, node))) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(jodit.editor, startContainer);
33782
33959
  }
33783
33960
  /**
33784
33961
  * Remove the invisible-space text beside an image, which only held a caret.
@@ -35686,9 +35863,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
35686
35863
  /* harmony import */ var jodit_plugins_table_keyboard_navigation_table_keyboard_navigation__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(30110);
35687
35864
  /* harmony import */ var jodit_plugins_toolbar_navigation_toolbar_navigation__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(74192);
35688
35865
  /* harmony import */ var jodit_plugins_video_video__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(34142);
35689
- /* harmony import */ var jodit_plugins_wrap_nodes_wrap_nodes__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(22980);
35690
- /* harmony import */ var jodit_plugins_dtd_dtd__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(56894);
35691
- /* harmony import */ var jodit_plugins_xpath_xpath__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(52014);
35866
+ /* harmony import */ var jodit_plugins_video_properties_video_properties__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(40878);
35867
+ /* harmony import */ var jodit_plugins_wrap_nodes_wrap_nodes__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(22980);
35868
+ /* harmony import */ var jodit_plugins_dtd_dtd__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(56894);
35869
+ /* harmony import */ var jodit_plugins_xpath_xpath__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(52014);
35692
35870
  /*!
35693
35871
  * Jodit Editor (https://xdsoft.net/jodit/)
35694
35872
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -35761,6 +35939,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('indent', indent
35761
35939
 
35762
35940
 
35763
35941
 
35942
+
35764
35943
 
35765
35944
 
35766
35945
  /***/ }),
@@ -36023,6 +36202,12 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
36023
36202
  * @module plugins/inline-popup
36024
36203
  */
36025
36204
  /* harmony default export */ __webpack_exports__["default"] = ([
36205
+ {
36206
+ name: 'replace',
36207
+ icon: 'video',
36208
+ tooltip: 'Replace',
36209
+ popup: (editor, target, close)=>target ? editor.e.fire('generateReplaceVideoTabs', target, close) : undefined
36210
+ },
36026
36211
  {
36027
36212
  name: 'bin',
36028
36213
  tooltip: 'Delete',
@@ -36030,6 +36215,13 @@ const cmd = (control)=>control.args && (0,jodit_core_helpers_checker__WEBPACK_IM
36030
36215
  image && editor.s.removeNode(image);
36031
36216
  }
36032
36217
  },
36218
+ {
36219
+ name: 'pencil',
36220
+ tooltip: 'Edit',
36221
+ exec: (editor, target)=>{
36222
+ target && editor.e.fire('openVideoProperties', target);
36223
+ }
36224
+ },
36033
36225
  _img__WEBPACK_IMPORTED_MODULE_0__.align
36034
36226
  ]);
36035
36227
 
@@ -36270,10 +36462,30 @@ const align = {
36270
36462
  // A media wrapper kept in the content gets the media popup
36271
36463
  const type = mediaWrapper ? 'jodit-media' : target?.nodeName.toLowerCase();
36272
36464
  if (target && type && this.canShowPopupForType(type)) {
36273
- this.showPopup(()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j), type, target);
36465
+ const isMedia = type === 'jodit-media';
36466
+ // Beside the media in a wrapper kept in the content, which can fill
36467
+ // the line
36468
+ const bound = mediaWrapper && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getWrappedMedia)(this.j, mediaWrapper) || target;
36469
+ this.showPopup(()=>this.__bound(bound, isMedia), type, target);
36274
36470
  return false;
36275
36471
  }
36276
36472
  }
36473
+ /**
36474
+ * The box the popup opens beside: the target's, with room for the
36475
+ * resizer's handles when the target gets them, so it doesn't cover them
36476
+ */ __bound(target, isMedia) {
36477
+ const bound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.position)(target, this.j);
36478
+ const resizable = this.j.o.allowResizeTags;
36479
+ if (!isMedia && !(resizable && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(target, resizable))) {
36480
+ return bound;
36481
+ }
36482
+ const room = parseInt(this.j.ow.getComputedStyle(this.j.container).getPropertyValue('--jd-resizer-handle-size'), 10) / 2 || 0;
36483
+ return {
36484
+ ...bound,
36485
+ top: bound.top - room,
36486
+ height: bound.height + room * 2
36487
+ };
36488
+ }
36277
36489
  /**
36278
36490
  * Show inline popup with some toolbar
36279
36491
  *
@@ -37204,7 +37416,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
37204
37416
  height: jodit.o.video?.defaultHeight
37205
37417
  });
37206
37418
  if (embed !== html) {
37207
- return jodit.createInside.fromHTML(embed);
37419
+ const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.prepareEmbedCode)(jodit, embed);
37420
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
37208
37421
  }
37209
37422
  }
37210
37423
  if (jodit.s.isCollapsed()) {
@@ -37670,6 +37883,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
37670
37883
  } else if (mediaWrappers[element.nodeName.toLowerCase()]) {
37671
37884
  element = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.getMediaWrapper)(editor, element) ?? (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.wrapMedia)(editor, element);
37672
37885
  } else if (mediaInFakeBlock) {
37886
+ const media = element;
37673
37887
  const wrapper = editor.createInside.element(mediaFakeTag, {
37674
37888
  'data-jodit-temp': 1,
37675
37889
  contenteditable: false,
@@ -37677,11 +37891,17 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
37677
37891
  [`data-${keyFake}`]: 1
37678
37892
  });
37679
37893
  (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(wrapper, 'style', (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(element, 'style'));
37680
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(wrapper, {
37681
- display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block',
37682
- width: element.offsetWidth,
37683
- height: element.offsetHeight
37684
- });
37894
+ // The wrapper fits the media, whose size changes as its metadata loads
37895
+ // and as it's resized. A percentage width is of the line, so it takes that
37896
+ const fit = ()=>{
37897
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(wrapper, {
37898
+ display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(media, 'display') === 'inline-block' ? 'inline-block' : 'block',
37899
+ width: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.cssInline)(media, 'width').endsWith('%') ? '' : 'fit-content',
37900
+ height: ''
37901
+ });
37902
+ };
37903
+ fit();
37904
+ editor.e.on(media, 'changesize', fit);
37685
37905
  if (element.parentNode) {
37686
37906
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(element, wrapper);
37687
37907
  }
@@ -37690,10 +37910,27 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.mediaWrappers = {};
37690
37910
  } else {
37691
37911
  return;
37692
37912
  }
37913
+ // Selected, as an image is, so Delete and Backspace remove it
37693
37914
  editor.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
37694
- editor.s.setCursorAfter(element);
37915
+ editor.s.select(element);
37695
37916
  });
37696
37917
  };
37918
+ // Media in a wrapper kept in the content let clicks through to it, as
37919
+ // jodit-media covers its media, so a click selects the media rather than
37920
+ // playing it. An inline wrapper holds it as an inline-block, unless its
37921
+ // classes or style give it a display of their own
37922
+ const wrappers = Object.values(mediaWrappers);
37923
+ if (wrappers.length) {
37924
+ editor.e.on('afterInit', ()=>{
37925
+ const selectors = (list)=>[
37926
+ ...new Set(list)
37927
+ ].join(',');
37928
+ const scoped = ({ tag, className })=>`.jodit-wysiwyg ${tag}.${className}`;
37929
+ const inline = selectors(wrappers.filter(({ tag })=>jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_INLINE.test(tag)).map(scoped));
37930
+ const media = selectors(wrappers.flatMap((wrapper)=>mediaBlocks.map((tag)=>`${scoped(wrapper)}>${tag}`)));
37931
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__.getContainer)(editor, 'media-wrappers', 'style', true).innerHTML = (inline ? `:where(${inline}){display:inline-block}` : '') + `${media}{pointer-events:none}`;
37932
+ });
37933
+ }
37697
37934
  if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
37698
37935
  editor.e.on('afterGetValueFromEditor', (data)=>{
37699
37936
  const rxp = new RegExp(`<${mediaFakeTag}[^>]+data-${keyFake}[^>]+>([^]+?)</${mediaFakeTag}>`, 'ig');
@@ -38584,12 +38821,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38584
38821
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38585
38822
  /* harmony export */ askInsertTypeDialog: function() { return /* binding */ askInsertTypeDialog; },
38586
38823
  /* harmony export */ getAllTypes: function() { return /* binding */ getAllTypes; },
38587
- /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; }
38824
+ /* harmony export */ pasteInsertHtml: function() { return /* binding */ pasteInsertHtml; },
38825
+ /* harmony export */ removeGoogleDocsWrapper: function() { return /* binding */ removeGoogleDocsWrapper; }
38588
38826
  /* harmony export */ });
38589
38827
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
38590
38828
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
38591
- /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28686);
38592
- /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53681);
38829
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
38830
+ /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28686);
38831
+ /* harmony import */ var jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53681);
38593
38832
  /*!
38594
38833
  * Jodit Editor (https://xdsoft.net/jodit/)
38595
38834
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -38600,6 +38839,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38600
38839
 
38601
38840
 
38602
38841
 
38842
+
38603
38843
  /**
38604
38844
  * Remove special HTML comments
38605
38845
  * @private
@@ -38615,6 +38855,21 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38615
38855
  }
38616
38856
  return html;
38617
38857
  }
38858
+ /**
38859
+ * Google Docs wraps the copied content in
38860
+ * `<b style="font-weight:normal;" id="docs-internal-guid-…">`. Kept, the
38861
+ * wrapper holds the pasted blocks, and without its style it makes the whole
38862
+ * paste bold
38863
+ * @private
38864
+ */ function removeGoogleDocsWrapper(html) {
38865
+ if (!/<b\s[^>]*docs-internal-guid-/i.test(html)) {
38866
+ return html;
38867
+ }
38868
+ // An inert document: images don't load and handlers don't run
38869
+ const { body } = new DOMParser().parseFromString(html, 'text/html');
38870
+ (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__.toArray)(body.querySelectorAll('b[id^="docs-internal-guid-"]')).forEach(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap);
38871
+ return body.innerHTML;
38872
+ }
38618
38873
  /**
38619
38874
  * @private
38620
38875
  */ function isDragEvent(e) {
@@ -38631,11 +38886,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38631
38886
  editor.s.insertCursorAtPoint(e.clientX, e.clientY);
38632
38887
  }
38633
38888
  const result = editor.e.fire('beforePasteInsert', html);
38634
- if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isVoid)(result) && ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isString)(result) || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isNumber)(result) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isNode(result))) {
38889
+ if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isVoid)(result) && ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(result) || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isNumber)(result) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isNode(result))) {
38635
38890
  html = result;
38636
38891
  }
38637
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isString)(html)) {
38638
- html = removeExtraFragments(html);
38892
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isString)(html)) {
38893
+ html = removeExtraFragments(removeGoogleDocsWrapper(html));
38639
38894
  }
38640
38895
  editor.s.insertHTML(html);
38641
38896
  }
@@ -38645,7 +38900,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38645
38900
  */ function getAllTypes(dt) {
38646
38901
  const types = dt.types;
38647
38902
  let types_str = '';
38648
- if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
38903
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_3__.isArray)(types) || ({}).toString.call(types) === '[object DOMStringList]') {
38649
38904
  for(let i = 0; i < types.length; i += 1){
38650
38905
  types_str += types[i] + ';';
38651
38906
  }
@@ -38662,7 +38917,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38662
38917
  return;
38663
38918
  }
38664
38919
  const dialog = jodit.confirm(`<div style="word-break: normal; white-space: normal">${jodit.i18n(msg)}</div>`, jodit.i18n(title));
38665
- const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__.Button)(jodit, {
38920
+ const buttons = buttonList.map(({ text, value })=>(0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
38666
38921
  text,
38667
38922
  name: text.toLowerCase(),
38668
38923
  tabIndex: 0
@@ -38678,7 +38933,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38678
38933
  }
38679
38934
  jodit.e.fire('afterClosePasteDialog', dialog);
38680
38935
  });
38681
- const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_3__.Button)(jodit, {
38936
+ const cancel = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_4__.Button)(jodit, {
38682
38937
  text: 'Cancel',
38683
38938
  tabIndex: 0
38684
38939
  }).onAction(()=>{
@@ -38830,7 +39085,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.paste = {
38830
39085
  this.j.buffer.set(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.CLIPBOARD_ID, html);
38831
39086
  switch(action){
38832
39087
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSERT_CLEAR_HTML:
38833
- html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.cleanFromWord)(html);
39088
+ html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.cleanFromWord)((0,_helpers__WEBPACK_IMPORTED_MODULE_9__.removeGoogleDocsWrapper)(html));
38834
39089
  break;
38835
39090
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSERT_ONLY_TEXT:
38836
39091
  html = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.stripTags)(html, this.j.ed, new Set(this.j.o.pasteExcludeStripTags), this.j.o.nl2brInPlainText);
@@ -39876,7 +40131,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.allowResizeTags = new
39876
40131
  'img',
39877
40132
  'iframe',
39878
40133
  'table',
39879
- 'jodit'
40134
+ 'jodit',
40135
+ 'video'
39880
40136
  ]);
39881
40137
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
39882
40138
  showSize: true,
@@ -39885,7 +40141,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
39885
40141
  min_width: 10,
39886
40142
  min_height: 10,
39887
40143
  useAspectRatio: new Set([
39888
- 'img'
40144
+ 'img',
40145
+ 'video'
39889
40146
  ])
39890
40147
  };
39891
40148
 
@@ -39939,6 +40196,12 @@ const keyBInd = '__jodit-resizer_binded';
39939
40196
  }
39940
40197
  return parseFloat(value);
39941
40198
  }
40199
+ /**
40200
+ * A video with no height of its own takes it from its width and its ratio,
40201
+ * so resizing it keeps the ratio without setting a height.
40202
+ */ function heightFollowsWidth(element) {
40203
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'height');
40204
+ }
39942
40205
  /**
39943
40206
  * The module creates a supporting frame for resizing of the elements img and table
39944
40207
  */ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
@@ -39966,14 +40229,26 @@ const keyBInd = '__jodit-resizer_binded';
39966
40229
  let node = e.target;
39967
40230
  const { editor, options: { allowResizeTags } } = this.j;
39968
40231
  while(node && node !== editor){
39969
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(node, allowResizeTags)) {
39970
- this.__bind(node);
39971
- this.onClickElement(node);
40232
+ const element = this.__resizable(node);
40233
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, allowResizeTags)) {
40234
+ this.__bind(element);
40235
+ this.onClickElement(element);
39972
40236
  return;
39973
40237
  }
39974
40238
  node = node.parentNode;
39975
40239
  }
39976
40240
  }
40241
+ /**
40242
+ * What a click on `node` resizes: the media in it when it's a media
40243
+ * wrapper (`jodit-media`, or one from `mediaWrappers`), or `node` itself
40244
+ */ __resizable(node) {
40245
+ const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getWrappedMedia)(this.j, node) ?? (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(node) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(node, 'data-jodit_fake_wrapper') ? node.firstElementChild : null);
40246
+ if (!media) {
40247
+ return node;
40248
+ }
40249
+ // An embed is resized through its own wrapper
40250
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isHTMLElement(media.parentNode) && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(media.parentNode, 'data-jodit_iframe_wrapper') ? media.parentNode : media;
40251
+ }
39977
40252
  __afterInsertImage(image) {
39978
40253
  if (this.j.o.resizer.forImageChangeAttributes) {
39979
40254
  return;
@@ -39987,20 +40262,18 @@ const keyBInd = '__jodit-resizer_binded';
39987
40262
  addEventListeners() {
39988
40263
  const editor = this.j;
39989
40264
  editor.e.off(editor.editor, '.resizer').off(editor.ow, '.resizer').on(editor.editor, 'keydown.resizer', (e)=>{
39990
- if (this.isShown && e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DELETE && this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'table')) {
40265
+ if (this.isShown && (e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_DELETE || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_BACKSPACE) && this.element && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'table')) {
39991
40266
  this.onDelete(e);
39992
40267
  }
39993
- }).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize).on([
40268
+ }).on(editor.ow, 'resize.resizer', this.updateSize).on('resize.resizer', this.updateSize)// The frame is outside the content, so it's moved to follow the
40269
+ // element as the content scrolls
40270
+ .on([
39994
40271
  editor.ow,
39995
40272
  editor.editor
39996
- ], 'scroll.resizer', ()=>{
39997
- if (this.isShown && !this.isResizeMode) {
39998
- this.hide();
39999
- }
40000
- }).on(editor.ow, 'keydown.resizer', this.onKeyDown).on(editor.ow, 'keyup.resizer', this.onKeyUp).on(editor.ow, 'mouseup.resizer touchend.resizer', this.onClickOutside);
40273
+ ], 'scroll.resizer', this.updateSize).on(editor.ow, 'keydown.resizer', this.onKeyDown).on(editor.ow, 'keyup.resizer', this.onKeyUp).on(editor.ow, 'mouseup.resizer touchend.resizer', this.onClickOutside);
40001
40274
  }
40002
40275
  onStartResizing(resizeHandle, e) {
40003
- if (!this.element || !this.element.parentNode) {
40276
+ if (!this.element || !this.isElementInEditor) {
40004
40277
  this.hide();
40005
40278
  return false;
40006
40279
  }
@@ -40053,7 +40326,8 @@ const keyBInd = '__jodit-resizer_binded';
40053
40326
  const className = this.handle.className;
40054
40327
  let new_w, new_h;
40055
40328
  const uar = this.j.o.resizer.useAspectRatio;
40056
- if (!this.isAltMode && (uar === true || uar && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, uar))) {
40329
+ const keepRatio = !this.isAltMode && (uar === true || Boolean(uar && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, uar)));
40330
+ if (keepRatio) {
40057
40331
  if (diff_x) {
40058
40332
  new_w = this.width + (className.match(/left/) ? -1 : 1) * diff_x;
40059
40333
  new_h = Math.round(new_w / this.ratio);
@@ -40076,7 +40350,7 @@ const keyBInd = '__jodit-resizer_binded';
40076
40350
  this.applySize(this.element, 'width', '100%');
40077
40351
  }
40078
40352
  }
40079
- if (new_h > this.j.o.resizer.min_height) {
40353
+ if (new_h > this.j.o.resizer.min_height && !(keepRatio && heightFollowsWidth(this.element))) {
40080
40354
  this.applySize(this.element, 'height', new_h);
40081
40355
  }
40082
40356
  this.updateSize();
@@ -40122,10 +40396,19 @@ const keyBInd = '__jodit-resizer_binded';
40122
40396
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(element, key, value);
40123
40397
  }
40124
40398
  }
40399
+ /**
40400
+ * The framed element can go with a wrapper round it, keeping its parent
40401
+ */ get isElementInEditor() {
40402
+ return Boolean(this.element && this.j.editor.contains(this.element));
40403
+ }
40125
40404
  onDelete(e) {
40126
40405
  if (!this.element) {
40127
40406
  return;
40128
40407
  }
40408
+ if (!this.isElementInEditor) {
40409
+ this.hide();
40410
+ return;
40411
+ }
40129
40412
  if (this.element.tagName !== 'JODIT') {
40130
40413
  this.j.s.select(this.element);
40131
40414
  } else {
@@ -40136,7 +40419,7 @@ const keyBInd = '__jodit-resizer_binded';
40136
40419
  }
40137
40420
  __onChangeEditor() {
40138
40421
  if (this.isShown) {
40139
- if (!this.element || !this.element.parentNode) {
40422
+ if (!this.isElementInEditor) {
40140
40423
  this.hide();
40141
40424
  } else {
40142
40425
  this.updateSize();
@@ -40194,8 +40477,12 @@ const keyBInd = '__jodit-resizer_binded';
40194
40477
  this.j.e.off(element, 'mousedown.select touchstart.select').on(element, 'mousedown.select touchstart.select', ()=>{
40195
40478
  this.j.s.select(element);
40196
40479
  }).off(element, 'changesize').on(element, 'changesize', ()=>{
40197
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'width', element.offsetWidth + 'px');
40198
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'height', element.offsetHeight + 'px');
40480
+ // Only a resize sets the embed's size, and as the plain numbers
40481
+ // the attributes take, so a click leaves `width="100%"` alone
40482
+ if (this.isResizeMode) {
40483
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'width', element.offsetWidth);
40484
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(iframe, 'height', element.offsetHeight);
40485
+ }
40199
40486
  });
40200
40487
  }
40201
40488
  this.j.e.on(element, 'dragstart', this.hide);
@@ -40230,9 +40517,13 @@ const keyBInd = '__jodit-resizer_binded';
40230
40517
  return;
40231
40518
  }
40232
40519
  this.isShown = true;
40520
+ if (this.layer.parentNode !== this.j.workplace) {
40521
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.markOwner)(this.j, this.layer);
40522
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.j.workplace, this.layer);
40523
+ }
40233
40524
  if (!this.rect.parentNode) {
40234
40525
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.markOwner)(this.j, this.rect);
40235
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.j.workplace, this.rect);
40526
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(this.layer, this.rect);
40236
40527
  }
40237
40528
  if (this.j.isFullSize) {
40238
40529
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.rect, 'zIndex', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(this.j.container, 'zIndex').toString());
@@ -40252,6 +40543,7 @@ const keyBInd = '__jodit-resizer_binded';
40252
40543
  }
40253
40544
  beforeDestruct(jodit) {
40254
40545
  this.hide();
40546
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.layer);
40255
40547
  jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.off('hideHelpers', this.hide);
40256
40548
  jodit.e.off(this.j.ow, '.resizer').off('.resizer');
40257
40549
  }
@@ -40262,7 +40554,8 @@ const keyBInd = '__jodit-resizer_binded';
40262
40554
  <div class="jodit-resizer__bottom-right"></div>
40263
40555
  <div class="jodit-resizer__bottom-left"></div>
40264
40556
  <span>100x100</span>
40265
- </div>`)), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
40557
+ </div>`)), // Clips the frame to the workplace, without the frame making it scroll
40558
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "layer", this.j.c.div('jodit-resizer-layer')), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
40266
40559
  if (this.isResizeMode) {
40267
40560
  return;
40268
40561
  }
@@ -40272,6 +40565,9 @@ const keyBInd = '__jodit-resizer_binded';
40272
40565
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'img') && !this.element.complete) {
40273
40566
  this.j.e.one(this.element, 'load', this.updateSize);
40274
40567
  }
40568
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, 'video') && this.element.readyState < HTMLMediaElement.HAVE_METADATA) {
40569
+ this.j.e.one(this.element, 'loadedmetadata', this.updateSize);
40570
+ }
40275
40571
  }
40276
40572
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "updateSize", ()=>{
40277
40573
  if (this.isInDestruct || !this.isShown) {
@@ -41546,15 +41842,23 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41546
41842
  this.__tableModule.mergeSelected(table);
41547
41843
  break;
41548
41844
  case 'empty':
41549
- cells.forEach((td)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(td));
41845
+ cells.forEach((td)=>{
41846
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.detach(td);
41847
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.append(td, this.j.createInside.element('br'));
41848
+ });
41550
41849
  break;
41551
41850
  case 'bin':
41552
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(table);
41851
+ this.__removeTable(table);
41553
41852
  break;
41554
41853
  case 'binrow':
41555
- new Set(cells.map((td)=>td.parentNode)).forEach((row)=>{
41556
- this.__tableModule.removeRow(table, row.rowIndex);
41557
- });
41854
+ {
41855
+ const rows = new Set(cells.map((td)=>td.parentNode));
41856
+ const next = this.__nearestCell(table, cell, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.toArray)(rows).map((row)=>row.rowIndex), true);
41857
+ rows.forEach((row)=>{
41858
+ this.__tableModule.removeRow(table, row.rowIndex);
41859
+ });
41860
+ next && this.j.s.setCursorIn(next);
41861
+ }
41558
41862
  break;
41559
41863
  case 'bincolumn':
41560
41864
  {
@@ -41567,9 +41871,11 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41567
41871
  columnsSet.add(col);
41568
41872
  }
41569
41873
  });
41874
+ const next = this.__nearestCell(table, cell, columns, false);
41570
41875
  columns.sort((a, b)=>b - a).forEach((col)=>{
41571
41876
  this.__tableModule.removeColumn(table, col);
41572
41877
  });
41878
+ next && this.j.s.setCursorIn(next);
41573
41879
  }
41574
41880
  break;
41575
41881
  case 'addcolumnafter':
@@ -41581,10 +41887,36 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41581
41887
  this.__tableModule.appendRow(table, cell.parentNode, command === 'addrowafter');
41582
41888
  break;
41583
41889
  }
41890
+ if (/^bin(row|column)$/.test(command) && !this.__tableModule.getColumnsCount(table)) {
41891
+ this.__removeTable(table);
41892
+ }
41584
41893
  }
41585
41894
  return false;
41586
41895
  }
41587
41896
  }
41897
+ /**
41898
+ * The cell that takes the caret when rows or columns are deleted: the next
41899
+ * one in the same column (or row) that is not deleted, else the previous one
41900
+ */ __nearestCell(table, cell, deleted, isRow) {
41901
+ const box = this.__tableModule.formalMatrix(table);
41902
+ const [row, column] = this.__tableModule.formalCoordinate(table, cell);
41903
+ const start = isRow ? row : column;
41904
+ const count = isRow ? box.length : box[row].length;
41905
+ const find = (i)=>!deleted.includes(i) && (isRow ? box[i][column] : box[row][i]) || null;
41906
+ for(let i = start + 1; i < count; i += 1){
41907
+ const next = find(i);
41908
+ if (next) {
41909
+ return next;
41910
+ }
41911
+ }
41912
+ for(let i = start - 1; i >= 0; i -= 1){
41913
+ const prev = find(i);
41914
+ if (prev) {
41915
+ return prev;
41916
+ }
41917
+ }
41918
+ return null;
41919
+ }
41588
41920
  /**
41589
41921
  * Add some align after native command
41590
41922
  */ onAfterCommand(command) {
@@ -41592,6 +41924,14 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41592
41924
  this.__tableModule.getAllSelectedCells().forEach((elm)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.alignElement)(command, elm));
41593
41925
  }
41594
41926
  }
41927
+ /**
41928
+ * Remove the table and put the caret where it stood: at the start of what
41929
+ * follows it, else at the end of what precedes it
41930
+ */ __removeTable(table) {
41931
+ const parent = table.parentNode, next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.findNotEmptySibling(table, false), prev = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.findNotEmptySibling(table, true);
41932
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(table);
41933
+ this.j.s.setCursorIn(next || prev || parent, Boolean(next));
41934
+ }
41595
41935
  /** @override */ beforeDestruct(jodit) {
41596
41936
  this.__onRemoveSelection();
41597
41937
  jodit.e.off('.select-cells');
@@ -44170,7 +44510,7 @@ const WORK_KEYS = new Set([
44170
44510
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(next, first);
44171
44511
  editor.s.setCursorBefore(first);
44172
44512
  } else {
44173
- if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
44513
+ if (key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(next)) {
44174
44514
  editor.s.select(next, true);
44175
44515
  } else {
44176
44516
  editor.s.setCursorIn(next, key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_RIGHT || key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN);
@@ -44238,6 +44578,36 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.table = {
44238
44578
  useExtraClassesOptions: false
44239
44579
  };
44240
44580
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('table', (_table_svg__WEBPACK_IMPORTED_MODULE_6___default()));
44581
+ /**
44582
+ * Elements in `dtd.blockLimits` that hold only rows, cells or list items, so
44583
+ * a table can't go directly inside them
44584
+ */ const ROW_AND_ITEM_HOLDERS = new Set([
44585
+ 'table',
44586
+ 'thead',
44587
+ 'tbody',
44588
+ 'tfoot',
44589
+ 'tr',
44590
+ 'ul',
44591
+ 'ol',
44592
+ 'dl'
44593
+ ]);
44594
+ /**
44595
+ * The nearest block around the cursor that can hold the new table: an element
44596
+ * in `dtd.blockLimits`, such as a table cell, a list item or a `<div>`. The
44597
+ * cursor's own block of the `enter` tag is a line, not a container, as in the
44598
+ * dtd plugin's `checkBlockNesting`
44599
+ */ function findTableContainer(editor, current) {
44600
+ const line = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
44601
+ const container = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, (node)=>{
44602
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) || node === line && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, editor.o.enter)) {
44603
+ return false;
44604
+ }
44605
+ const tag = node.nodeName.toLowerCase();
44606
+ return Boolean(editor.o.dtd?.blockLimits[tag]) && !ROW_AND_ITEM_HOLDERS.has(tag);
44607
+ }, editor.editor);
44608
+ // With the cursor between two rows, `current` is the next row's text
44609
+ return container && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(container, editor.s.range.startContainer) ? container : null;
44610
+ }
44241
44611
  jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
44242
44612
  data: {
44243
44613
  cols: 10,
@@ -44335,7 +44705,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
44335
44705
  editor.s.removeMarkers();
44336
44706
  editor.editor.normalize();
44337
44707
  editor.history.snapshot.restore(snapshot);
44338
- const block = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(editor.s.current(), jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor);
44708
+ const current = editor.s.current();
44709
+ // The table goes into the cell, list item or box holding the
44710
+ // cursor, and only a block inside it is split
44711
+ const container = findTableContainer(editor, current);
44712
+ const block = container === current ? null : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(current, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, container ?? editor.editor);
44339
44713
  if (block && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(block)) {
44340
44714
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.replace(block, table, undefined, false, true);
44341
44715
  } else {
@@ -44357,6 +44731,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
44357
44731
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, table);
44358
44732
  }
44359
44733
  }
44734
+ } else if (container && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(container) && !editor.o.table.splitBlockOnInsertTable) {
44735
+ // With no block to go after, the table goes after the text
44736
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(container, table);
44360
44737
  } else {
44361
44738
  editor.s.insertNode(table, false);
44362
44739
  }
@@ -44593,10 +44970,732 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
44593
44970
 
44594
44971
  /***/ }),
44595
44972
 
44596
- /***/ 48899:
44973
+ /***/ 39057:
44974
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
44975
+
44976
+ "use strict";
44977
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44978
+ /* harmony export */ editedMedia: function() { return /* binding */ editedMedia; },
44979
+ /* harmony export */ ownSize: function() { return /* binding */ ownSize; },
44980
+ /* harmony export */ readValues: function() { return /* binding */ readValues; }
44981
+ /* harmony export */ });
44982
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
44983
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70222);
44984
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
44985
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80991);
44986
+ /* harmony import */ var jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10808);
44987
+ /*!
44988
+ * Jodit Editor (https://xdsoft.net/jodit/)
44989
+ * Released under MIT see LICENSE.txt in the project root for license information.
44990
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
44991
+ */ /**
44992
+ * @module plugins/video-properties
44993
+ */
44994
+
44995
+
44996
+
44997
+
44998
+ const mediaSelector = 'video, audio, iframe';
44999
+ /**
45000
+ * The media `target` is, or holds as its wrapper (`jodit-media`, the resizer's
45001
+ * `jodit` for an embed, or one from `mediaWrappers`)
45002
+ * @private
45003
+ */ function editedMedia(target) {
45004
+ return target.matches(mediaSelector) ? target : target.querySelector(mediaSelector);
45005
+ }
45006
+ /**
45007
+ * The size `media` is given, inline or by its attribute
45008
+ * @private
45009
+ */ function ownSize(media, key) {
45010
+ return (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_3__.cssInline)(media, key) || (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(media, key) || '';
45011
+ }
45012
+ const toNumber = (value)=>parseFloat(value.toString());
45013
+ /**
45014
+ * Read the media's values into the state
45015
+ * @private
45016
+ */ function readValues(state) {
45017
+ const { media, values } = state;
45018
+ const width = ownSize(media, 'width');
45019
+ const height = ownSize(media, 'height');
45020
+ values.width = width ? (0,jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__.normalSizeFromString)(width) : media.offsetWidth;
45021
+ values.height = height ? (0,jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__.normalSizeFromString)(height) : '';
45022
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'video') && media.videoWidth) {
45023
+ state.ratio = media.videoWidth / media.videoHeight;
45024
+ } else if ((0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.width) && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.height)) {
45025
+ state.ratio = toNumber(values.width) / toNumber(values.height);
45026
+ } else {
45027
+ state.ratio = media.offsetWidth / media.offsetHeight || 1;
45028
+ }
45029
+ // One with no height takes it from its width
45030
+ if (!height && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.width)) {
45031
+ values.height = Math.round(toNumber(values.width) / state.ratio);
45032
+ }
45033
+ state.sizeIsLocked = (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.width) && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(values.height) && (!height || Math.abs(toNumber(values.width) - toNumber(values.height) * state.ratio) < 1);
45034
+ values.poster = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(media, 'poster') || '';
45035
+ values.autoplay = media.hasAttribute('autoplay');
45036
+ values.loop = media.hasAttribute('loop');
45037
+ // Autoplay's own: turning it off gives the sound back
45038
+ values.muted = media.hasAttribute('muted') && !values.autoplay;
45039
+ // Without Autoplay it keeps its controls, or it could never be played
45040
+ values.controls = media.hasAttribute('controls') || !values.autoplay;
45041
+ }
45042
+
45043
+
45044
+ /***/ }),
45045
+
45046
+ /***/ 25001:
45047
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
45048
+
45049
+ "use strict";
45050
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45051
+ /* harmony export */ replaceMedia: function() { return /* binding */ replaceMedia; }
45052
+ /* harmony export */ });
45053
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
45054
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
45055
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
45056
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39057);
45057
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94893);
45058
+ /*!
45059
+ * Jodit Editor (https://xdsoft.net/jodit/)
45060
+ * Released under MIT see LICENSE.txt in the project root for license information.
45061
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
45062
+ */ /**
45063
+ * @module plugins/video-properties
45064
+ */
45065
+
45066
+
45067
+
45068
+
45069
+ /**
45070
+ * Give `media`, in `outer`, the classes, inline styles, size and playback
45071
+ * settings of `old`, in `oldOuter`. It keeps its own source and poster.
45072
+ */ function takeOver(j, oldOuter, old, outer, media) {
45073
+ const state = {
45074
+ target: oldOuter,
45075
+ media: old,
45076
+ ratio: 1,
45077
+ sizeIsLocked: true,
45078
+ values: {
45079
+ width: '',
45080
+ height: '',
45081
+ poster: '',
45082
+ autoplay: false,
45083
+ loop: false,
45084
+ muted: false,
45085
+ controls: true
45086
+ }
45087
+ };
45088
+ (0,_readers__WEBPACK_IMPORTED_MODULE_3__.readValues)(state);
45089
+ const pairs = [
45090
+ [
45091
+ old,
45092
+ media
45093
+ ]
45094
+ ];
45095
+ // A wrapper kept in the content, which holds the alignment
45096
+ if (oldOuter !== old && outer !== media && oldOuter.nodeName === outer.nodeName) {
45097
+ pairs.push([
45098
+ oldOuter,
45099
+ outer
45100
+ ]);
45101
+ }
45102
+ pairs.forEach(([from, to])=>{
45103
+ [
45104
+ 'class',
45105
+ 'style'
45106
+ ].forEach((name)=>(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(to, name, (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(from, name)));
45107
+ });
45108
+ // A video's size is CSS and an embed's its attributes, so the writer sizes
45109
+ // one that's a different element
45110
+ if (old.nodeName !== media.nodeName) {
45111
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(media, {
45112
+ width: null,
45113
+ height: null
45114
+ });
45115
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style')?.trim()) {
45116
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style', null);
45117
+ }
45118
+ }
45119
+ state.media = media;
45120
+ state.values.poster = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'poster') || '';
45121
+ (0,_writers__WEBPACK_IMPORTED_MODULE_4__.applyValues)(j, state, Boolean((0,_readers__WEBPACK_IMPORTED_MODULE_3__.ownSize)(old, 'width') || (0,_readers__WEBPACK_IMPORTED_MODULE_3__.ownSize)(old, 'height')));
45122
+ }
45123
+ /**
45124
+ * Run `insert`, which inserts media at the cursor, with the cursor after
45125
+ * `replaced`, and put what it inserts in place of `replaced`
45126
+ * @private
45127
+ */ function replaceMedia(j, replaced, insert) {
45128
+ const inserted = [];
45129
+ const collect = (node)=>{
45130
+ inserted.push(node);
45131
+ };
45132
+ j.history.snapshot.transaction(()=>{
45133
+ j.s.focus();
45134
+ j.s.setCursorAfter(replaced);
45135
+ j.e.on('afterInsertNode', collect);
45136
+ try {
45137
+ insert();
45138
+ } finally{
45139
+ j.e.off('afterInsertNode', collect);
45140
+ }
45141
+ const [outer] = inserted;
45142
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(outer)) {
45143
+ return;
45144
+ }
45145
+ const old = (0,_readers__WEBPACK_IMPORTED_MODULE_3__.editedMedia)(replaced);
45146
+ const media = (0,_readers__WEBPACK_IMPORTED_MODULE_3__.editedMedia)(outer);
45147
+ if (old && media) {
45148
+ takeOver(j, replaced, old, outer, media);
45149
+ }
45150
+ // The resizer can have put an embed in its own wrapper already
45151
+ const placed = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(outer.parentElement) && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(outer.parentElement, 'data-jodit-temp') ? outer.parentElement : outer;
45152
+ // Where the old one was, since media Jodit counts as blocks can be put
45153
+ // after the paragraph
45154
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(replaced, placed);
45155
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(replaced);
45156
+ j.s.setCursorAfter(placed);
45157
+ });
45158
+ j.synchronizeValues();
45159
+ j.e.fire('closeAllPopups');
45160
+ }
45161
+
45162
+
45163
+ /***/ }),
45164
+
45165
+ /***/ 83533:
45166
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
45167
+
45168
+ "use strict";
45169
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45170
+ /* harmony export */ UIVideoPropertiesForm: function() { return /* binding */ UIVideoPropertiesForm; }
45171
+ /* harmony export */ });
45172
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
45173
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
45174
+ /* harmony import */ var jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91672);
45175
+ /* harmony import */ var jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29200);
45176
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68616);
45177
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23211);
45178
+ /* harmony import */ var jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(70222);
45179
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
45180
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
45181
+ /* harmony import */ var jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96007);
45182
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29434);
45183
+ /*!
45184
+ * Jodit Editor (https://xdsoft.net/jodit/)
45185
+ * Released under MIT see LICENSE.txt in the project root for license information.
45186
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
45187
+ */ /**
45188
+ * @module plugins/video-properties
45189
+ */
45190
+
45191
+
45192
+
45193
+
45194
+
45195
+
45196
+
45197
+
45198
+
45199
+
45200
+
45201
+ const flags = {
45202
+ autoplay: 'Autoplay',
45203
+ loop: 'Loop',
45204
+ muted: 'Muted',
45205
+ controls: 'Controls'
45206
+ };
45207
+ const checkbox = ([flag, label])=>`<label class="jodit_vertical_middle">
45208
+ <input type="checkbox" class="jodit-checkbox &__${flag}"/>
45209
+ <span>~${label}~</span>
45210
+ </label>`;
45211
+ class UIVideoPropertiesForm extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_9__.UIElement {
45212
+ className() {
45213
+ return 'UIVideoPropertiesForm';
45214
+ }
45215
+ render() {
45216
+ return `<form>
45217
+ <div class="jodit-form__group &__previewBox">
45218
+ <img class="&__preview" alt=""/>
45219
+ </div>
45220
+ <div class="jodit-form__group &__sizes">
45221
+ <input type="text" class="jodit-input &__width" placeholder="~Width~" aria-label="~Width~"/>
45222
+ <a class="&__lockSize">*lock*</a>
45223
+ <input type="text" class="jodit-input &__height" placeholder="~Height~" aria-label="~Height~"/>
45224
+ </div>
45225
+ <div class="jodit-form__group &__editPoster">
45226
+ <label>~Poster~</label>
45227
+ <div class="jodit-input_group">
45228
+ <input type="text" class="jodit-input &__poster" placeholder="https://"/>
45229
+ <div class="jodit-input_group-buttons">
45230
+ <a class="jodit-button &__changePoster" title="~Upload~">*image*</a>
45231
+ <a class="jodit-button &__removePoster" title="~Remove~">*bin*</a>
45232
+ </div>
45233
+ </div>
45234
+ </div>
45235
+ <div class="jodit-form__group &__playback">
45236
+ ${Object.entries(flags).map(checkbox).join('')}
45237
+ </div>
45238
+ </form>`;
45239
+ }
45240
+ input(name) {
45241
+ return this.getElm(name);
45242
+ }
45243
+ show(name, shown) {
45244
+ ;(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.getElm(name), 'display', shown ? null : 'none');
45245
+ }
45246
+ /**
45247
+ * A video has every field, an embed only its size, and audio only its
45248
+ * playback settings
45249
+ */ onStateMediaChange() {
45250
+ const { media } = this.state;
45251
+ this.show('editPoster', jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'video'));
45252
+ this.show('sizes', !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'audio'));
45253
+ this.show('playback', !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'iframe'));
45254
+ this.showPreview();
45255
+ }
45256
+ // A video's poster, when it has one
45257
+ showPreview() {
45258
+ const { media, values } = this.state;
45259
+ const shown = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(media, 'video') && Boolean(values.poster);
45260
+ this.show('previewBox', shown);
45261
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.getElm('preview'), 'src', shown ? values.poster : null);
45262
+ }
45263
+ hideChangePoster() {
45264
+ const { uploader, filebrowser } = this.j.o;
45265
+ // What FileSelectorWidget offers
45266
+ const canUpload = uploader.showTabInFileSelector !== false && Boolean(uploader.url || uploader.insertImageAsBase64URI || uploader.customUploadFunction);
45267
+ const canBrowse = Boolean(filebrowser.ajax.url || filebrowser.items.url);
45268
+ this.show('changePoster', canUpload || canBrowse);
45269
+ }
45270
+ onStatePosterChange() {
45271
+ const { poster } = this.state.values;
45272
+ this.input('poster').value = poster;
45273
+ this.show('removePoster', Boolean(poster));
45274
+ this.showPreview();
45275
+ }
45276
+ onPosterChange() {
45277
+ this.state.values.poster = this.input('poster').value;
45278
+ }
45279
+ onChangePosterClick(e) {
45280
+ this.handlers.openPosterPopup(this.getElm('changePoster'));
45281
+ e.stopPropagation();
45282
+ }
45283
+ onRemovePosterClick() {
45284
+ this.state.values.poster = '';
45285
+ }
45286
+ onStateSizeIsLockedChange() {
45287
+ this.getElm('lockSize').innerHTML = jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.get(this.state.sizeIsLocked ? 'lock' : 'unlock');
45288
+ }
45289
+ onLockSizeClick() {
45290
+ const { state } = this;
45291
+ const { values } = state;
45292
+ state.sizeIsLocked = !state.sizeIsLocked;
45293
+ if (state.sizeIsLocked && (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(values.width)) {
45294
+ values.height = Math.round(parseFloat(values.width.toString()) / state.ratio);
45295
+ }
45296
+ }
45297
+ onStateSizeChange() {
45298
+ const { values } = this.state;
45299
+ // Not the field being typed in
45300
+ [
45301
+ 'width',
45302
+ 'height'
45303
+ ].forEach((key)=>{
45304
+ const input = this.input(key);
45305
+ if (input !== this.j.od.activeElement) {
45306
+ input.value = values[key].toString();
45307
+ }
45308
+ });
45309
+ }
45310
+ onSizeInput(e) {
45311
+ const { state } = this;
45312
+ const { values } = state;
45313
+ // Both read first, since setting one rewrites the other's field
45314
+ const width = this.input('width').value;
45315
+ const height = this.input('height').value;
45316
+ if (!state.sizeIsLocked || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(width) || !(0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_6__.isNumeric)(height)) {
45317
+ values.width = width;
45318
+ values.height = height;
45319
+ return;
45320
+ }
45321
+ const w = parseFloat(width);
45322
+ const h = parseFloat(height);
45323
+ if (e.target === this.input('width')) {
45324
+ values.width = w;
45325
+ values.height = Math.round(w / state.ratio);
45326
+ } else {
45327
+ values.width = Math.round(h * state.ratio);
45328
+ values.height = h;
45329
+ }
45330
+ }
45331
+ /**
45332
+ * Autoplay mutes it, and it keeps its controls unless it autoplays
45333
+ */ onStateFlagsChange() {
45334
+ const { values } = this.state;
45335
+ this.input('autoplay').checked = values.autoplay;
45336
+ this.input('loop').checked = values.loop;
45337
+ this.input('muted').checked = values.muted || values.autoplay;
45338
+ this.input('muted').disabled = values.autoplay;
45339
+ this.input('controls').checked = values.controls || !values.autoplay;
45340
+ this.input('controls').disabled = !values.autoplay;
45341
+ }
45342
+ onFlagChange(e) {
45343
+ Object.keys(flags).forEach((flag)=>{
45344
+ const input = this.input(flag);
45345
+ if (e.target === input) {
45346
+ this.state.values[flag] = input.checked;
45347
+ }
45348
+ });
45349
+ }
45350
+ constructor(jodit, state, handlers){
45351
+ super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "handlers", void 0), this.state = state, this.handlers = handlers;
45352
+ }
45353
+ }
45354
+ ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45355
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
45356
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.media')
45357
+ ], UIVideoPropertiesForm.prototype, "onStateMediaChange", null);
45358
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45359
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready')
45360
+ ], UIVideoPropertiesForm.prototype, "hideChangePoster", null);
45361
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45362
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
45363
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.values.poster')
45364
+ ], UIVideoPropertiesForm.prototype, "onStatePosterChange", null);
45365
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45366
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('poster:change')
45367
+ ], UIVideoPropertiesForm.prototype, "onPosterChange", null);
45368
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45369
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('changePoster:click')
45370
+ ], UIVideoPropertiesForm.prototype, "onChangePosterClick", null);
45371
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45372
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('removePoster:click')
45373
+ ], UIVideoPropertiesForm.prototype, "onRemovePosterClick", null);
45374
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45375
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
45376
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('state.sizeIsLocked')
45377
+ ], UIVideoPropertiesForm.prototype, "onStateSizeIsLockedChange", null);
45378
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45379
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)('lockSize:click')
45380
+ ], UIVideoPropertiesForm.prototype, "onLockSizeClick", null);
45381
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45382
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
45383
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)([
45384
+ 'state.values.width',
45385
+ 'state.values.height'
45386
+ ])
45387
+ ], UIVideoPropertiesForm.prototype, "onStateSizeChange", null);
45388
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45389
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)([
45390
+ 'width:input',
45391
+ 'height:input',
45392
+ 'width:change',
45393
+ 'height:change'
45394
+ ])
45395
+ ], UIVideoPropertiesForm.prototype, "onSizeInput", null);
45396
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45397
+ (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_3__.hook)('ready'),
45398
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)(Object.keys(flags).map((flag)=>`state.values.${flag}`))
45399
+ ], UIVideoPropertiesForm.prototype, "onStateFlagsChange", null);
45400
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45401
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)(Object.keys(flags).map((flag)=>`${flag}:change`))
45402
+ ], UIVideoPropertiesForm.prototype, "onFlagChange", null);
45403
+ UIVideoPropertiesForm = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45404
+ jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_2__.component
45405
+ ], UIVideoPropertiesForm);
45406
+
45407
+
45408
+ /***/ }),
45409
+
45410
+ /***/ 40878:
44597
45411
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
44598
45412
 
44599
45413
  "use strict";
45414
+ /* unused harmony export videoProperties */
45415
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
45416
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
45417
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84839);
45418
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23211);
45419
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
45420
+ /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17312);
45421
+ /* harmony import */ var jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(23599);
45422
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(71125);
45423
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
45424
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(59400);
45425
+ /* harmony import */ var jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(51116);
45426
+ /* harmony import */ var jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18762);
45427
+ /* harmony import */ var _ui_ui_video_form__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(83533);
45428
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(39057);
45429
+ /* harmony import */ var _replace__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(25001);
45430
+ /* harmony import */ var _writers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(94893);
45431
+ /* harmony import */ var jodit_plugins_video_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(48899);
45432
+ /*!
45433
+ * Jodit Editor (https://xdsoft.net/jodit/)
45434
+ * Released under MIT see LICENSE.txt in the project root for license information.
45435
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
45436
+ */ /**
45437
+ * [[include:plugins/video-properties/README.md]]
45438
+ * @packageDocumentation
45439
+ * @module plugins/video-properties
45440
+ */
45441
+
45442
+
45443
+
45444
+
45445
+
45446
+
45447
+
45448
+
45449
+
45450
+
45451
+
45452
+
45453
+
45454
+
45455
+
45456
+
45457
+ /**
45458
+ * Show a dialog with the size, poster and playback settings of a video, an
45459
+ * embed or audio. The media popup's Edit button opens it:
45460
+ *
45461
+ * ```javascript
45462
+ * editor.events.fire('openVideoProperties', video);
45463
+ * ```
45464
+ */ class videoProperties extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
45465
+ get __size() {
45466
+ const { width, height } = this.state.values;
45467
+ return `${width}x${height}`;
45468
+ }
45469
+ get form() {
45470
+ return new _ui_ui_video_form__WEBPACK_IMPORTED_MODULE_12__.UIVideoPropertiesForm(this.j, this.state, {
45471
+ openPosterPopup: (target)=>this.__openPosterPopup(target)
45472
+ });
45473
+ }
45474
+ get dialog() {
45475
+ const { j } = this;
45476
+ const dialog = j.dlg({
45477
+ minWidth: Math.min(400, screen.width),
45478
+ buttons: [
45479
+ 'dialog.close'
45480
+ ]
45481
+ });
45482
+ const buttons = this.__buttons;
45483
+ buttons.check.onAction(()=>{
45484
+ (0,_writers__WEBPACK_IMPORTED_MODULE_15__.applyValues)(j, this.state, this.__size !== this.__readSize);
45485
+ j.synchronizeValues();
45486
+ dialog.close();
45487
+ });
45488
+ buttons.remove.onAction(()=>{
45489
+ j.s.removeNode(this.state.target);
45490
+ dialog.close();
45491
+ });
45492
+ buttons.cancel.onAction(()=>{
45493
+ dialog.close();
45494
+ });
45495
+ dialog.setContent(this.form);
45496
+ dialog.setFooter([
45497
+ [
45498
+ buttons.cancel,
45499
+ buttons.remove
45500
+ ],
45501
+ buttons.check
45502
+ ]);
45503
+ (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_7__.markOwner)(j, dialog.container);
45504
+ return dialog;
45505
+ }
45506
+ get __buttons() {
45507
+ const { j } = this;
45508
+ return {
45509
+ check: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__.Button)(j, 'ok', 'Apply', 'primary'),
45510
+ remove: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__.Button)(j, 'bin', 'Delete'),
45511
+ cancel: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_9__.Button)(j, 'cancel', 'Cancel')
45512
+ };
45513
+ }
45514
+ /**
45515
+ * Open the dialog for the media `target` is, or is the wrapper of
45516
+ */ open(target) {
45517
+ const media = (0,_readers__WEBPACK_IMPORTED_MODULE_13__.editedMedia)(target);
45518
+ if (!media) {
45519
+ return;
45520
+ }
45521
+ this.state.target = target;
45522
+ this.state.media = media;
45523
+ (0,_readers__WEBPACK_IMPORTED_MODULE_13__.readValues)(this.state);
45524
+ this.__readSize = this.__size;
45525
+ this.dialog.setHeader(this.j.i18n(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(media, 'audio') ? 'Audio properties' : 'Video properties'));
45526
+ this.dialog.open().setModal(true).setPosition();
45527
+ }
45528
+ /**
45529
+ * The video popup's tabs for the media popup's Replace: what they insert
45530
+ * takes the place of the media `target` is, or is the wrapper of
45531
+ */ onGenerateReplaceVideoTabs(target, close) {
45532
+ return (0,jodit_plugins_video_config__WEBPACK_IMPORTED_MODULE_16__.videoTabs)(this.j, close, (insert)=>(0,_replace__WEBPACK_IMPORTED_MODULE_14__.replaceMedia)(this.j, target, insert));
45533
+ }
45534
+ __openPosterPopup(button) {
45535
+ const { j, state } = this;
45536
+ const popup = new jodit_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_10__.Popup(this.dialog);
45537
+ const close = ()=>{
45538
+ popup.close();
45539
+ popup.destruct();
45540
+ };
45541
+ popup.setContent((0,jodit_modules_widget_file_selector_file_selector__WEBPACK_IMPORTED_MODULE_11__.FileSelectorWidget)(j, {
45542
+ upload: (data)=>{
45543
+ if (data.files && data.files.length) {
45544
+ state.values.poster = data.baseurl + data.files[0];
45545
+ }
45546
+ close();
45547
+ },
45548
+ filebrowser: (data)=>{
45549
+ if ((0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_5__.isArray)(data.files) && data.files.length) {
45550
+ state.values.poster = data.files[0];
45551
+ close();
45552
+ }
45553
+ }
45554
+ }, null, close)).open(()=>(0,jodit_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_6__.position)(button));
45555
+ }
45556
+ /** @override */ afterInit() {}
45557
+ /** @override */ beforeDestruct() {
45558
+ Object.values((0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(this, '__buttons') ?? {}).forEach((b)=>b.destruct());
45559
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(this, 'dialog')?.destruct();
45560
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(this, 'form')?.destruct();
45561
+ }
45562
+ constructor(...args){
45563
+ super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", {
45564
+ target: this.j.c.element('video'),
45565
+ media: this.j.c.element('video'),
45566
+ ratio: 1,
45567
+ sizeIsLocked: true,
45568
+ values: {
45569
+ width: '',
45570
+ height: '',
45571
+ poster: '',
45572
+ autoplay: false,
45573
+ loop: false,
45574
+ muted: false,
45575
+ controls: true
45576
+ }
45577
+ }), // The size as it was read, so an unchanged one isn't written
45578
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__readSize", '');
45579
+ }
45580
+ }
45581
+ ;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45582
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
45583
+ ], videoProperties.prototype, "form", null);
45584
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45585
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
45586
+ ], videoProperties.prototype, "dialog", null);
45587
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45588
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
45589
+ ], videoProperties.prototype, "__buttons", null);
45590
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45591
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':openVideoProperties')
45592
+ ], videoProperties.prototype, "open", null);
45593
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
45594
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':generateReplaceVideoTabs')
45595
+ ], videoProperties.prototype, "onGenerateReplaceVideoTabs", null);
45596
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('videoProperties', videoProperties);
45597
+
45598
+
45599
+ /***/ }),
45600
+
45601
+ /***/ 94893:
45602
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
45603
+
45604
+ "use strict";
45605
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45606
+ /* harmony export */ applyValues: function() { return /* binding */ applyValues; }
45607
+ /* harmony export */ });
45608
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
45609
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
45610
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80991);
45611
+ /* harmony import */ var _readers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39057);
45612
+ /* harmony import */ var jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10808);
45613
+ /*!
45614
+ * Jodit Editor (https://xdsoft.net/jodit/)
45615
+ * Released under MIT see LICENSE.txt in the project root for license information.
45616
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
45617
+ */ /**
45618
+ * @module plugins/video-properties
45619
+ */
45620
+
45621
+
45622
+
45623
+
45624
+ const cssSize = (value)=>value === '' ? null : (0,jodit_plugins_image_properties_utils_utils__WEBPACK_IMPORTED_MODULE_4__.normalSizeToString)(value);
45625
+ // Sizes go on as the resizer writes them: an embed takes them as attributes,
45626
+ // and a video as CSS, without a height while its ratio is kept, if it had none
45627
+ function applySize(j, state) {
45628
+ const { media, values } = state;
45629
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'iframe')) {
45630
+ [
45631
+ 'width',
45632
+ 'height'
45633
+ ].forEach((key)=>{
45634
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, key, values[key] === '' ? null : values[key]);
45635
+ if ((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.cssInline)(media, key)) {
45636
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(media, key, cssSize(values[key]));
45637
+ }
45638
+ });
45639
+ // The resizer's frame for an embed
45640
+ const wrapper = media.parentElement;
45641
+ if (wrapper && (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(wrapper, 'data-jodit_iframe_wrapper')) {
45642
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(wrapper, {
45643
+ width: media.offsetWidth,
45644
+ height: media.offsetHeight
45645
+ });
45646
+ }
45647
+ return;
45648
+ }
45649
+ const heightFollowsWidth = state.sizeIsLocked && !(0,_readers__WEBPACK_IMPORTED_MODULE_3__.ownSize)(media, 'height');
45650
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_2__.css)(media, {
45651
+ width: cssSize(values.width),
45652
+ height: heightFollowsWidth ? null : cssSize(values.height)
45653
+ });
45654
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style')?.trim()) {
45655
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'style', null);
45656
+ }
45657
+ j.e.fire(media, 'changesize');
45658
+ }
45659
+ function setFlag(media, name, on) {
45660
+ if (media.hasAttribute(name) !== on) {
45661
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, name, on ? '' : null);
45662
+ }
45663
+ }
45664
+ /**
45665
+ * Apply the dialog's values to the media
45666
+ * @private
45667
+ */ function applyValues(j, state, sizeChanged) {
45668
+ const { media, values } = state;
45669
+ if (sizeChanged && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'audio')) {
45670
+ applySize(j, state);
45671
+ }
45672
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'iframe')) {
45673
+ return;
45674
+ }
45675
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'video')) {
45676
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(media, 'poster', values.poster || null);
45677
+ }
45678
+ // Browsers only autoplay muted media, and playsinline keeps an iPhone from
45679
+ // playing it full screen
45680
+ setFlag(media, 'autoplay', values.autoplay);
45681
+ setFlag(media, 'muted', values.autoplay || values.muted);
45682
+ setFlag(media, 'loop', values.loop);
45683
+ setFlag(media, 'controls', values.controls || !values.autoplay);
45684
+ if (values.autoplay && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(media, 'video')) {
45685
+ setFlag(media, 'playsinline', true);
45686
+ }
45687
+ }
45688
+
45689
+
45690
+ /***/ }),
45691
+
45692
+ /***/ 48899:
45693
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
45694
+
45695
+ "use strict";
45696
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45697
+ /* harmony export */ videoTabs: function() { return /* binding */ videoTabs; }
45698
+ /* harmony export */ });
44600
45699
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65946);
44601
45700
  /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59400);
44602
45701
  /* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5658);
@@ -44618,32 +45717,14 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('toolbarNavigati
44618
45717
 
44619
45718
 
44620
45719
 
44621
- // Media the popup inserts go in their wrapper (see `mediaWrappers`), aligned
44622
- // with `mediaDefaultAlign`
44623
- function prepareMedia(jodit, element) {
44624
- const media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.wrapMedia)(jodit, element);
44625
- const { mediaDefaultAlign } = jodit.o;
44626
- if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
44627
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.hAlignElement)(media, mediaDefaultAlign, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.getAlignClasses)(jodit, media));
44628
- }
44629
- return media;
44630
- }
44631
45720
  function insertVideos(data) {
44632
45721
  data.files?.forEach((file)=>{
44633
- this.s.insertNode(prepareMedia(this, this.createInside.element('video', {
45722
+ this.s.insertNode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareMedia)(this, this.createInside.element('video', {
44634
45723
  controls: '',
44635
45724
  src: data.baseurl + file
44636
45725
  })));
44637
45726
  });
44638
45727
  }
44639
- // Embed code that is one element is prepared as media; other code goes in as
44640
- // it is
44641
- function prepareEmbedCode(jodit, code) {
44642
- const box = jodit.createInside.div();
44643
- box.innerHTML = code.trim();
44644
- const element = box.firstElementChild;
44645
- return element && box.childNodes.length === 1 ? prepareMedia(jodit, element) : code;
44646
- }
44647
45728
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
44648
45729
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
44649
45730
  defaultWidth: 400,
@@ -44651,71 +45732,84 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
44651
45732
  defaultHandlerSuccess: insertVideos
44652
45733
  };
44653
45734
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
44654
- jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
44655
- popup: (jodit, current, close)=>{
44656
- const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIForm(jodit, [
44657
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
44658
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIInput(jodit, {
44659
- name: 'url',
44660
- required: true,
44661
- label: 'URL',
44662
- placeholder: 'https://',
44663
- validators: [
44664
- 'url'
44665
- ]
44666
- })
44667
- ]),
44668
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
44669
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__.Button)(jodit, '', 'Insert', 'primary').onAction(()=>formLink.submit())
44670
- ])
44671
- ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIForm(jodit, [
44672
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
44673
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UITextArea(jodit, {
44674
- name: 'code',
44675
- required: true,
44676
- label: 'Embed code'
44677
- })
44678
- ]),
44679
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
44680
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__.Button)(jodit, '', 'Insert', 'primary').onAction(()=>formCode.submit())
44681
- ])
44682
- ]), tabs = [], insertCode = (code)=>{
44683
- jodit.s.restore();
44684
- jodit.s.insertHTML(prepareEmbedCode(jodit, code));
44685
- close();
44686
- };
45735
+ /**
45736
+ * The video popup's tabs: Upload, when the uploader is configured, then Link
45737
+ * and Code. `insert` runs what a tab inserts, which by default goes in at the
45738
+ * selection the popup was opened with.
45739
+ */ function videoTabs(jodit, close, insert) {
45740
+ const run = insert ?? ((fn)=>{
45741
+ jodit.s.restore();
45742
+ fn();
45743
+ });
45744
+ const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIForm(jodit, [
45745
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
45746
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIInput(jodit, {
45747
+ name: 'url',
45748
+ required: true,
45749
+ label: 'URL',
45750
+ placeholder: 'https://',
45751
+ validators: [
45752
+ 'url'
45753
+ ]
45754
+ })
45755
+ ]),
45756
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
45757
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__.Button)(jodit, '', 'Insert', 'primary').onAction(()=>formLink.submit())
45758
+ ])
45759
+ ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIForm(jodit, [
45760
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
45761
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UITextArea(jodit, {
45762
+ name: 'code',
45763
+ required: true,
45764
+ label: 'Embed code'
45765
+ })
45766
+ ]),
45767
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__.UIBlock(jodit, [
45768
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__.Button)(jodit, '', 'Insert', 'primary').onAction(()=>formCode.submit())
45769
+ ])
45770
+ ]), tabs = [], insertCode = (code)=>{
45771
+ run(()=>jodit.s.insertHTML((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.prepareEmbedCode)(jodit, code)));
45772
+ close();
45773
+ };
45774
+ if (!insert) {
44687
45775
  jodit.s.save();
44688
- const { uploader } = jodit.o;
44689
- // Base64 alone would put whole video files into the content
44690
- if (uploader.showTabInFileSelector !== false && (uploader.url || uploader.customUploadFunction)) {
44691
- tabs.push((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.UploadTab)(jodit, (data)=>{
44692
- jodit.s.restore();
44693
- (jodit.o.video?.defaultHandlerSuccess ?? insertVideos).call(jodit, data);
44694
- }, {
44695
- label: 'Drop file',
44696
- accept: 'video/*'
44697
- }));
44698
- }
44699
- tabs.push({
44700
- icon: 'link',
44701
- name: 'Link',
44702
- content: formLink.container
45776
+ }
45777
+ const { uploader } = jodit.o;
45778
+ // Base64 alone would put whole video files into the content
45779
+ if (uploader.showTabInFileSelector !== false && (uploader.url || uploader.customUploadFunction)) {
45780
+ tabs.push((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.UploadTab)(jodit, (data)=>{
45781
+ run(()=>(jodit.o.video?.defaultHandlerSuccess ?? insertVideos).call(jodit, data));
44703
45782
  }, {
44704
- icon: 'source',
44705
- name: 'Code',
44706
- content: formCode.container
44707
- });
44708
- formLink.onSubmit((data)=>{
44709
- insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.call)(jodit.o.video?.parseUrlToVideoEmbed ?? jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed, data.url, {
44710
- width: jodit.o.video?.defaultWidth,
44711
- height: jodit.o.video?.defaultHeight
44712
- }));
44713
- });
44714
- formCode.onSubmit((data)=>{
44715
- insertCode(data.code);
44716
- });
44717
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
44718
- },
45783
+ label: 'Drop file',
45784
+ accept: 'video/*'
45785
+ }));
45786
+ }
45787
+ tabs.push({
45788
+ icon: 'link',
45789
+ name: 'Link',
45790
+ content: formLink.container
45791
+ }, {
45792
+ icon: 'source',
45793
+ name: 'Code',
45794
+ content: formCode.container
45795
+ });
45796
+ formLink.onSubmit((data)=>{
45797
+ insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.call)(jodit.o.video?.parseUrlToVideoEmbed ?? jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed, data.url, {
45798
+ width: jodit.o.video?.defaultWidth,
45799
+ height: jodit.o.video?.defaultHeight
45800
+ }));
45801
+ });
45802
+ formCode.onSubmit((data)=>{
45803
+ insertCode(data.code);
45804
+ });
45805
+ const box = (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.TabsWidget)(jodit, tabs);
45806
+ // Its tabs are sized to their labels, as the file selector's are, since
45807
+ // "Upload" doesn't fit a third of the popup
45808
+ box.classList.add('jodit-file-selector');
45809
+ return box;
45810
+ }
45811
+ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
45812
+ popup: (jodit, current, close)=>videoTabs(jodit, close),
44719
45813
  tags: [
44720
45814
  'iframe'
44721
45815
  ],
@@ -45231,7 +46325,7 @@ module.exports["default"] = {"Type something":"Start writing...","pencil":"Edit"
45231
46325
  /***/ 53414:
45232
46326
  /***/ (function(module) {
45233
46327
 
45234
- module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","No","No follow","Normal","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
46328
+ module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Audio properties","Autoplay","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Controls","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Loop","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","Muted","No","No follow","Normal","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Poster","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Video properties","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
45235
46329
 
45236
46330
  /***/ }),
45237
46331