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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
package/es5/polyfills.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.18.2
4
+ * Version: v4.18.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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
  */
package/esm/config.d.ts CHANGED
@@ -26,7 +26,6 @@ import type { Controls } from "./types/index";
26
26
  import type { HAlignClasses } from "./types/index";
27
27
  import type { IAsyncStorageOptions } from "./types/index";
28
28
  import type { IExtraPlugin } from "./types/index";
29
- import type { ImageAlignClasses } from "./types/index";
30
29
  import type { ImageHAlign } from "./types/index";
31
30
  import type { IUIButtonState } from "./types/index";
32
31
  import type { IViewOptions } from "./types/index";
@@ -642,29 +641,19 @@ declare class Config implements IViewOptions {
642
641
  */
643
642
  imageDefaultAlign: ImageHAlign;
644
643
  /**
645
- * Class names to align images with, instead of an inline `float` or
646
- * `margin`. Aligning an image removes every class listed here and adds the
647
- * chosen alignment's, which can be several separated by spaces. An
648
- * alignment can also list several such sets, to recognise each of them;
649
- * aligning writes the first. `alignClasses.img` takes its place when set.
650
- *
651
- * ```javascript
652
- * Jodit.make('#editor', {
653
- * imageAlignClasses: {
654
- * left: 'align-left',
655
- * right: 'align-right',
656
- * center: ['align-center', 'centered']
657
- * }
658
- * });
659
- * ```
644
+ * @deprecated Use `alignClasses.img`, which takes the same value. When
645
+ * `alignClasses.img` isn't set, the editor copies this into it.
660
646
  */
661
- imageAlignClasses: Nullable<ImageAlignClasses>;
647
+ imageAlignClasses: Nullable<HAlignClasses>;
662
648
  /**
663
- * Class names to align elements with, by tag name, as `imageAlignClasses`
664
- * does for images: `img`, and `video`, `audio` and `iframe` in the media
665
- * popup. A media wrapper (see `mediaWrappers`), and Jodit's own `jodit` and
666
- * `jodit-media` wrappers, are aligned with the classes for the media in
667
- * them.
649
+ * Class names to align elements with, by tag name, instead of an inline
650
+ * `float` or `margin`: `img`, and `video`, `audio` and `iframe` in the
651
+ * media popup. Aligning an element removes every class listed for its tag
652
+ * and adds the chosen alignment's, which can be several separated by
653
+ * spaces. An alignment can also list several such sets, to recognise each
654
+ * of them; aligning writes the first. A media wrapper (see
655
+ * `mediaWrappers`), and Jodit's own `jodit` and `jodit-media` wrappers,
656
+ * are aligned with the classes for the media in them.
668
657
  *
669
658
  * ```javascript
670
659
  * const media = {
@@ -674,7 +663,15 @@ declare class Config implements IViewOptions {
674
663
  * };
675
664
  *
676
665
  * Jodit.make('#editor', {
677
- * alignClasses: { video: media, iframe: media }
666
+ * alignClasses: {
667
+ * img: {
668
+ * left: 'align-left',
669
+ * right: 'align-right',
670
+ * center: ['align-center', 'centered']
671
+ * },
672
+ * video: media,
673
+ * iframe: media
674
+ * }
678
675
  * });
679
676
  * ```
680
677
  */
@@ -989,7 +986,8 @@ interface Config {
989
986
  */
990
987
  maxHistoryLength: number;
991
988
  /**
992
- * Delay on every change
989
+ * How long a step stays open after its first change, in
990
+ * milliseconds. The changes made in that time are undone together.
993
991
  */
994
992
  timeout: number;
995
993
  };
@@ -1597,7 +1595,8 @@ interface Config {
1597
1595
  * - is wrapped in it instead of the editor-only `mediaFakeTag` when its tag
1598
1596
  * is one of `mediaBlocks`, or left in it when it's already in one
1599
1597
  * - goes in inside it when the video popup inserts it, as an upload, a
1600
- * link's embed or embed code that is one element
1598
+ * link's embed or embed code that is one element, and when a pasted
1599
+ * video link is turned into its embed
1601
1600
  * - opens the media popup for its wrapper when clicked, whose Align and
1602
1601
  * Delete act on the wrapper
1603
1602
  *
@@ -1757,7 +1756,7 @@ interface Config {
1757
1756
  }
1758
1757
  interface Config {
1759
1758
  /**
1760
- * Set of HTML tag names whose elements can be resized by the user via drag handles (e.g. images, iframes, tables)
1759
+ * Set of HTML tag names whose elements can be resized by the user via drag handles (e.g. images, iframes, tables, videos)
1761
1760
  */
1762
1761
  allowResizeTags: Set<HTMLTagNames>;
1763
1762
  resizer: {
@@ -1770,14 +1769,16 @@ interface Config {
1770
1769
  * Save width and height proportions when resizing
1771
1770
  * ```js
1772
1771
  * Jodit.make('#editor', {
1773
- * allowResizeTags: ['img', 'iframe', 'table', 'jodit'],
1772
+ * allowResizeTags: new Set(['img', 'iframe', 'table', 'jodit', 'video']),
1774
1773
  * resizer: {
1775
1774
  * useAspectRatio: false, // don't save,
1776
- * useAspectRatio: ['img'], // save only for images (default value)
1775
+ * useAspectRatio: new Set(['img']), // save only for images
1777
1776
  * useAspectRatio: true // save for all
1778
1777
  * }
1779
1778
  * });
1780
1779
  * ```
1780
+ * Images and videos keep it by default. A video with no height of its
1781
+ * own keeps it by being given only a width.
1781
1782
  */
1782
1783
  useAspectRatio: boolean | Set<HTMLTagNames>;
1783
1784
  /**
package/esm/config.js CHANGED
@@ -746,29 +746,19 @@ class Config {
746
746
  */
747
747
  this.imageDefaultAlign = 'normal';
748
748
  /**
749
- * Class names to align images with, instead of an inline `float` or
750
- * `margin`. Aligning an image removes every class listed here and adds the
751
- * chosen alignment's, which can be several separated by spaces. An
752
- * alignment can also list several such sets, to recognise each of them;
753
- * aligning writes the first. `alignClasses.img` takes its place when set.
754
- *
755
- * ```javascript
756
- * Jodit.make('#editor', {
757
- * imageAlignClasses: {
758
- * left: 'align-left',
759
- * right: 'align-right',
760
- * center: ['align-center', 'centered']
761
- * }
762
- * });
763
- * ```
749
+ * @deprecated Use `alignClasses.img`, which takes the same value. When
750
+ * `alignClasses.img` isn't set, the editor copies this into it.
764
751
  */
765
752
  this.imageAlignClasses = null;
766
753
  /**
767
- * Class names to align elements with, by tag name, as `imageAlignClasses`
768
- * does for images: `img`, and `video`, `audio` and `iframe` in the media
769
- * popup. A media wrapper (see `mediaWrappers`), and Jodit's own `jodit` and
770
- * `jodit-media` wrappers, are aligned with the classes for the media in
771
- * them.
754
+ * Class names to align elements with, by tag name, instead of an inline
755
+ * `float` or `margin`: `img`, and `video`, `audio` and `iframe` in the
756
+ * media popup. Aligning an element removes every class listed for its tag
757
+ * and adds the chosen alignment's, which can be several separated by
758
+ * spaces. An alignment can also list several such sets, to recognise each
759
+ * of them; aligning writes the first. A media wrapper (see
760
+ * `mediaWrappers`), and Jodit's own `jodit` and `jodit-media` wrappers,
761
+ * are aligned with the classes for the media in them.
772
762
  *
773
763
  * ```javascript
774
764
  * const media = {
@@ -778,7 +768,15 @@ class Config {
778
768
  * };
779
769
  *
780
770
  * Jodit.make('#editor', {
781
- * alignClasses: { video: media, iframe: media }
771
+ * alignClasses: {
772
+ * img: {
773
+ * left: 'align-left',
774
+ * right: 'align-right',
775
+ * center: ['align-center', 'centered']
776
+ * },
777
+ * video: media,
778
+ * iframe: media
779
+ * }
782
780
  * });
783
781
  * ```
784
782
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.18.2";
6
+ export const APP_VERSION = "4.18.4";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -10,7 +10,7 @@ import type { HAlignClasses, IJodit, ImageHAlign, Nullable } from "../../../type
10
10
  /**
11
11
  * The class names to align `elm` with: `alignClasses` for its tag, or for the
12
12
  * media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
13
- * `jodit-media`), falling back to `imageAlignClasses` for an image
13
+ * `jodit-media`)
14
14
  */
15
15
  export declare function getAlignClasses(jodit: IJodit, elm: Nullable<HTMLElement>): Nullable<HAlignClasses>;
16
16
  /**
@@ -15,7 +15,7 @@ const classSets = (value) => (isArray(value) ? value : [value !== null && value
15
15
  /**
16
16
  * The class names to align `elm` with: `alignClasses` for its tag, or for the
17
17
  * media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
18
- * `jodit-media`), falling back to `imageAlignClasses` for an image
18
+ * `jodit-media`)
19
19
  */
20
20
  export function getAlignClasses(jodit, elm) {
21
21
  var _a, _b;
@@ -25,8 +25,7 @@ export function getAlignClasses(jodit, elm) {
25
25
  const media = Dom.isTag(elm, new Set(['jodit', 'jodit-media']))
26
26
  ? elm.firstElementChild
27
27
  : getWrappedMedia(jodit, elm);
28
- const tag = (media !== null && media !== void 0 ? media : elm).nodeName.toLowerCase();
29
- return ((_b = (_a = jodit.o.alignClasses) === null || _a === void 0 ? void 0 : _a[tag]) !== null && _b !== void 0 ? _b : (tag === 'img' ? jodit.o.imageAlignClasses : null));
28
+ return ((_b = (_a = jodit.o.alignClasses) === null || _a === void 0 ? void 0 : _a[(media !== null && media !== void 0 ? media : elm).nodeName.toLowerCase()]) !== null && _b !== void 0 ? _b : null);
30
29
  }
31
30
  /**
32
31
  * Align image, with `classes` (see `alignClasses`) instead of inline styles
@@ -28,6 +28,7 @@ export * from "./is-unsafe-proto-key";
28
28
  export * from "./mark-deprecated";
29
29
  export * from "./media-wrapper";
30
30
  export * from "./parse-query";
31
+ export * from "./prepare-media";
31
32
  export * from "./print";
32
33
  export * from "./reset";
33
34
  export * from "./scroll-into-view";
@@ -28,6 +28,7 @@ export * from "./is-unsafe-proto-key.js";
28
28
  export * from "./mark-deprecated.js";
29
29
  export * from "./media-wrapper.js";
30
30
  export * from "./parse-query.js";
31
+ export * from "./prepare-media.js";
31
32
  export * from "./print.js";
32
33
  export * from "./reset.js";
33
34
  export * from "./scroll-into-view.js";
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module helpers/utils
8
+ */
9
+ import type { IJodit } from "../../../types/index";
10
+ /**
11
+ * Puts new media in its wrapper (see `mediaWrappers`) and aligns it with
12
+ * `mediaDefaultAlign`. Returns the wrapper, or `element` when there is none
13
+ */
14
+ export declare function prepareMedia(jodit: IJodit, element: HTMLElement): HTMLElement;
15
+ /**
16
+ * Embed code that is one element is prepared as media (see `prepareMedia`);
17
+ * other code is returned as it is
18
+ */
19
+ export declare function prepareEmbedCode(jodit: IJodit, code: string): string | HTMLElement;
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ import { getAlignClasses, hAlignElement } from "./align.js";
7
+ import { wrapMedia } from "./media-wrapper.js";
8
+ /**
9
+ * Puts new media in its wrapper (see `mediaWrappers`) and aligns it with
10
+ * `mediaDefaultAlign`. Returns the wrapper, or `element` when there is none
11
+ */
12
+ export function prepareMedia(jodit, element) {
13
+ const media = wrapMedia(jodit, element);
14
+ const { mediaDefaultAlign } = jodit.o;
15
+ if (mediaDefaultAlign && mediaDefaultAlign !== 'normal') {
16
+ hAlignElement(media, mediaDefaultAlign, getAlignClasses(jodit, media));
17
+ }
18
+ return media;
19
+ }
20
+ /**
21
+ * Embed code that is one element is prepared as media (see `prepareMedia`);
22
+ * other code is returned as it is
23
+ */
24
+ export function prepareEmbedCode(jodit, code) {
25
+ const box = jodit.createInside.div();
26
+ box.innerHTML = code.trim();
27
+ const element = box.firstElementChild;
28
+ return element && box.childNodes.length === 1
29
+ ? prepareMedia(jodit, element)
30
+ : code;
31
+ }
@@ -43,8 +43,9 @@ export function wrapUnwrappedText(style, elm, jodit) {
43
43
  Dom.append(wrapper, fragment);
44
44
  Dom.safeInsertNode(range, wrapper);
45
45
  if (style.elementIsBlock) {
46
- if (Dom.isEmpty(wrapper) &&
47
- !Dom.isTag(wrapper.firstElementChild, 'br')) {
46
+ // The wrapped content can bring its own `<br>` (an empty table
47
+ // cell's), after or inside the temporary `<font>` around the selection
48
+ if (Dom.isEmpty(wrapper) && !wrapper.querySelector('br')) {
48
49
  Dom.append(wrapper, ci.element('br'));
49
50
  }
50
51
  }
package/esm/jodit.js CHANGED
@@ -29,6 +29,18 @@ const __defaultClassesKey = 'data-jodit-default-classes';
29
29
  const NOEDIT = {
30
30
  contenteditable: false
31
31
  };
32
+ /**
33
+ * The editor's options, with the deprecated `imageAlignClasses` copied into
34
+ * `alignClasses.img` when that isn't set
35
+ */
36
+ function makeOptions(options) {
37
+ var _a;
38
+ const opt = ConfigProto(options || {}, Config.defaultOptions);
39
+ if (opt.imageAlignClasses && !((_a = opt.alignClasses) === null || _a === void 0 ? void 0 : _a.img)) {
40
+ opt.alignClasses = ConfigProto({ img: opt.imageAlignClasses }, opt.alignClasses);
41
+ }
42
+ return opt;
43
+ }
32
44
  let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
33
45
  /** @override */
34
46
  className() {
@@ -878,7 +890,7 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
878
890
  }
879
891
  /** @override **/
880
892
  initOptions(options) {
881
- this.options = (ConfigProto(options || {}, Config.defaultOptions));
893
+ this.options = makeOptions(options);
882
894
  }
883
895
  /** @override **/
884
896
  initOwners() {
@@ -1076,9 +1088,7 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
1076
1088
  right: rightSlot
1077
1089
  },
1078
1090
  statusbar: new StatusBar(this, container),
1079
- options: this.isReady
1080
- ? ConfigProto(options || {}, Config.defaultOptions)
1081
- : this.options,
1091
+ options: this.isReady ? makeOptions(options) : this.options,
1082
1092
  history: new History(this),
1083
1093
  editorWindow: this.ow
1084
1094
  };
package/esm/langs/ar.d.ts CHANGED
@@ -213,5 +213,12 @@ declare const _exports: {
213
213
  spellcheck: string;
214
214
  'Speech Recognize': string;
215
215
  All: string;
216
+ 'Video properties': string;
217
+ 'Audio properties': string;
218
+ Poster: string;
219
+ Autoplay: string;
220
+ Loop: string;
221
+ Muted: string;
222
+ Controls: string;
216
223
  };
217
224
  export = _exports;
package/esm/langs/ar.js CHANGED
@@ -227,5 +227,12 @@ export default {
227
227
  'Line height': 'ارتفاع الخط',
228
228
  spellcheck: 'التدقيق الإملائي',
229
229
  'Speech Recognize': 'التعرف على الكلام',
230
- All: 'تحديد الكل'
230
+ All: 'تحديد الكل',
231
+ 'Video properties': 'خصائص الفيديو',
232
+ 'Audio properties': 'خصائص الصوت',
233
+ Poster: 'صورة الغلاف',
234
+ Autoplay: 'تشغيل تلقائي',
235
+ Loop: 'تكرار',
236
+ Muted: 'مكتوم الصوت',
237
+ Controls: 'عناصر التحكم'
231
238
  };
package/esm/langs/az.d.ts CHANGED
@@ -219,5 +219,12 @@ declare const _exports: {
219
219
  'Insert className': string;
220
220
  'Press Alt for custom resizing': string;
221
221
  'License: %s': string;
222
+ 'Video properties': string;
223
+ 'Audio properties': string;
224
+ Poster: string;
225
+ Autoplay: string;
226
+ Loop: string;
227
+ Muted: string;
228
+ Controls: string;
222
229
  };
223
230
  export = _exports;
package/esm/langs/az.js CHANGED
@@ -236,5 +236,12 @@ export default {
236
236
  'Insert className': 'className (CSS) əlavə et',
237
237
  'Press Alt for custom resizing':
238
238
  'Fərdi ölçüləndirmə üçün Alt düyməsini basın',
239
- 'License: %s': 'Lisenziya: %s'
239
+ 'License: %s': 'Lisenziya: %s',
240
+ 'Video properties': 'Video xassələri',
241
+ 'Audio properties': 'Audio xassələri',
242
+ Poster: 'Örtük şəkli',
243
+ Autoplay: 'Avtomatik oynatma',
244
+ Loop: 'Təkrarla',
245
+ Muted: 'Səssiz',
246
+ Controls: 'İdarəetmə elementləri'
240
247
  };
@@ -211,5 +211,12 @@ declare const _exports: {
211
211
  'Find Next': string;
212
212
  'Insert className': string;
213
213
  'Press Alt for custom resizing': string;
214
+ 'Video properties': string;
215
+ 'Audio properties': string;
216
+ Poster: string;
217
+ Autoplay: string;
218
+ Loop: string;
219
+ Muted: string;
220
+ Controls: string;
214
221
  };
215
222
  export = _exports;
@@ -225,5 +225,13 @@ export default {
225
225
  'Find Previous': 'Najít Předchozí',
226
226
  'Find Next': 'Najít Další',
227
227
  'Insert className': 'Vložte název třídy',
228
- 'Press Alt for custom resizing': 'Stiskněte Alt pro vlastní změnu velikosti'
228
+ 'Press Alt for custom resizing':
229
+ 'Stiskněte Alt pro vlastní změnu velikosti',
230
+ 'Video properties': 'Vlastnosti videa',
231
+ 'Audio properties': 'Vlastnosti zvuku',
232
+ Poster: 'Náhledový obrázek',
233
+ Autoplay: 'Automatické přehrávání',
234
+ Loop: 'Opakovat',
235
+ Muted: 'Ztlumeno',
236
+ Controls: 'Ovládací prvky'
229
237
  };
package/esm/langs/de.d.ts CHANGED
@@ -215,5 +215,12 @@ declare const _exports: {
215
215
  'Insert className': string;
216
216
  'Press Alt for custom resizing': string;
217
217
  'License: %s': string;
218
+ 'Video properties': string;
219
+ 'Audio properties': string;
220
+ Poster: string;
221
+ Autoplay: string;
222
+ Loop: string;
223
+ Muted: string;
224
+ Controls: string;
218
225
  };
219
226
  export = _exports;
package/esm/langs/de.js CHANGED
@@ -231,5 +231,12 @@ export default {
231
231
  'Insert className': 'className (CSS) einfügen',
232
232
  'Press Alt for custom resizing':
233
233
  'Drücken Sie Alt für benutzerdefinierte Größenanpassung',
234
- 'License: %s': 'Lizenz: %s'
234
+ 'License: %s': 'Lizenz: %s',
235
+ 'Video properties': 'Videoeigenschaften',
236
+ 'Audio properties': 'Audioeigenschaften',
237
+ Poster: 'Vorschaubild',
238
+ Autoplay: 'Automatische Wiedergabe',
239
+ Loop: 'Wiederholen',
240
+ Muted: 'Stumm',
241
+ Controls: 'Steuerelemente'
235
242
  };
package/esm/langs/es.d.ts CHANGED
@@ -215,5 +215,12 @@ declare const _exports: {
215
215
  'Insert className': string;
216
216
  'Press Alt for custom resizing': string;
217
217
  'License: %s': string;
218
+ 'Video properties': string;
219
+ 'Audio properties': string;
220
+ Poster: string;
221
+ Autoplay: string;
222
+ Loop: string;
223
+ Muted: string;
224
+ Controls: string;
218
225
  };
219
226
  export = _exports;
package/esm/langs/es.js CHANGED
@@ -230,5 +230,12 @@ export default {
230
230
  'Insert className': 'Insertar nombre de clase',
231
231
  'Press Alt for custom resizing':
232
232
  'Presione Alt para cambiar el tamaño personalizado',
233
- 'License: %s': 'Licencia: %s'
233
+ 'License: %s': 'Licencia: %s',
234
+ 'Video properties': 'Propiedades del video',
235
+ 'Audio properties': 'Propiedades del audio',
236
+ Poster: 'Imagen de portada',
237
+ Autoplay: 'Reproducción automática',
238
+ Loop: 'Repetir',
239
+ Muted: 'Silenciado',
240
+ Controls: 'Controles'
234
241
  };
package/esm/langs/fa.d.ts CHANGED
@@ -210,5 +210,12 @@ declare const _exports: {
210
210
  'Insert className': string;
211
211
  'Press Alt for custom resizing': string;
212
212
  'License: %s': string;
213
+ 'Video properties': string;
214
+ 'Audio properties': string;
215
+ Poster: string;
216
+ Autoplay: string;
217
+ Loop: string;
218
+ Muted: string;
219
+ Controls: string;
213
220
  };
214
221
  export = _exports;
package/esm/langs/fa.js CHANGED
@@ -224,5 +224,12 @@ export default {
224
224
  'Find Next': 'پیدا کردن بعدی',
225
225
  'Insert className': 'Insertar nombre de clase',
226
226
  'Press Alt for custom resizing': 'برای تغییر اندازه سفارشی فشار دهید',
227
- 'License: %s': 'مجوز: %s'
227
+ 'License: %s': 'مجوز: %s',
228
+ 'Video properties': 'ویژگی‌های ویدیو',
229
+ 'Audio properties': 'ویژگی‌های صدا',
230
+ Poster: 'تصویر پیش‌نمایش',
231
+ Autoplay: 'پخش خودکار',
232
+ Loop: 'تکرار',
233
+ Muted: 'بی‌صدا',
234
+ Controls: 'کنترل‌ها'
228
235
  };
package/esm/langs/fi.d.ts CHANGED
@@ -216,5 +216,12 @@ declare const _exports: {
216
216
  'Press Alt for custom resizing': string;
217
217
  'Class name': string;
218
218
  'License: %s': string;
219
+ 'Video properties': string;
220
+ 'Audio properties': string;
221
+ Poster: string;
222
+ Autoplay: string;
223
+ Loop: string;
224
+ Muted: string;
225
+ Controls: string;
219
226
  };
220
227
  export = _exports;
package/esm/langs/fi.js CHANGED
@@ -230,5 +230,12 @@ export default {
230
230
  'Insert className': 'Lisää luokkanimi',
231
231
  'Press Alt for custom resizing': 'Paina Alt muokattuun koon muuttamiseen',
232
232
  'Class name': 'Luokan nimi',
233
- 'License: %s': 'Lisenssi: %s'
233
+ 'License: %s': 'Lisenssi: %s',
234
+ 'Video properties': 'Videon ominaisuudet',
235
+ 'Audio properties': 'Äänen ominaisuudet',
236
+ Poster: 'Kansikuva',
237
+ Autoplay: 'Automaattinen toisto',
238
+ Loop: 'Toista uudelleen',
239
+ Muted: 'Mykistetty',
240
+ Controls: 'Säätimet'
234
241
  };
package/esm/langs/fr.d.ts CHANGED
@@ -210,5 +210,12 @@ declare const _exports: {
210
210
  Edit: string;
211
211
  All: string;
212
212
  'License: %s': string;
213
+ 'Video properties': string;
214
+ 'Audio properties': string;
215
+ Poster: string;
216
+ Autoplay: string;
217
+ Loop: string;
218
+ Muted: string;
219
+ Controls: string;
213
220
  };
214
221
  export = _exports;