jodit-pro 4.15.19 → 4.16.0

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 (317) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.js +12 -11
  3. package/es2015/jodit.js +255 -91
  4. package/es2015/jodit.min.js +11 -10
  5. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  6. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  7. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  8. package/es2015/plugins/autocomplete/autocomplete.css +1 -1
  9. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  10. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  11. package/es2015/plugins/backup/backup.css +1 -1
  12. package/es2015/plugins/backup/backup.js +1 -1
  13. package/es2015/plugins/backup/backup.min.js +1 -1
  14. package/es2015/plugins/button-generator/button-generator.css +1 -1
  15. package/es2015/plugins/button-generator/button-generator.js +1 -1
  16. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  17. package/es2015/plugins/change-case/change-case.js +1 -1
  18. package/es2015/plugins/change-case/change-case.min.js +1 -1
  19. package/es2015/plugins/color-picker/color-picker.css +1 -1
  20. package/es2015/plugins/color-picker/color-picker.js +1 -1
  21. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  22. package/es2015/plugins/emoji/emoji.css +1 -1
  23. package/es2015/plugins/emoji/emoji.js +1 -1
  24. package/es2015/plugins/emoji/emoji.min.js +1 -1
  25. package/es2015/plugins/export-docs/export-docs.js +1 -1
  26. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  27. package/es2015/plugins/finder/finder.css +1 -1
  28. package/es2015/plugins/finder/finder.js +4 -1
  29. package/es2015/plugins/finder/finder.min.js +2 -2
  30. package/es2015/plugins/google-maps/google-maps.css +1 -1
  31. package/es2015/plugins/google-maps/google-maps.js +1 -1
  32. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  33. package/es2015/plugins/google-search/google-search.js +1 -1
  34. package/es2015/plugins/google-search/google-search.min.js +1 -1
  35. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  36. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  37. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  38. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  39. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  40. package/es2015/plugins/image-editor-pro/image-editor-pro.css +1 -1
  41. package/es2015/plugins/image-editor-pro/image-editor-pro.js +1 -1
  42. package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  43. package/es2015/plugins/keyboard/keyboard.css +1 -1
  44. package/es2015/plugins/keyboard/keyboard.js +1 -1
  45. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  46. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  47. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  48. package/es2015/plugins/page-break/page-break.js +1 -1
  49. package/es2015/plugins/page-break/page-break.min.js +1 -1
  50. package/es2015/plugins/paste-code/paste-code.css +1 -1
  51. package/es2015/plugins/paste-code/paste-code.js +1 -1
  52. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  53. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  54. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  55. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  56. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  57. package/es2015/plugins/style/style.css +1 -1
  58. package/es2015/plugins/style/style.js +1 -1
  59. package/es2015/plugins/style/style.min.js +1 -1
  60. package/es2015/plugins/templates/templates.css +1 -1
  61. package/es2015/plugins/templates/templates.js +1 -1
  62. package/es2015/plugins/templates/templates.min.js +1 -1
  63. package/es2015/plugins/todo-list/todo-list.css +1 -1
  64. package/es2015/plugins/todo-list/todo-list.js +1 -1
  65. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  66. package/es2015/plugins/translate/translate.css +1 -1
  67. package/es2015/plugins/translate/translate.js +1 -1
  68. package/es2015/plugins/translate/translate.min.js +1 -1
  69. package/es2015/plugins/tune-block/tune-block.css +1 -1
  70. package/es2015/plugins/tune-block/tune-block.js +1 -1
  71. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  72. package/es2018/jodit.fat.min.js +12 -11
  73. package/es2018/jodit.min.js +11 -10
  74. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  75. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  76. package/es2018/plugins/backup/backup.min.js +1 -1
  77. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  78. package/es2018/plugins/change-case/change-case.min.js +1 -1
  79. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  80. package/es2018/plugins/emoji/emoji.min.js +1 -1
  81. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  82. package/es2018/plugins/finder/finder.min.js +13 -13
  83. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  84. package/es2018/plugins/google-search/google-search.min.js +1 -1
  85. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  86. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  87. package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  88. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  89. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  90. package/es2018/plugins/page-break/page-break.min.js +1 -1
  91. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  92. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  93. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  94. package/es2018/plugins/style/style.min.js +1 -1
  95. package/es2018/plugins/templates/templates.min.js +1 -1
  96. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  97. package/es2018/plugins/translate/translate.min.js +1 -1
  98. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  99. package/es2021/jodit.css +1 -1
  100. package/es2021/jodit.fat.min.js +16 -15
  101. package/es2021/jodit.js +255 -91
  102. package/es2021/jodit.min.js +16 -15
  103. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  104. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  105. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  106. package/es2021/plugins/autocomplete/autocomplete.css +1 -1
  107. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  108. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  109. package/es2021/plugins/backup/backup.css +1 -1
  110. package/es2021/plugins/backup/backup.js +1 -1
  111. package/es2021/plugins/backup/backup.min.js +1 -1
  112. package/es2021/plugins/button-generator/button-generator.css +1 -1
  113. package/es2021/plugins/button-generator/button-generator.js +1 -1
  114. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  115. package/es2021/plugins/change-case/change-case.js +1 -1
  116. package/es2021/plugins/change-case/change-case.min.js +1 -1
  117. package/es2021/plugins/color-picker/color-picker.css +1 -1
  118. package/es2021/plugins/color-picker/color-picker.js +1 -1
  119. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  120. package/es2021/plugins/emoji/emoji.css +1 -1
  121. package/es2021/plugins/emoji/emoji.js +1 -1
  122. package/es2021/plugins/emoji/emoji.min.js +1 -1
  123. package/es2021/plugins/export-docs/export-docs.js +1 -1
  124. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  125. package/es2021/plugins/finder/finder.css +1 -1
  126. package/es2021/plugins/finder/finder.js +4 -1
  127. package/es2021/plugins/finder/finder.min.js +2 -2
  128. package/es2021/plugins/google-maps/google-maps.css +1 -1
  129. package/es2021/plugins/google-maps/google-maps.js +1 -1
  130. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  131. package/es2021/plugins/google-search/google-search.js +1 -1
  132. package/es2021/plugins/google-search/google-search.min.js +1 -1
  133. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  134. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  135. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  136. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  137. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  138. package/es2021/plugins/image-editor-pro/image-editor-pro.css +1 -1
  139. package/es2021/plugins/image-editor-pro/image-editor-pro.js +1 -1
  140. package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  141. package/es2021/plugins/keyboard/keyboard.css +1 -1
  142. package/es2021/plugins/keyboard/keyboard.js +1 -1
  143. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  144. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  145. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  146. package/es2021/plugins/page-break/page-break.js +1 -1
  147. package/es2021/plugins/page-break/page-break.min.js +1 -1
  148. package/es2021/plugins/paste-code/paste-code.css +1 -1
  149. package/es2021/plugins/paste-code/paste-code.js +1 -1
  150. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  151. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  152. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  153. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  154. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  155. package/es2021/plugins/style/style.css +1 -1
  156. package/es2021/plugins/style/style.js +1 -1
  157. package/es2021/plugins/style/style.min.js +1 -1
  158. package/es2021/plugins/templates/templates.css +1 -1
  159. package/es2021/plugins/templates/templates.js +1 -1
  160. package/es2021/plugins/templates/templates.min.js +1 -1
  161. package/es2021/plugins/todo-list/todo-list.css +1 -1
  162. package/es2021/plugins/todo-list/todo-list.js +1 -1
  163. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  164. package/es2021/plugins/translate/translate.css +1 -1
  165. package/es2021/plugins/translate/translate.js +1 -1
  166. package/es2021/plugins/translate/translate.min.js +1 -1
  167. package/es2021/plugins/tune-block/tune-block.css +1 -1
  168. package/es2021/plugins/tune-block/tune-block.js +1 -1
  169. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  170. package/es2021.en/jodit.css +1 -1
  171. package/es2021.en/jodit.fat.min.js +16 -15
  172. package/es2021.en/jodit.js +255 -91
  173. package/es2021.en/jodit.min.js +17 -16
  174. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  175. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  176. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  177. package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
  178. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  179. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  180. package/es2021.en/plugins/backup/backup.css +1 -1
  181. package/es2021.en/plugins/backup/backup.js +1 -1
  182. package/es2021.en/plugins/backup/backup.min.js +1 -1
  183. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  184. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  185. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  186. package/es2021.en/plugins/change-case/change-case.js +1 -1
  187. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  188. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  189. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  190. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  191. package/es2021.en/plugins/emoji/emoji.css +1 -1
  192. package/es2021.en/plugins/emoji/emoji.js +1 -1
  193. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  194. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  195. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  196. package/es2021.en/plugins/finder/finder.css +1 -1
  197. package/es2021.en/plugins/finder/finder.js +4 -1
  198. package/es2021.en/plugins/finder/finder.min.js +2 -2
  199. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  200. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  201. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  202. package/es2021.en/plugins/google-search/google-search.js +1 -1
  203. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  204. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  205. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  206. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  207. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  208. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  209. package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +1 -1
  210. package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +1 -1
  211. package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  212. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  213. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  214. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  215. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  216. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  217. package/es2021.en/plugins/page-break/page-break.js +1 -1
  218. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  219. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  220. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  221. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  222. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  223. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  224. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  225. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  226. package/es2021.en/plugins/style/style.css +1 -1
  227. package/es2021.en/plugins/style/style.js +1 -1
  228. package/es2021.en/plugins/style/style.min.js +1 -1
  229. package/es2021.en/plugins/templates/templates.css +1 -1
  230. package/es2021.en/plugins/templates/templates.js +1 -1
  231. package/es2021.en/plugins/templates/templates.min.js +1 -1
  232. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  233. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  234. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  235. package/es2021.en/plugins/translate/translate.css +1 -1
  236. package/es2021.en/plugins/translate/translate.js +1 -1
  237. package/es2021.en/plugins/translate/translate.min.js +1 -1
  238. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  239. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  240. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  241. package/es5/jodit.css +2 -2
  242. package/es5/jodit.fat.min.js +2 -2
  243. package/es5/jodit.js +357 -99
  244. package/es5/jodit.min.css +2 -2
  245. package/es5/jodit.min.js +2 -2
  246. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  247. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  248. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  249. package/es5/plugins/autocomplete/autocomplete.css +1 -1
  250. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  251. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  252. package/es5/plugins/backup/backup.css +1 -1
  253. package/es5/plugins/backup/backup.js +1 -1
  254. package/es5/plugins/backup/backup.min.js +1 -1
  255. package/es5/plugins/button-generator/button-generator.css +1 -1
  256. package/es5/plugins/button-generator/button-generator.js +1 -1
  257. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  258. package/es5/plugins/change-case/change-case.js +1 -1
  259. package/es5/plugins/change-case/change-case.min.js +1 -1
  260. package/es5/plugins/color-picker/color-picker.css +1 -1
  261. package/es5/plugins/color-picker/color-picker.js +1 -1
  262. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  263. package/es5/plugins/emoji/emoji.css +1 -1
  264. package/es5/plugins/emoji/emoji.js +1 -1
  265. package/es5/plugins/emoji/emoji.min.js +1 -1
  266. package/es5/plugins/export-docs/export-docs.js +1 -1
  267. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  268. package/es5/plugins/finder/finder.css +1 -1
  269. package/es5/plugins/finder/finder.js +4 -1
  270. package/es5/plugins/finder/finder.min.js +2 -2
  271. package/es5/plugins/google-maps/google-maps.css +1 -1
  272. package/es5/plugins/google-maps/google-maps.js +1 -1
  273. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  274. package/es5/plugins/google-search/google-search.js +1 -1
  275. package/es5/plugins/google-search/google-search.min.js +1 -1
  276. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  277. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  278. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  279. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  280. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  281. package/es5/plugins/image-editor-pro/image-editor-pro.css +1 -1
  282. package/es5/plugins/image-editor-pro/image-editor-pro.js +1 -1
  283. package/es5/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  284. package/es5/plugins/keyboard/keyboard.css +1 -1
  285. package/es5/plugins/keyboard/keyboard.js +1 -1
  286. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  287. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  288. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  289. package/es5/plugins/page-break/page-break.js +1 -1
  290. package/es5/plugins/page-break/page-break.min.js +1 -1
  291. package/es5/plugins/paste-code/paste-code.css +1 -1
  292. package/es5/plugins/paste-code/paste-code.js +1 -1
  293. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  294. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  295. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  296. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  297. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  298. package/es5/plugins/style/style.css +1 -1
  299. package/es5/plugins/style/style.js +1 -1
  300. package/es5/plugins/style/style.min.js +1 -1
  301. package/es5/plugins/templates/templates.css +1 -1
  302. package/es5/plugins/templates/templates.js +1 -1
  303. package/es5/plugins/templates/templates.min.js +1 -1
  304. package/es5/plugins/todo-list/todo-list.css +1 -1
  305. package/es5/plugins/todo-list/todo-list.js +1 -1
  306. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  307. package/es5/plugins/translate/translate.css +1 -1
  308. package/es5/plugins/translate/translate.js +1 -1
  309. package/es5/plugins/translate/translate.min.js +1 -1
  310. package/es5/plugins/tune-block/tune-block.css +1 -1
  311. package/es5/plugins/tune-block/tune-block.js +1 -1
  312. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  313. package/es5/polyfills.fat.min.js +1 -1
  314. package/es5/polyfills.js +1 -1
  315. package/es5/polyfills.min.js +1 -1
  316. package/esm/plugins/finder/browser.js +1 -1
  317. package/package.json +1 -1
package/es2015/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valerii <chupurnov@gmail.com>
4
- * Version: v4.15.19
4
+ * Version: v4.16.0
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -725,6 +725,25 @@ let ConfigPrototype = {};
725
725
  /**
726
726
  * Default width (in pixels) applied to images inserted into the editor
727
727
  */ this.imageDefaultWidth = 300;
728
+ /**
729
+ * Alignment given to images inserted into the editor. `'normal'` leaves
730
+ * them unaligned
731
+ */ this.imageDefaultAlign = 'normal';
732
+ /**
733
+ * Class names to align images with, instead of an inline `float` or
734
+ * `margin`. Aligning an image removes every class listed here and adds the
735
+ * chosen alignment's, which can be several separated by spaces.
736
+ *
737
+ * ```javascript
738
+ * Jodit.make('#editor', {
739
+ * imageAlignClasses: {
740
+ * left: 'align-left',
741
+ * right: 'align-right',
742
+ * center: 'align-center'
743
+ * }
744
+ * });
745
+ * ```
746
+ */ this.imageAlignClasses = null;
728
747
  /**
729
748
  * Do not display these buttons that are on the list
730
749
  *
@@ -1772,7 +1791,7 @@ __webpack_require__.r(__webpack_exports__);
1772
1791
  * ```
1773
1792
  * @packageDocumentation
1774
1793
  * @module constants
1775
- */ const APP_VERSION = "4.15.19";
1794
+ */ const APP_VERSION = "4.16.0";
1776
1795
  // prettier-ignore
1777
1796
  const ES = "es2015";
1778
1797
  const IS_ES_MODERN = true;
@@ -6331,6 +6350,7 @@ __webpack_require__.r(__webpack_exports__);
6331
6350
  /* harmony export */ getContentWidth: function() { return /* reexport safe */ _size_index_js__WEBPACK_IMPORTED_MODULE_6__.getContentWidth; },
6332
6351
  /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.getDataTransfer; },
6333
6352
  /* harmony export */ getFixedPositionOffset: function() { return /* reexport safe */ _size_index_js__WEBPACK_IMPORTED_MODULE_6__.getFixedPositionOffset; },
6353
+ /* harmony export */ getHAlign: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.getHAlign; },
6334
6354
  /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.getPropertyDescriptor; },
6335
6355
  /* harmony export */ getScrollParent: function() { return /* reexport safe */ _size_index_js__WEBPACK_IMPORTED_MODULE_6__.getScrollParent; },
6336
6356
  /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.getXPathByElement; },
@@ -7421,6 +7441,7 @@ function trimChars(value, chars) {
7421
7441
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7422
7442
  /* harmony export */ alignElement: function() { return /* binding */ alignElement; },
7423
7443
  /* harmony export */ clearAlign: function() { return /* binding */ clearAlign; },
7444
+ /* harmony export */ getHAlign: function() { return /* binding */ getHAlign; },
7424
7445
  /* harmony export */ hAlignElement: function() { return /* binding */ hAlignElement; }
7425
7446
  /* harmony export */ });
7426
7447
  /* harmony import */ var _dom_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22732);
@@ -7433,9 +7454,26 @@ function trimChars(value, chars) {
7433
7454
  */
7434
7455
 
7435
7456
 
7457
+ const classNames = (value)=>(value !== null && value !== void 0 ? value : '').split(/\s+/).filter(Boolean);
7436
7458
  /**
7437
- * Align image
7438
- */ function hAlignElement(image, align) {
7459
+ * Align image, with `classes` (see `imageAlignClasses`) instead of inline
7460
+ * styles when they are given
7461
+ */ function hAlignElement(image, align, classes) {
7462
+ if (classes) {
7463
+ hAlignElement(image, 'normal');
7464
+ Object.values(classes).forEach((value)=>image.classList.remove(...classNames(value)));
7465
+ image.classList.add(...classNames(classes[align || 'normal']));
7466
+ [
7467
+ 'class',
7468
+ 'style'
7469
+ ].forEach((name)=>{
7470
+ var _a;
7471
+ if (!((_a = (0,_attr_js__WEBPACK_IMPORTED_MODULE_1__.attr)(image, name)) === null || _a === void 0 ? void 0 : _a.trim())) {
7472
+ (0,_attr_js__WEBPACK_IMPORTED_MODULE_1__.attr)(image, name, null);
7473
+ }
7474
+ });
7475
+ return;
7476
+ }
7439
7477
  if (align && align !== 'normal') {
7440
7478
  if (align !== 'center') {
7441
7479
  (0,_css_js__WEBPACK_IMPORTED_MODULE_2__.css)(image, 'float', align);
@@ -7458,6 +7496,31 @@ function trimChars(value, chars) {
7458
7496
  ;(0,_css_js__WEBPACK_IMPORTED_MODULE_2__.clearCenterAlign)(image);
7459
7497
  }
7460
7498
  }
7499
+ /**
7500
+ * The alignment `hAlignElement` has set on an element
7501
+ */ function getHAlign(elm, classes) {
7502
+ if (classes) {
7503
+ for (const align of [
7504
+ 'left',
7505
+ 'right',
7506
+ 'center',
7507
+ 'normal'
7508
+ ]){
7509
+ const names = classNames(classes[align]);
7510
+ if (names.length && names.every((name)=>elm.classList.contains(name))) {
7511
+ return align;
7512
+ }
7513
+ }
7514
+ }
7515
+ const float = (0,_css_js__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'float').toLowerCase();
7516
+ if (float === 'left' || float === 'right') {
7517
+ return float;
7518
+ }
7519
+ if ((0,_css_js__WEBPACK_IMPORTED_MODULE_2__.css)(elm, 'display') === 'block' && (0,_css_js__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'margin-left') === 'auto' && (0,_css_js__WEBPACK_IMPORTED_MODULE_2__.cssInline)(elm, 'margin-right') === 'auto') {
7520
+ return 'center';
7521
+ }
7522
+ return 'normal';
7523
+ }
7461
7524
  /**
7462
7525
  * Remove text-align style for all selected children
7463
7526
  */ function clearAlign(node) {
@@ -8610,6 +8673,7 @@ const getClassName = (obj)=>{
8610
8673
  /* harmony export */ get: function() { return /* reexport safe */ _get_js__WEBPACK_IMPORTED_MODULE_15__.get; },
8611
8674
  /* harmony export */ getClassName: function() { return /* reexport safe */ _get_class_name_js__WEBPACK_IMPORTED_MODULE_16__.getClassName; },
8612
8675
  /* harmony export */ getDataTransfer: function() { return /* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_27__.getDataTransfer; },
8676
+ /* harmony export */ getHAlign: function() { return /* reexport safe */ _align_js__WEBPACK_IMPORTED_MODULE_0__.getHAlign; },
8613
8677
  /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_27__.getPropertyDescriptor; },
8614
8678
  /* harmony export */ getXPathByElement: function() { return /* reexport safe */ _selector_js__WEBPACK_IMPORTED_MODULE_24__.getXPathByElement; },
8615
8679
  /* harmony export */ hAlignElement: function() { return /* reexport safe */ _align_js__WEBPACK_IMPORTED_MODULE_0__.hAlignElement; },
@@ -10660,10 +10724,11 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
10660
10724
  /* harmony import */ var _dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
10661
10725
  /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
10662
10726
  /* harmony import */ var _helpers_checker_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27613);
10663
- /* harmony import */ var _helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(38837);
10664
- /* harmony import */ var _helpers_move_the_node_along_the_edge_outward_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43463);
10665
- /* harmony import */ var _style_commit_style_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25639);
10666
- /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(45124);
10727
+ /* harmony import */ var _helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25726);
10728
+ /* harmony import */ var _helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38837);
10729
+ /* harmony import */ var _helpers_move_the_node_along_the_edge_outward_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(43463);
10730
+ /* harmony import */ var _style_commit_style_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25639);
10731
+ /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(45124);
10667
10732
  /*!
10668
10733
  * Jodit Editor (https://xdsoft.net/jodit/)
10669
10734
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -10685,6 +10750,7 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
10685
10750
 
10686
10751
 
10687
10752
 
10753
+
10688
10754
  class Selection {
10689
10755
  /**
10690
10756
  * Short alias for this.jodit
@@ -11122,7 +11188,7 @@ class Selection {
11122
11188
  return node;
11123
11189
  }
11124
11190
  if (!_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(node)) {
11125
- const ret = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_8__.findCorrectCurrentNode)(node, range, rightMode, sel.isCollapsed, checkChild, child);
11191
+ const ret = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_9__.findCorrectCurrentNode)(node, range, rightMode, sel.isCollapsed, checkChild, child);
11126
11192
  node = ret.node;
11127
11193
  rightMode = ret.rightMode;
11128
11194
  }
@@ -11266,6 +11332,10 @@ class Selection {
11266
11332
  if (styles && typeof styles === 'object') {
11267
11333
  (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.css)(image, styles);
11268
11334
  }
11335
+ const { imageDefaultAlign, imageAlignClasses } = this.j.o;
11336
+ if (imageDefaultAlign && imageDefaultAlign !== 'normal') {
11337
+ (0,_helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_5__.hAlignElement)(image, imageDefaultAlign, imageAlignClasses);
11338
+ }
11269
11339
  const onload = ()=>{
11270
11340
  if (image.naturalHeight < image.offsetHeight || image.naturalWidth < image.offsetWidth) {
11271
11341
  (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.css)(image, {
@@ -11390,7 +11460,7 @@ class Selection {
11390
11460
  const isSignificant = (elm)=>Boolean(elm && !_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(elm, 'br') && !_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmptyTextNode(elm) && !_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTemporary(elm) && !(_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isElement(elm) && this.j.e.fire('isInvisibleForCursor', elm) === true));
11391
11461
  // check right offset
11392
11462
  if (_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(container)) {
11393
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_8__.cursorInTheEdgeOfString)(container, offset, start, end)) {
11463
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_9__.cursorInTheEdgeOfString)(container, offset, start, end)) {
11394
11464
  return false;
11395
11465
  }
11396
11466
  } else {
@@ -11782,8 +11852,8 @@ class Selection {
11782
11852
  * }) // will remove `color:red` from `span`
11783
11853
  * ```
11784
11854
  */ commitStyle(options) {
11785
- ;(0,_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_5__.assert)((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.size)(options) > 0, 'Need to pass at least one option');
11786
- const styleElm = new _style_commit_style_js__WEBPACK_IMPORTED_MODULE_7__.CommitStyle(options);
11855
+ ;(0,_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_6__.assert)((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.size)(options) > 0, 'Need to pass at least one option');
11856
+ const styleElm = new _style_commit_style_js__WEBPACK_IMPORTED_MODULE_8__.CommitStyle(options);
11787
11857
  styleElm.apply(this.j);
11788
11858
  }
11789
11859
  /**
@@ -11833,7 +11903,7 @@ class Selection {
11833
11903
  }
11834
11904
  const fragment = leftRange.extractContents();
11835
11905
  const clearEmpties = (node)=>_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.each(node, (node)=>_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmptyTextNode(node) && _dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(node));
11836
- (0,_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_5__.assert)(currentBox.parentNode, 'Splitting fails');
11906
+ (0,_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_6__.assert)(currentBox.parentNode, 'Splitting fails');
11837
11907
  try {
11838
11908
  clearEmpties(fragment);
11839
11909
  clearEmpties(currentBox);
@@ -11886,7 +11956,7 @@ class Selection {
11886
11956
  const r = range.cloneRange();
11887
11957
  r.collapse(start);
11888
11958
  _dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.safeInsertNode(r, fake);
11889
- (0,_helpers_move_the_node_along_the_edge_outward_js__WEBPACK_IMPORTED_MODULE_6__.moveTheNodeAlongTheEdgeOutward)(fake, start, this.j.editor);
11959
+ (0,_helpers_move_the_node_along_the_edge_outward_js__WEBPACK_IMPORTED_MODULE_7__.moveTheNodeAlongTheEdgeOutward)(fake, start, this.j.editor);
11890
11960
  return fake;
11891
11961
  };
11892
11962
  const leftFake = moveMaxEdgeFake(true);
@@ -14320,6 +14390,7 @@ let UIButton = class UIButton extends _element_js__WEBPACK_IMPORTED_MODULE_9__.U
14320
14390
  this.name = this.state.name;
14321
14391
  (0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.container, 'data-ref', this.state.name);
14322
14392
  (0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.container, 'ref', this.state.name);
14393
+ this.updateAriaLabel();
14323
14394
  }
14324
14395
  onChangeTooltip() {
14325
14396
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
@@ -14331,9 +14402,12 @@ let UIButton = class UIButton extends _element_js__WEBPACK_IMPORTED_MODULE_9__.U
14331
14402
  }
14332
14403
  updateAriaLabel() {
14333
14404
  const hasText = this.state.text.trim().length > 0;
14334
- const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
14335
- (0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.container, 'aria-label', i8nTooltip);
14336
- (0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.button, 'aria-label', !hasText ? i8nTooltip : null);
14405
+ // An icon-only button without a tooltip would have no accessible
14406
+ // name at all — fall back to its raw name (not translated: control
14407
+ // names are identifiers, not i18n keys).
14408
+ const label = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : !hasText && this.state.name ? this.state.name : null;
14409
+ (0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.container, 'aria-label', label);
14410
+ (0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.button, 'aria-label', !hasText ? label : null);
14337
14411
  }
14338
14412
  onChangeTabIndex() {
14339
14413
  ;(0,_helpers_utils_attr_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.container, 'tabindex', this.state.tabIndex);
@@ -15501,6 +15575,7 @@ let UIFileInput = class UIFileInput extends _input_input_js__WEBPACK_IMPORTED_MO
15501
15575
  return this.j.create.fromHTML(`<input
15502
15576
  type="file"
15503
15577
  accept="${options.onlyImages ? 'image/*' : '*'}"
15578
+ aria-label="${this.j.i18n(options.tooltip || 'Upload')}"
15504
15579
  tabindex="-1"
15505
15580
  dir="auto"
15506
15581
  multiple=""
@@ -16071,9 +16146,12 @@ let UIGroup = UIGroup_1 = class UIGroup extends _element_js__WEBPACK_IMPORTED_MO
16071
16146
  className() {
16072
16147
  return 'UIGroup';
16073
16148
  }
16074
- getRole() {
16149
+ /**
16150
+ * A generic container: `group` allows any children. Toolbar button groups
16151
+ * are lists of `listitem`s and get `role="list"` explicitly from `UIList`.
16152
+ */ getRole() {
16075
16153
  var _a;
16076
- return ((_a = this.options) === null || _a === void 0 ? void 0 : _a.role) || 'list';
16154
+ return ((_a = this.options) === null || _a === void 0 ? void 0 : _a.role) || 'group';
16077
16155
  }
16078
16156
  /**
16079
16157
  * All group children
@@ -16279,10 +16357,10 @@ let UIList = class UIList extends _group_js__WEBPACK_IMPORTED_MODULE_6__.UIGroup
16279
16357
  }
16280
16358
  /**
16281
16359
  * Make new group and append it in list of elements
16282
- */ makeGroup(role) {
16283
- return new _group_js__WEBPACK_IMPORTED_MODULE_6__.UIGroup(this.jodit, [], role ? {
16360
+ */ makeGroup(role = 'list') {
16361
+ return new _group_js__WEBPACK_IMPORTED_MODULE_6__.UIGroup(this.jodit, [], {
16284
16362
  role
16285
- } : undefined);
16363
+ });
16286
16364
  }
16287
16365
  /**
16288
16366
  * All buttons from list
@@ -25475,12 +25553,13 @@ ContextMenu = __decorate([
25475
25553
  /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(580);
25476
25554
  /* harmony import */ var _core_helpers_array_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(76855);
25477
25555
  /* harmony import */ var _core_helpers_checker_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(27613);
25478
- /* harmony import */ var _core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(43555);
25479
- /* harmony import */ var _core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38837);
25480
- /* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(67510);
25481
- /* harmony import */ var _core_view_view_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(35608);
25482
- /* harmony import */ var _core_view_view_with_toolbar_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(84075);
25483
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6441);
25556
+ /* harmony import */ var _core_helpers_html_strip_tags_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91003);
25557
+ /* harmony import */ var _core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(43555);
25558
+ /* harmony import */ var _core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38837);
25559
+ /* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67510);
25560
+ /* harmony import */ var _core_view_view_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(35608);
25561
+ /* harmony import */ var _core_view_view_with_toolbar_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(84075);
25562
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6441);
25484
25563
  function _define_property(obj, key, value) {
25485
25564
  if (key in obj) {
25486
25565
  Object.defineProperty(obj, key, {
@@ -25554,7 +25633,8 @@ var Dialog_1;
25554
25633
 
25555
25634
 
25556
25635
 
25557
- _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.dialog = {
25636
+
25637
+ _config_js__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.dialog = {
25558
25638
  namespace: '',
25559
25639
  extraButtons: [],
25560
25640
  /**
@@ -25570,7 +25650,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.dialog = {
25570
25650
  toolbarButtonSize: 'middle',
25571
25651
  zIndex: 'inherit'
25572
25652
  };
25573
- _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25653
+ _config_js__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.controls.dialog = {
25574
25654
  close: {
25575
25655
  icon: 'cancel',
25576
25656
  exec: (dialog)=>{
@@ -25580,7 +25660,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25580
25660
  };
25581
25661
  /**
25582
25662
  * Module to generate dialog windows
25583
- */ let Dialog = Dialog_1 = class Dialog extends _core_view_view_with_toolbar_js__WEBPACK_IMPORTED_MODULE_11__.ViewWithToolbar {
25663
+ */ let Dialog = Dialog_1 = class Dialog extends _core_view_view_with_toolbar_js__WEBPACK_IMPORTED_MODULE_12__.ViewWithToolbar {
25584
25664
  /** @override */ className() {
25585
25665
  return 'Dialog';
25586
25666
  }
@@ -25644,8 +25724,8 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25644
25724
  this.draggable = true;
25645
25725
  this.startX = e.clientX;
25646
25726
  this.startY = e.clientY;
25647
- this.startPoint.x = (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.dialog, 'left');
25648
- this.startPoint.y = (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.dialog, 'top');
25727
+ this.startPoint.x = (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.dialog, 'left');
25728
+ this.startPoint.y = (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.dialog, 'top');
25649
25729
  this.setMaxZIndex();
25650
25730
  if (e.cancelable) {
25651
25731
  e.preventDefault();
@@ -25735,7 +25815,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25735
25815
  if (h == null) {
25736
25816
  h = this.dialog.offsetHeight;
25737
25817
  }
25738
- ;(0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.dialog, {
25818
+ ;(0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.dialog, {
25739
25819
  width: w,
25740
25820
  height: h
25741
25821
  });
@@ -25769,7 +25849,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25769
25849
  this.moved = Math.abs(x - left) > 100 || Math.abs(y - top) > 100;
25770
25850
  }
25771
25851
  // strings on purpose: `css()` would truncate fractional pixels
25772
- ;(0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.dialog, {
25852
+ ;(0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.dialog, {
25773
25853
  left: (x || left) + 'px',
25774
25854
  top: (y || top) + 'px'
25775
25855
  });
@@ -25789,6 +25869,12 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25789
25869
  * ```
25790
25870
  */ setHeader(content) {
25791
25871
  this.setElements(this.dialogbox_header, content);
25872
+ // `role="dialog"` needs an accessible name; a text title is the
25873
+ // natural one (element titles are left to the caller).
25874
+ if ((0,_core_helpers_checker_index_js__WEBPACK_IMPORTED_MODULE_6__.isString)(content)) {
25875
+ const name = (0,_core_helpers_html_strip_tags_js__WEBPACK_IMPORTED_MODULE_7__.stripTags)(content, this.od).trim();
25876
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.attr)(this.container, 'aria-label', name || null);
25877
+ }
25792
25878
  return this;
25793
25879
  }
25794
25880
  /**
@@ -25842,7 +25928,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25842
25928
  /**
25843
25929
  * Get zIndex from dialog
25844
25930
  */ getZIndex() {
25845
- return parseInt((0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, 'zIndex'), 10) || 0;
25931
+ return parseInt((0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.container, 'zIndex'), 10) || 0;
25846
25932
  }
25847
25933
  /**
25848
25934
  * Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
@@ -25865,7 +25951,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25865
25951
  this.__openedSiblings().forEach((dialog)=>{
25866
25952
  maxZIndex = Math.max(dialog.getZIndex(), maxZIndex);
25867
25953
  });
25868
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
25954
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
25869
25955
  }
25870
25956
  /**
25871
25957
  * Expands the dialog on full browser window
@@ -25915,7 +26001,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
25915
26001
  this.setPosition(this.offsetX, this.offsetY);
25916
26002
  this.setMaxZIndex();
25917
26003
  } else {
25918
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, 'zIndex', null);
26004
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.container, 'zIndex', null);
25919
26005
  }
25920
26006
  if (this.o.fullsize) {
25921
26007
  this.toggleFullSize(true);
@@ -26042,7 +26128,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
26042
26128
  * True, if dialog was opened
26043
26129
  */ this.isOpened = false;
26044
26130
  const self1 = this;
26045
- self1.options = (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.ConfigProto)(options, (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.ConfigProto)(_config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.dialog, Dialog_1.defaultOptions));
26131
+ self1.options = (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.ConfigProto)(options, (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.ConfigProto)(_config_js__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.dialog, Dialog_1.defaultOptions));
26046
26132
  // Attach event handlers passed via `options.events` to the dialog's own
26047
26133
  // emitter (as FileBrowser already does), so a consumer — e.g. a plugin
26048
26134
  // forwarding the editor's `events` config — can observe `afterOpen` /
@@ -26060,40 +26146,40 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
26060
26146
  </div>
26061
26147
  <div class="${n('content')}"></div>
26062
26148
  <div class="${n('footer')}"></div>
26063
- <div class="${n('resizer')}">${_core_ui_index_js__WEBPACK_IMPORTED_MODULE_9__.Icon.get('resize_handler')}</div>
26149
+ <div class="${n('resizer')}">${_core_ui_index_js__WEBPACK_IMPORTED_MODULE_10__.Icon.get('resize_handler')}</div>
26064
26150
  </div>
26065
26151
  </div>`);
26066
26152
  if (self1.options.direction === 'rtl') {
26067
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(self1.container, 'direction', 'rtl');
26068
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.attr)(self1.container, 'dir', 'rtl');
26153
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(self1.container, 'direction', 'rtl');
26154
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.attr)(self1.container, 'dir', 'rtl');
26069
26155
  }
26070
26156
  if (this.o.zIndex) {
26071
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(this.container, 'zIndex', this.o.zIndex.toString());
26157
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(this.container, 'zIndex', this.o.zIndex.toString());
26072
26158
  }
26073
- ;(0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.attr)(self1.container, 'role', 'dialog');
26159
+ ;(0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.attr)(self1.container, 'role', 'dialog');
26074
26160
  Object.defineProperty(self1.container, 'component', {
26075
26161
  value: this
26076
26162
  });
26077
26163
  self1.setMod('theme', self1.o.theme || 'default').setMod('resizable', Boolean(self1.o.resizable));
26078
26164
  const dialog = self1.getElm('panel');
26079
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(dialog != null, 'Panel element does not exist');
26165
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(dialog != null, 'Panel element does not exist');
26080
26166
  const resizer = self1.getElm('resizer');
26081
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(resizer != null, 'Resizer element does not exist');
26167
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(resizer != null, 'Resizer element does not exist');
26082
26168
  const dialogbox_header = self1.getElm('header-title');
26083
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(dialogbox_header != null, 'header-title element does not exist');
26169
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(dialogbox_header != null, 'header-title element does not exist');
26084
26170
  const dialogbox_content = self1.getElm('content');
26085
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(dialogbox_content != null, 'Content element does not exist');
26171
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(dialogbox_content != null, 'Content element does not exist');
26086
26172
  const dialogbox_footer = self1.getElm('footer');
26087
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(dialogbox_footer != null, 'Footer element does not exist');
26173
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(dialogbox_footer != null, 'Footer element does not exist');
26088
26174
  const dialogbox_toolbar = self1.getElm('header-toolbar');
26089
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
26175
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
26090
26176
  this.dialog = dialog;
26091
26177
  this.resizer = resizer;
26092
26178
  this.dialogbox_header = dialogbox_header;
26093
26179
  this.dialogbox_content = dialogbox_content;
26094
26180
  this.dialogbox_footer = dialogbox_footer;
26095
26181
  this.dialogbox_toolbar = dialogbox_toolbar;
26096
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_7__.css)(self1.dialog, {
26182
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.css)(self1.dialog, {
26097
26183
  maxWidth: self1.options.maxWidth,
26098
26184
  minHeight: self1.options.minHeight,
26099
26185
  minWidth: self1.options.minWidth
@@ -26106,7 +26192,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
26106
26192
  this.e.on(self1.container, 'close_dialog', self1.close).on(this.ow, 'keydown', this.__onEsc).on(this.ow, 'resize', this.__onResize);
26107
26193
  if (this.o.closeOnClickOverlay) {
26108
26194
  const overlay = self1.getElm('overlay');
26109
- (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_8__.assert)(overlay != null, 'Overlay element does not exist');
26195
+ (0,_core_helpers_utils_assert_js__WEBPACK_IMPORTED_MODULE_9__.assert)(overlay != null, 'Overlay element does not exist');
26110
26196
  this.e.on(overlay, 'click', self1.close);
26111
26197
  }
26112
26198
  }
@@ -26115,7 +26201,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_12__.Config.prototype.controls.dialog = {
26115
26201
  * Registry of the currently opened dialogs. Replaces a DOM scan of the
26116
26202
  * whole `destination` (usually `document.body`) for every z-index update.
26117
26203
  */ Dialog.__opened = new Set();
26118
- Dialog.defaultOptions = _object_spread_props(_object_spread({}, _core_view_view_js__WEBPACK_IMPORTED_MODULE_10__.View.defaultOptions), {
26204
+ Dialog.defaultOptions = _object_spread_props(_object_spread({}, _core_view_view_js__WEBPACK_IMPORTED_MODULE_11__.View.defaultOptions), {
26119
26205
  closeOnClickOverlay: false,
26120
26206
  closeOnEsc: true
26121
26207
  });
@@ -31454,6 +31540,13 @@ let ToolbarContent = class ToolbarContent extends _core_ui_button_index_js__WEBP
31454
31540
  /** @override */ className() {
31455
31541
  return 'ToolbarContent';
31456
31542
  }
31543
+ /** A toolbar item like `ToolbarButton`: the parent group is a `list`. */ getRole() {
31544
+ return 'listitem';
31545
+ }
31546
+ /**
31547
+ * Arbitrary content is not a toggle button — `aria-pressed` is not
31548
+ * allowed on a `listitem`.
31549
+ */ onChangeActivated() {}
31457
31550
  /** @override */ update() {
31458
31551
  var _a, _b, _c;
31459
31552
  const { control } = this;
@@ -31496,7 +31589,6 @@ let ToolbarContent = class ToolbarContent extends _core_ui_button_index_js__WEBP
31496
31589
  this.control = control;
31497
31590
  this.target = target;
31498
31591
  this.container.classList.add(`${this.componentName}_${this.clearName(control.name)}`);
31499
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.attr)(this.container, 'role', 'content');
31500
31592
  }
31501
31593
  };
31502
31594
  ToolbarContent = __decorate([
@@ -38790,14 +38882,28 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('file', file);
38790
38882
  */ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.saveSelectionOnBlur = true;
38791
38883
  function focus(editor) {
38792
38884
  if (editor.o.saveSelectionOnBlur) {
38885
+ // A click that brings focus back places the caret itself, and Chrome
38886
+ // has already placed it when focus fires, so restoring would move it
38887
+ // back to the old selection. The saved markers are dropped instead.
38888
+ let focusByPointer = false;
38793
38889
  editor.e.on('blur', ()=>{
38890
+ // A press that never brought the focus back must not decide
38891
+ // what the next focus does
38892
+ focusByPointer = false;
38794
38893
  if (editor.isEditorMode()) {
38795
38894
  editor.s.save(true);
38796
38895
  }
38896
+ }).on('mousedown touchstart', ()=>{
38897
+ focusByPointer = !editor.editorIsActive;
38797
38898
  }).on('focus', ()=>{
38798
38899
  if (editor.isEditorMode()) {
38799
- editor.s.restore();
38900
+ if (focusByPointer) {
38901
+ editor.s.removeMarkers();
38902
+ } else {
38903
+ editor.s.restore();
38904
+ }
38800
38905
  }
38906
+ focusByPointer = false;
38801
38907
  });
38802
38908
  }
38803
38909
  const focus = ()=>{
@@ -39872,11 +39978,12 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
39872
39978
  /* unused harmony export imageProcessor */
39873
39979
  /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
39874
39980
  /* harmony import */ var _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65478);
39875
- /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(580);
39876
- /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
39877
- /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50911);
39878
- /* harmony import */ var _modules_uploader_helpers_data_uri_to_blob_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74569);
39879
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85745);
39981
+ /* harmony import */ var _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
39982
+ /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(580);
39983
+ /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21537);
39984
+ /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
39985
+ /* harmony import */ var _modules_uploader_helpers_data_uri_to_blob_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74569);
39986
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85745);
39880
39987
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
39881
39988
  try {
39882
39989
  var info = gen[key](arg);
@@ -39920,11 +40027,12 @@ function _async_to_generator(fn) {
39920
40027
 
39921
40028
 
39922
40029
 
40030
+
39923
40031
  const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
39924
40032
  const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
39925
40033
  /**
39926
40034
  * Change editor's size after load all images
39927
- */ class imageProcessor extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.Plugin {
40035
+ */ class imageProcessor extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
39928
40036
  afterInit(jodit) {}
39929
40037
  beforeDestruct(jodit) {
39930
40038
  const buffer = (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.cached)(jodit, 'buffer');
@@ -39963,9 +40071,9 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
39963
40071
  if (!editor.editor) {
39964
40072
  return;
39965
40073
  }
39966
- ;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.$$)('img', editor.editor).forEach((elm)=>{
39967
- if (!(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.dataBind)(elm, JODIT_IMAGE_PROCESSOR_BINDED)) {
39968
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.dataBind)(elm, JODIT_IMAGE_PROCESSOR_BINDED, true);
40074
+ ;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('img', editor.editor).forEach((elm)=>{
40075
+ if (!(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, JODIT_IMAGE_PROCESSOR_BINDED)) {
40076
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.dataBind)(elm, JODIT_IMAGE_PROCESSOR_BINDED, true);
39969
40077
  if (!elm.complete) {
39970
40078
  editor.e.on(elm, 'load', function ElementOnLoad() {
39971
40079
  var _a;
@@ -39977,6 +40085,7 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
39977
40085
  replaceDataURIToBlobUUID(editor, elm);
39978
40086
  }
39979
40087
  editor.e.on(elm, 'mousedown touchstart', ()=>{
40088
+ removeCaretText(elm);
39980
40089
  editor.s.select(elm);
39981
40090
  });
39982
40091
  }
@@ -39998,6 +40107,24 @@ __decorate([
39998
40107
  ]),
39999
40108
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.debounce)()
40000
40109
  ], imageProcessor.prototype, "afterChange", null);
40110
+ /**
40111
+ * Remove the invisible-space text beside an image, which only held a caret.
40112
+ * Selecting the image replaces the caret, and with the text still after a
40113
+ * block image, Safari highlights the rest of the image's line. See #1512
40114
+ */ function removeCaretText(elm) {
40115
+ var _a;
40116
+ for (const side of [
40117
+ 'previousSibling',
40118
+ 'nextSibling'
40119
+ ]){
40120
+ let node = elm[side];
40121
+ while(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(node) && !((_a = node.nodeValue) === null || _a === void 0 ? void 0 : _a.replace((0,_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE_REG_EXP)(), ''))){
40122
+ const next = node[side];
40123
+ _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.safeRemove(node);
40124
+ node = next;
40125
+ }
40126
+ }
40127
+ }
40001
40128
  function replaceDataURIToBlobUUID(editor, elm) {
40002
40129
  if (!editor.o.imageProcessor.replaceDataURIToBlobIdInView) {
40003
40130
  return;
@@ -40008,7 +40135,7 @@ function replaceDataURIToBlobUUID(editor, elm) {
40008
40135
  const dataUri = elm.src;
40009
40136
  let blob;
40010
40137
  try {
40011
- blob = (0,_modules_uploader_helpers_data_uri_to_blob_js__WEBPACK_IMPORTED_MODULE_5__.dataURItoBlob)(dataUri);
40138
+ blob = (0,_modules_uploader_helpers_data_uri_to_blob_js__WEBPACK_IMPORTED_MODULE_6__.dataURItoBlob)(dataUri);
40012
40139
  } catch (_a) {
40013
40140
  // A data URI the browser accepts but we cannot decode is not worth
40014
40141
  // breaking the editor over — keep the image as it is
@@ -40021,7 +40148,7 @@ function replaceDataURIToBlobUUID(editor, elm) {
40021
40148
  list[elm.src] = dataUri;
40022
40149
  editor.buffer.set(JODIT_IMAGE_BLOB_ID, list);
40023
40150
  }
40024
- _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('imageProcessor', imageProcessor);
40151
+ _core_global_js__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('imageProcessor', imageProcessor);
40025
40152
 
40026
40153
 
40027
40154
  /***/ }),
@@ -40348,7 +40475,7 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('imageProperties',
40348
40475
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
40349
40476
  /* harmony export */ readAlign: function() { return /* binding */ readAlign; }
40350
40477
  /* harmony export */ });
40351
- /* harmony import */ var _core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41180);
40478
+ /* harmony import */ var _core_helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25726);
40352
40479
  /*!
40353
40480
  * Jodit Editor (https://xdsoft.net/jodit/)
40354
40481
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -40356,20 +40483,9 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('imageProperties',
40356
40483
  */
40357
40484
  /**
40358
40485
  * @private
40359
- */ function readAlign(image, values) {
40360
- // Align
40361
- if ((0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.cssInline)(image, 'float') && [
40362
- 'left',
40363
- 'right'
40364
- ].indexOf((0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.cssInline)(image, 'float').toLowerCase()) !== -1) {
40365
- values.align = (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.css)(image, 'float');
40366
- } else {
40367
- if ((0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.css)(image, 'display') === 'block' && (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.cssInline)(image, 'margin-left') === 'auto' && (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.cssInline)(image, 'margin-right') === 'auto') {
40368
- values.align = 'center';
40369
- } else {
40370
- values.align = '';
40371
- }
40372
- }
40486
+ */ function readAlign(image, values, classes) {
40487
+ const align = (0,_core_helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_0__.getHAlign)(image, classes);
40488
+ values.align = align === 'normal' ? '' : align;
40373
40489
  }
40374
40490
 
40375
40491
 
@@ -40429,7 +40545,7 @@ function _async_to_generator(fn) {
40429
40545
  */ function readValuesFromImage(j, state) {
40430
40546
  return _async_to_generator(function*() {
40431
40547
  const { sourceImage: image, values } = state;
40432
- (0,_align_js__WEBPACK_IMPORTED_MODULE_2__.readAlign)(image, values);
40548
+ (0,_align_js__WEBPACK_IMPORTED_MODULE_2__.readAlign)(image, values, j.o.imageAlignClasses);
40433
40549
  // Border radius
40434
40550
  values.borderRadius = parseInt((0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_1__.cssInline)(image, 'border-radius') || '0', 10) || 0;
40435
40551
  // Id
@@ -41545,7 +41661,7 @@ function _async_to_generator(fn) {
41545
41661
  (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.attr)(image, 'id', id || null);
41546
41662
  }
41547
41663
  if (opt.image.editAlign) {
41548
- (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align);
41664
+ (0,_core_helpers_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.hAlignElement)(image, align, j.o.imageAlignClasses);
41549
41665
  }
41550
41666
  }
41551
41667
 
@@ -41610,10 +41726,12 @@ function _async_to_generator(fn) {
41610
41726
  marginBottom,
41611
41727
  marginLeft
41612
41728
  ];
41729
+ // Compared with the inline value, which is what `readMargins` showed, so a
41730
+ // margin from a stylesheet is not overwritten when the field is unchanged
41613
41731
  const applyMargin = (key, value)=>{
41614
- const oldValue = (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.css)(image, key);
41732
+ const oldValue = (0,_utils_utils_js__WEBPACK_IMPORTED_MODULE_1__.normalSizeToString)((0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.cssInline)(image, key) || 0);
41615
41733
  const v = (0,_utils_utils_js__WEBPACK_IMPORTED_MODULE_1__.normalSizeToString)(value);
41616
- if (oldValue.toString() !== v.toString()) {
41734
+ if (oldValue !== v) {
41617
41735
  (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_0__.css)(image, key, v);
41618
41736
  }
41619
41737
  };
@@ -42307,6 +42425,10 @@ const cmd = (control)=>control.args && (0,_core_helpers_checker_index_js__WEBPAC
42307
42425
 
42308
42426
 
42309
42427
 
42428
+ // Images align with `imageAlignClasses`; the wrappers of iframes and media
42429
+ // keep inline styles
42430
+ const alignClasses = (editor, elm)=>_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, 'img') ? editor.o.imageAlignClasses : null;
42431
+ const currentAlign = (editor, elm)=>elm ? (0,_core_helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_2__.getHAlign)(elm, alignClasses(editor, elm)) : 'normal';
42310
42432
  const align = {
42311
42433
  name: 'left',
42312
42434
  childTemplate: (_, __, value)=>value,
@@ -42316,6 +42438,16 @@ const align = {
42316
42438
  'Center',
42317
42439
  'Normal'
42318
42440
  ],
42441
+ update: (editor, button)=>{
42442
+ const current = currentAlign(editor, button.target);
42443
+ button.state.icon.name = current === 'normal' ? 'left' : current;
42444
+ },
42445
+ isActive: (editor, button)=>currentAlign(editor, button.target) !== 'normal',
42446
+ isChildActive: (editor, button)=>{
42447
+ var _a;
42448
+ const [value] = (_a = button.control.args) !== null && _a !== void 0 ? _a : [];
42449
+ return (0,_core_helpers_checker_is_string_js__WEBPACK_IMPORTED_MODULE_1__.isString)(value) && currentAlign(editor, button.target) === value.toLowerCase();
42450
+ },
42319
42451
  exec: (editor, elm, { control })=>{
42320
42452
  if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
42321
42453
  'img',
@@ -42328,7 +42460,7 @@ const align = {
42328
42460
  if (!command) {
42329
42461
  return false;
42330
42462
  }
42331
- ;(0,_core_helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command);
42463
+ ;(0,_core_helpers_utils_align_js__WEBPACK_IMPORTED_MODULE_2__.hAlignElement)(elm, command, alignClasses(editor, elm));
42332
42464
  if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, new Set([
42333
42465
  'jodit',
42334
42466
  'jodit-media'
@@ -42368,6 +42500,14 @@ const align = {
42368
42500
  'Normal'
42369
42501
  ],
42370
42502
  tooltip: 'Vertical align',
42503
+ // `vertical-align` only moves an image in the line, not a floated or block one
42504
+ isDisabled: (editor, button)=>{
42505
+ const image = button.target;
42506
+ return Boolean(image && ([
42507
+ 'left',
42508
+ 'right'
42509
+ ].includes((0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'float')) || (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_3__.css)(image, 'display') === 'block'));
42510
+ },
42371
42511
  exec: (editor, image, { control })=>{
42372
42512
  if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(image, 'img')) {
42373
42513
  return;
@@ -49031,19 +49171,26 @@ class AceEditor extends _sourceEditor_js__WEBPACK_IMPORTED_MODULE_3__.SourceEdit
49031
49171
  onResize();
49032
49172
  this.onReady();
49033
49173
  };
49174
+ let loading = false;
49034
49175
  const initAceEditor = ()=>{
49035
49176
  if (editor.isInDestruct || editor.getRealMode() !== _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && editor.getMode() !== _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.MODE_SPLIT) {
49036
49177
  return;
49037
49178
  }
49179
+ // ACE (~400 KiB from the CDN) is only needed once the source view
49180
+ // is actually shown — a page that stays in WYSIWYG must not
49181
+ // download it.
49182
+ if (!this.aceExists()) {
49183
+ if (!loading) {
49184
+ loading = true;
49185
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
49186
+ }
49187
+ return;
49188
+ }
49038
49189
  this.fromWYSIWYG();
49039
49190
  tryInitAceEditor();
49040
49191
  };
49041
49192
  editor.e.on('afterSetMode', initAceEditor);
49042
49193
  initAceEditor();
49043
- // global add ace editor in browser
49044
- if (!this.aceExists()) {
49045
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
49046
- }
49047
49194
  }
49048
49195
  destruct() {
49049
49196
  var _a, _b;
@@ -49573,7 +49720,24 @@ function createSourceEditor(type, editor, container, toWYSIWYG, fromWYSIWYG) {
49573
49720
  return false;
49574
49721
  };
49575
49722
  if (!addEventListener()) {
49576
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
49723
+ // js-beautify is only needed once the source view is shown —
49724
+ // do not download it for a page that stays in WYSIWYG.
49725
+ let loading = false;
49726
+ const loadBeautify = ()=>{
49727
+ if (loading || editor.getMode() !== _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && editor.getMode() !== _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.MODE_SPLIT) {
49728
+ return;
49729
+ }
49730
+ loading = true;
49731
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(()=>{
49732
+ // The source view was filled before the
49733
+ // beautifier arrived — format it now.
49734
+ if (addEventListener()) {
49735
+ this.syncValueFromWYSIWYG(true);
49736
+ }
49737
+ }, ()=>null);
49738
+ };
49739
+ editor.e.on('afterSetMode.source', loadBeautify);
49740
+ loadBeautify();
49577
49741
  }
49578
49742
  }
49579
49743
  this.syncValueFromWYSIWYG(true);