jodit-pro 4.19.4 → 4.19.6

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 (342) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.js +8 -8
  3. package/es2015/jodit.js +840 -201
  4. package/es2015/jodit.min.js +41 -41
  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/chart/chart.css +1 -1
  20. package/es2015/plugins/chart/chart.js +1 -1
  21. package/es2015/plugins/chart/chart.min.js +1 -1
  22. package/es2015/plugins/color-picker/color-picker.css +1 -1
  23. package/es2015/plugins/color-picker/color-picker.js +1 -1
  24. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  25. package/es2015/plugins/emoji/emoji.css +1 -1
  26. package/es2015/plugins/emoji/emoji.js +1 -1
  27. package/es2015/plugins/emoji/emoji.min.js +1 -1
  28. package/es2015/plugins/export-docs/export-docs.js +1 -1
  29. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  30. package/es2015/plugins/finder/finder.css +1 -1
  31. package/es2015/plugins/finder/finder.js +1 -1
  32. package/es2015/plugins/finder/finder.min.js +1 -1
  33. package/es2015/plugins/google-maps/google-maps.css +1 -1
  34. package/es2015/plugins/google-maps/google-maps.js +1 -1
  35. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  36. package/es2015/plugins/google-search/google-search.js +1 -1
  37. package/es2015/plugins/google-search/google-search.min.js +1 -1
  38. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  39. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  40. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  41. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  42. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  43. package/es2015/plugins/image-editor-pro/image-editor-pro.css +1 -1
  44. package/es2015/plugins/image-editor-pro/image-editor-pro.js +1 -1
  45. package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  46. package/es2015/plugins/keyboard/keyboard.css +1 -1
  47. package/es2015/plugins/keyboard/keyboard.js +1 -1
  48. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  49. package/es2015/plugins/math/math.css +1 -1
  50. package/es2015/plugins/math/math.js +1 -1
  51. package/es2015/plugins/math/math.min.js +1 -1
  52. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  53. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  54. package/es2015/plugins/page-break/page-break.js +1 -1
  55. package/es2015/plugins/page-break/page-break.min.js +1 -1
  56. package/es2015/plugins/paste-code/paste-code.css +1 -1
  57. package/es2015/plugins/paste-code/paste-code.js +1 -1
  58. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  59. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  60. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  61. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  62. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  63. package/es2015/plugins/style/style.css +1 -1
  64. package/es2015/plugins/style/style.js +1 -1
  65. package/es2015/plugins/style/style.min.js +1 -1
  66. package/es2015/plugins/templates/templates.css +1 -1
  67. package/es2015/plugins/templates/templates.js +1 -1
  68. package/es2015/plugins/templates/templates.min.js +1 -1
  69. package/es2015/plugins/todo-list/todo-list.css +1 -1
  70. package/es2015/plugins/todo-list/todo-list.js +1 -1
  71. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  72. package/es2015/plugins/translate/translate.css +1 -1
  73. package/es2015/plugins/translate/translate.js +1 -1
  74. package/es2015/plugins/translate/translate.min.js +1 -1
  75. package/es2015/plugins/tune-block/tune-block.css +1 -1
  76. package/es2015/plugins/tune-block/tune-block.js +1 -1
  77. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  78. package/es2018/jodit.fat.min.js +8 -8
  79. package/es2018/jodit.min.js +10 -10
  80. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  81. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  82. package/es2018/plugins/backup/backup.min.js +1 -1
  83. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  84. package/es2018/plugins/change-case/change-case.min.js +1 -1
  85. package/es2018/plugins/chart/chart.min.js +1 -1
  86. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  87. package/es2018/plugins/emoji/emoji.min.js +1 -1
  88. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  89. package/es2018/plugins/finder/finder.min.js +1 -1
  90. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  91. package/es2018/plugins/google-search/google-search.min.js +1 -1
  92. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  93. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  94. package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  95. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  96. package/es2018/plugins/math/math.min.js +1 -1
  97. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  98. package/es2018/plugins/page-break/page-break.min.js +1 -1
  99. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  100. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  101. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  102. package/es2018/plugins/style/style.min.js +1 -1
  103. package/es2018/plugins/templates/templates.min.js +1 -1
  104. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  105. package/es2018/plugins/translate/translate.min.js +1 -1
  106. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  107. package/es2021/jodit.css +1 -1
  108. package/es2021/jodit.fat.min.js +10 -10
  109. package/es2021/jodit.js +732 -144
  110. package/es2021/jodit.min.js +13 -13
  111. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  112. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  113. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  114. package/es2021/plugins/autocomplete/autocomplete.css +1 -1
  115. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  116. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  117. package/es2021/plugins/backup/backup.css +1 -1
  118. package/es2021/plugins/backup/backup.js +1 -1
  119. package/es2021/plugins/backup/backup.min.js +1 -1
  120. package/es2021/plugins/button-generator/button-generator.css +1 -1
  121. package/es2021/plugins/button-generator/button-generator.js +1 -1
  122. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  123. package/es2021/plugins/change-case/change-case.js +1 -1
  124. package/es2021/plugins/change-case/change-case.min.js +1 -1
  125. package/es2021/plugins/chart/chart.css +1 -1
  126. package/es2021/plugins/chart/chart.js +1 -1
  127. package/es2021/plugins/chart/chart.min.js +1 -1
  128. package/es2021/plugins/color-picker/color-picker.css +1 -1
  129. package/es2021/plugins/color-picker/color-picker.js +1 -1
  130. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  131. package/es2021/plugins/emoji/emoji.css +1 -1
  132. package/es2021/plugins/emoji/emoji.js +1 -1
  133. package/es2021/plugins/emoji/emoji.min.js +1 -1
  134. package/es2021/plugins/export-docs/export-docs.js +1 -1
  135. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  136. package/es2021/plugins/finder/finder.css +1 -1
  137. package/es2021/plugins/finder/finder.js +1 -1
  138. package/es2021/plugins/finder/finder.min.js +1 -1
  139. package/es2021/plugins/google-maps/google-maps.css +1 -1
  140. package/es2021/plugins/google-maps/google-maps.js +1 -1
  141. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  142. package/es2021/plugins/google-search/google-search.js +1 -1
  143. package/es2021/plugins/google-search/google-search.min.js +1 -1
  144. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  145. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  146. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  147. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  148. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  149. package/es2021/plugins/image-editor-pro/image-editor-pro.css +1 -1
  150. package/es2021/plugins/image-editor-pro/image-editor-pro.js +1 -1
  151. package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  152. package/es2021/plugins/keyboard/keyboard.css +1 -1
  153. package/es2021/plugins/keyboard/keyboard.js +1 -1
  154. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  155. package/es2021/plugins/math/math.css +1 -1
  156. package/es2021/plugins/math/math.js +1 -1
  157. package/es2021/plugins/math/math.min.js +1 -1
  158. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  159. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  160. package/es2021/plugins/page-break/page-break.js +1 -1
  161. package/es2021/plugins/page-break/page-break.min.js +1 -1
  162. package/es2021/plugins/paste-code/paste-code.css +1 -1
  163. package/es2021/plugins/paste-code/paste-code.js +1 -1
  164. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  165. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  166. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  167. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  168. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  169. package/es2021/plugins/style/style.css +1 -1
  170. package/es2021/plugins/style/style.js +1 -1
  171. package/es2021/plugins/style/style.min.js +1 -1
  172. package/es2021/plugins/templates/templates.css +1 -1
  173. package/es2021/plugins/templates/templates.js +1 -1
  174. package/es2021/plugins/templates/templates.min.js +1 -1
  175. package/es2021/plugins/todo-list/todo-list.css +1 -1
  176. package/es2021/plugins/todo-list/todo-list.js +1 -1
  177. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  178. package/es2021/plugins/translate/translate.css +1 -1
  179. package/es2021/plugins/translate/translate.js +1 -1
  180. package/es2021/plugins/translate/translate.min.js +1 -1
  181. package/es2021/plugins/tune-block/tune-block.css +1 -1
  182. package/es2021/plugins/tune-block/tune-block.js +1 -1
  183. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  184. package/es2021.en/jodit.css +1 -1
  185. package/es2021.en/jodit.fat.min.js +10 -10
  186. package/es2021.en/jodit.js +732 -144
  187. package/es2021.en/jodit.min.js +10 -10
  188. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  189. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  190. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  191. package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
  192. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  193. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  194. package/es2021.en/plugins/backup/backup.css +1 -1
  195. package/es2021.en/plugins/backup/backup.js +1 -1
  196. package/es2021.en/plugins/backup/backup.min.js +1 -1
  197. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  198. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  199. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  200. package/es2021.en/plugins/change-case/change-case.js +1 -1
  201. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  202. package/es2021.en/plugins/chart/chart.css +1 -1
  203. package/es2021.en/plugins/chart/chart.js +1 -1
  204. package/es2021.en/plugins/chart/chart.min.js +1 -1
  205. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  206. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  207. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  208. package/es2021.en/plugins/emoji/emoji.css +1 -1
  209. package/es2021.en/plugins/emoji/emoji.js +1 -1
  210. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  211. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  212. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  213. package/es2021.en/plugins/finder/finder.css +1 -1
  214. package/es2021.en/plugins/finder/finder.js +1 -1
  215. package/es2021.en/plugins/finder/finder.min.js +1 -1
  216. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  217. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  218. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  219. package/es2021.en/plugins/google-search/google-search.js +1 -1
  220. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  221. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  222. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  223. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  224. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  225. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  226. package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +1 -1
  227. package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +1 -1
  228. package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  229. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  230. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  231. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  232. package/es2021.en/plugins/math/math.css +1 -1
  233. package/es2021.en/plugins/math/math.js +1 -1
  234. package/es2021.en/plugins/math/math.min.js +1 -1
  235. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  236. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  237. package/es2021.en/plugins/page-break/page-break.js +1 -1
  238. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  239. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  240. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  241. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  242. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  243. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  244. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  245. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  246. package/es2021.en/plugins/style/style.css +1 -1
  247. package/es2021.en/plugins/style/style.js +1 -1
  248. package/es2021.en/plugins/style/style.min.js +1 -1
  249. package/es2021.en/plugins/templates/templates.css +1 -1
  250. package/es2021.en/plugins/templates/templates.js +1 -1
  251. package/es2021.en/plugins/templates/templates.min.js +1 -1
  252. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  253. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  254. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  255. package/es2021.en/plugins/translate/translate.css +1 -1
  256. package/es2021.en/plugins/translate/translate.js +1 -1
  257. package/es2021.en/plugins/translate/translate.min.js +1 -1
  258. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  259. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  260. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  261. package/es5/jodit.css +2 -2
  262. package/es5/jodit.fat.min.js +2 -2
  263. package/es5/jodit.js +1230 -207
  264. package/es5/jodit.min.css +2 -2
  265. package/es5/jodit.min.js +2 -2
  266. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  267. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
  268. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
  269. package/es5/plugins/autocomplete/autocomplete.css +1 -1
  270. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  271. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  272. package/es5/plugins/backup/backup.css +1 -1
  273. package/es5/plugins/backup/backup.js +1 -1
  274. package/es5/plugins/backup/backup.min.js +1 -1
  275. package/es5/plugins/button-generator/button-generator.css +1 -1
  276. package/es5/plugins/button-generator/button-generator.js +1 -1
  277. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  278. package/es5/plugins/change-case/change-case.js +1 -1
  279. package/es5/plugins/change-case/change-case.min.js +1 -1
  280. package/es5/plugins/chart/chart.css +1 -1
  281. package/es5/plugins/chart/chart.js +1 -1
  282. package/es5/plugins/chart/chart.min.js +1 -1
  283. package/es5/plugins/color-picker/color-picker.css +1 -1
  284. package/es5/plugins/color-picker/color-picker.js +1 -1
  285. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  286. package/es5/plugins/emoji/emoji.css +1 -1
  287. package/es5/plugins/emoji/emoji.js +1 -1
  288. package/es5/plugins/emoji/emoji.min.js +1 -1
  289. package/es5/plugins/export-docs/export-docs.js +1 -1
  290. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  291. package/es5/plugins/finder/finder.css +1 -1
  292. package/es5/plugins/finder/finder.js +1 -1
  293. package/es5/plugins/finder/finder.min.js +1 -1
  294. package/es5/plugins/google-maps/google-maps.css +1 -1
  295. package/es5/plugins/google-maps/google-maps.js +1 -1
  296. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  297. package/es5/plugins/google-search/google-search.js +1 -1
  298. package/es5/plugins/google-search/google-search.min.js +1 -1
  299. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  300. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  301. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  302. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  303. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  304. package/es5/plugins/image-editor-pro/image-editor-pro.css +1 -1
  305. package/es5/plugins/image-editor-pro/image-editor-pro.js +1 -1
  306. package/es5/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
  307. package/es5/plugins/keyboard/keyboard.css +1 -1
  308. package/es5/plugins/keyboard/keyboard.js +1 -1
  309. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  310. package/es5/plugins/math/math.css +1 -1
  311. package/es5/plugins/math/math.js +1 -1
  312. package/es5/plugins/math/math.min.js +1 -1
  313. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  314. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  315. package/es5/plugins/page-break/page-break.js +1 -1
  316. package/es5/plugins/page-break/page-break.min.js +1 -1
  317. package/es5/plugins/paste-code/paste-code.css +1 -1
  318. package/es5/plugins/paste-code/paste-code.js +1 -1
  319. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  320. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  321. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  322. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  323. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  324. package/es5/plugins/style/style.css +1 -1
  325. package/es5/plugins/style/style.js +1 -1
  326. package/es5/plugins/style/style.min.js +1 -1
  327. package/es5/plugins/templates/templates.css +1 -1
  328. package/es5/plugins/templates/templates.js +1 -1
  329. package/es5/plugins/templates/templates.min.js +1 -1
  330. package/es5/plugins/todo-list/todo-list.css +1 -1
  331. package/es5/plugins/todo-list/todo-list.js +1 -1
  332. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  333. package/es5/plugins/translate/translate.css +1 -1
  334. package/es5/plugins/translate/translate.js +1 -1
  335. package/es5/plugins/translate/translate.min.js +1 -1
  336. package/es5/plugins/tune-block/tune-block.css +1 -1
  337. package/es5/plugins/tune-block/tune-block.js +1 -1
  338. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  339. package/es5/polyfills.fat.min.js +1 -1
  340. package/es5/polyfills.js +1 -1
  341. package/es5/polyfills.min.js +1 -1
  342. 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.19.4
4
+ * Version: v4.19.6
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1816,7 +1816,7 @@ __webpack_require__.r(__webpack_exports__);
1816
1816
  * ```
1817
1817
  * @packageDocumentation
1818
1818
  * @module constants
1819
- */ const APP_VERSION = "4.19.4";
1819
+ */ const APP_VERSION = "4.19.6";
1820
1820
  // prettier-ignore
1821
1821
  const ES = "es2015";
1822
1822
  const IS_ES_MODERN = true;
@@ -1955,6 +1955,8 @@ const EMULATE_DBLCLICK_TIMEOUT = 300;
1955
1955
  * ```
1956
1956
  */ const INSERT_ONLY_TEXT = 'insert_only_text';
1957
1957
  const SAFE_COUNT_CHANGE_CALL = 10;
1958
+ // Connector answer code for a file name that is already taken (same as the HTTP status)
1959
+ const ERROR_CODE_CONFLICT = 409;
1958
1960
  const IS_MAC = typeof globalWindow !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(globalWindow.navigator.platform);
1959
1961
  const KEY_ALIASES = {
1960
1962
  add: '+',
@@ -2038,6 +2040,7 @@ const PASSIVE_EVENTS = new Set([
2038
2040
  /* harmony export */ "CLIPBOARD_ID", 0, /* binding */ CLIPBOARD_ID,
2039
2041
  /* harmony export */ "COMMAND_KEYS", 0, /* binding */ COMMAND_KEYS,
2040
2042
  /* harmony export */ "EMULATE_DBLCLICK_TIMEOUT", 0, /* binding */ EMULATE_DBLCLICK_TIMEOUT,
2043
+ /* harmony export */ "ERROR_CODE_CONFLICT", 0, /* binding */ ERROR_CODE_CONFLICT,
2041
2044
  /* harmony export */ "ES", 0, /* binding */ ES,
2042
2045
  /* harmony export */ "FAT_MODE", 0, /* binding */ FAT_MODE,
2043
2046
  /* harmony export */ "HOMEPAGE", 0, /* binding */ HOMEPAGE,
@@ -6586,6 +6589,7 @@ function isAdjacent(prev, item) {
6586
6589
  __webpack_require__.r(__webpack_exports__);
6587
6590
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6588
6591
  /* harmony export */ $$: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.$$; },
6592
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.AnswerError; },
6589
6593
  /* harmony export */ CamelCaseToKebabCase: function() { return /* reexport safe */ _string_index_js__WEBPACK_IMPORTED_MODULE_7__.CamelCaseToKebabCase; },
6590
6594
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.ConfigDeepFlatten; },
6591
6595
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.ConfigFlatten; },
@@ -6599,6 +6603,7 @@ __webpack_require__.r(__webpack_exports__);
6599
6603
  /* harmony export */ abort: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.abort; },
6600
6604
  /* harmony export */ alignElement: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.alignElement; },
6601
6605
  /* harmony export */ alreadyLoadedList: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.alreadyLoadedList; },
6606
+ /* harmony export */ answer: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.answer; },
6602
6607
  /* harmony export */ appendScriptAsync: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.appendScriptAsync; },
6603
6608
  /* harmony export */ appendStyleAsync: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.appendStyleAsync; },
6604
6609
  /* harmony export */ applyStyles: function() { return /* reexport safe */ _html_index_js__WEBPACK_IMPORTED_MODULE_4__.applyStyles; },
@@ -8676,6 +8681,7 @@ const dataBind = (elm, key, value)=>{
8676
8681
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8677
8682
 
8678
8683
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8684
+ /* harmony export */ answer: function() { return /* binding */ answer; },
8679
8685
  /* harmony export */ connection: function() { return /* binding */ connection; },
8680
8686
  /* harmony export */ error: function() { return /* binding */ error; },
8681
8687
  /* harmony export */ options: function() { return /* binding */ options; }
@@ -8699,6 +8705,9 @@ function connection(message) {
8699
8705
  function options(message) {
8700
8706
  return new _errors_index_js__WEBPACK_IMPORTED_MODULE_0__.OptionsError(message);
8701
8707
  }
8708
+ function answer(message, resp, code) {
8709
+ return new _errors_index_js__WEBPACK_IMPORTED_MODULE_0__.AnswerError(message, resp, code);
8710
+ }
8702
8711
 
8703
8712
 
8704
8713
  /***/ }),
@@ -8718,6 +8727,31 @@ function options(message) {
8718
8727
  }
8719
8728
 
8720
8729
 
8730
+ /***/ }),
8731
+
8732
+ /***/ 5311:
8733
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8734
+
8735
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8736
+ /* harmony export */ AnswerError: function() { return /* binding */ AnswerError; }
8737
+ /* harmony export */ });
8738
+ /*!
8739
+ * Jodit Editor (https://xdsoft.net/jodit/)
8740
+ * Released under MIT see LICENSE.txt in the project root for license information.
8741
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
8742
+ */ /**
8743
+ * @module helpers/utils
8744
+ */ // A connector refused the request: the answer and its `data.code` stay reachable for the handler
8745
+ class AnswerError extends Error {
8746
+ constructor(message, answer, code){
8747
+ super(message);
8748
+ this.answer = answer;
8749
+ this.code = code;
8750
+ Object.setPrototypeOf(this, AnswerError.prototype);
8751
+ }
8752
+ }
8753
+
8754
+
8721
8755
  /***/ }),
8722
8756
 
8723
8757
  /***/ 86397:
@@ -8746,13 +8780,15 @@ function options(message) {
8746
8780
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8747
8781
 
8748
8782
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8749
- /* harmony export */ ConnectionError: function() { return /* reexport safe */ _connection_error_js__WEBPACK_IMPORTED_MODULE_1__.ConnectionError; },
8750
- /* harmony export */ OptionsError: function() { return /* reexport safe */ _options_error_js__WEBPACK_IMPORTED_MODULE_2__.OptionsError; },
8783
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _answer_error_js__WEBPACK_IMPORTED_MODULE_1__.AnswerError; },
8784
+ /* harmony export */ ConnectionError: function() { return /* reexport safe */ _connection_error_js__WEBPACK_IMPORTED_MODULE_2__.ConnectionError; },
8785
+ /* harmony export */ OptionsError: function() { return /* reexport safe */ _options_error_js__WEBPACK_IMPORTED_MODULE_3__.OptionsError; },
8751
8786
  /* harmony export */ abort: function() { return /* reexport safe */ _abort_error_js__WEBPACK_IMPORTED_MODULE_0__.abort; }
8752
8787
  /* harmony export */ });
8753
8788
  /* harmony import */ var _abort_error_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93661);
8754
- /* harmony import */ var _connection_error_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86397);
8755
- /* harmony import */ var _options_error_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57865);
8789
+ /* harmony import */ var _answer_error_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5311);
8790
+ /* harmony import */ var _connection_error_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86397);
8791
+ /* harmony import */ var _options_error_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57865);
8756
8792
  /*!
8757
8793
  * Jodit Editor (https://xdsoft.net/jodit/)
8758
8794
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -8764,6 +8800,7 @@ function options(message) {
8764
8800
 
8765
8801
 
8766
8802
 
8803
+
8767
8804
  /***/ }),
8768
8805
 
8769
8806
  /***/ 57865:
@@ -8792,9 +8829,11 @@ function options(message) {
8792
8829
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8793
8830
 
8794
8831
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8832
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.AnswerError; },
8795
8833
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.ConnectionError; },
8796
8834
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.OptionsError; },
8797
8835
  /* harmony export */ abort: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.abort; },
8836
+ /* harmony export */ answer: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.answer; },
8798
8837
  /* harmony export */ connection: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.connection; },
8799
8838
  /* harmony export */ error: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.error; },
8800
8839
  /* harmony export */ options: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.options; }
@@ -9025,6 +9064,7 @@ const isPart = (node, part)=>_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTML
9025
9064
 
9026
9065
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9027
9066
  /* harmony export */ $$: function() { return /* reexport safe */ _selector_js__WEBPACK_IMPORTED_MODULE_27__.$$; },
9067
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _error_index_js__WEBPACK_IMPORTED_MODULE_13__.AnswerError; },
9028
9068
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto_js__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
9029
9069
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto_js__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
9030
9070
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto_js__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
@@ -9036,6 +9076,7 @@ const isPart = (node, part)=>_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTML
9036
9076
  /* harmony export */ abort: function() { return /* reexport safe */ _error_index_js__WEBPACK_IMPORTED_MODULE_13__.abort; },
9037
9077
  /* harmony export */ alignElement: function() { return /* reexport safe */ _align_js__WEBPACK_IMPORTED_MODULE_0__.alignElement; },
9038
9078
  /* harmony export */ alreadyLoadedList: function() { return /* reexport safe */ _append_script_js__WEBPACK_IMPORTED_MODULE_1__.alreadyLoadedList; },
9079
+ /* harmony export */ answer: function() { return /* reexport safe */ _error_index_js__WEBPACK_IMPORTED_MODULE_13__.answer; },
9039
9080
  /* harmony export */ appendScriptAsync: function() { return /* reexport safe */ _append_script_js__WEBPACK_IMPORTED_MODULE_1__.appendScriptAsync; },
9040
9081
  /* harmony export */ appendStyleAsync: function() { return /* reexport safe */ _append_script_js__WEBPACK_IMPORTED_MODULE_1__.appendStyleAsync; },
9041
9082
  /* harmony export */ assert: function() { return /* reexport safe */ _assert_js__WEBPACK_IMPORTED_MODULE_2__.assert; },
@@ -10718,6 +10759,23 @@ class Ajax {
10718
10759
  } catch (_a) {}
10719
10760
  return this;
10720
10761
  }
10762
+ // A connector answers an error with its JSON envelope and a real HTTP status (403, 409): the body says why, the reason phrase does not
10763
+ __hasAnswerEnvelope() {
10764
+ const { xhr } = this;
10765
+ if (xhr.responseType && xhr.responseType !== 'text') {
10766
+ return false;
10767
+ }
10768
+ const text = xhr.responseText;
10769
+ if (!text || text[0] !== '{') {
10770
+ return false;
10771
+ }
10772
+ try {
10773
+ const answer = JSON.parse(text);
10774
+ return (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isPlainObject)(answer) && 'success' in answer;
10775
+ } catch (_a) {
10776
+ return false;
10777
+ }
10778
+ }
10721
10779
  send() {
10722
10780
  this.__activated = true;
10723
10781
  const { xhr, o } = this;
@@ -10754,7 +10812,7 @@ class Ajax {
10754
10812
  var _a, _b;
10755
10813
  (_b = (_a = this.options).onProgress) === null || _b === void 0 ? void 0 : _b.call(_a, 10);
10756
10814
  if (xhr.readyState === XMLHttpRequest.DONE) {
10757
- if (o.successStatuses.includes(xhr.status)) {
10815
+ if (o.successStatuses.includes(xhr.status) || this.__hasAnswerEnvelope()) {
10758
10816
  onResolve();
10759
10817
  } else if (xhr.statusText) {
10760
10818
  this.__isFulfilled = true;
@@ -13869,9 +13927,11 @@ const WRAP_NODES = new Set([
13869
13927
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13870
13928
  /* harmony export */ ApplyStyle: function() { return /* binding */ ApplyStyle; }
13871
13929
  /* harmony export */ });
13872
- /* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63687);
13873
- /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77361);
13874
- /* harmony import */ var _transactions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55307);
13930
+ /* harmony import */ var _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2748);
13931
+ /* harmony import */ var _helpers_utils_selector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76078);
13932
+ /* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63687);
13933
+ /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77361);
13934
+ /* harmony import */ var _transactions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55307);
13875
13935
  /*!
13876
13936
  * Jodit Editor (https://xdsoft.net/jodit/)
13877
13937
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -13879,27 +13939,55 @@ const WRAP_NODES = new Set([
13879
13939
  */
13880
13940
 
13881
13941
 
13942
+
13943
+
13944
+ /**
13945
+ * Take a selected fragment out of the elements its style takes the place
13946
+ * of: one around it is split, so the fragment leaves it, and one in it is
13947
+ * unwrapped
13948
+ */ function takeOutOf(jodit, font, tags) {
13949
+ const range = jodit.s.createRange();
13950
+ let outer = _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
13951
+ while(outer){
13952
+ range.selectNodeContents(outer);
13953
+ range.setEndBefore(font);
13954
+ const before = range.cloneContents();
13955
+ range.selectNodeContents(outer);
13956
+ range.setStartAfter(font);
13957
+ // Split only when there's more in it, as a split leaves empty copies
13958
+ // of the elements between
13959
+ if (!_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(before) || !_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(range.cloneContents())) {
13960
+ (0,_api_index_js__WEBPACK_IMPORTED_MODULE_2__.extractSelectedPart)(outer, font, jodit);
13961
+ }
13962
+ _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(outer);
13963
+ outer = _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
13964
+ }
13965
+ ;(0,_helpers_utils_selector_js__WEBPACK_IMPORTED_MODULE_1__.$$)(tags.join(','), font).forEach((inner)=>_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(inner));
13966
+ }
13882
13967
  /** @internal */ function ApplyStyle(jodit, cs) {
13883
- var _a;
13968
+ var _a, _b;
13884
13969
  const { s: sel, editor } = jodit;
13885
13970
  (_a = editor.firstChild) === null || _a === void 0 ? void 0 : _a.normalize(); // FF fix for test "commandsTest - Exec command "bold"
13886
13971
  const fakes = sel.fakes();
13887
13972
  const collapsed = sel.isCollapsed();
13888
- let mode = _constants_js__WEBPACK_IMPORTED_MODULE_1__.INITIAL;
13973
+ let mode = _constants_js__WEBPACK_IMPORTED_MODULE_3__.INITIAL;
13889
13974
  try {
13890
13975
  // for...of closes the generator on an exception, releasing every
13891
13976
  // temporary wrapper before the selection is restored in finally.
13892
13977
  for (const font of sel.wrapInTagGen(fakes)){
13978
+ if ((_b = cs.options.exclude) === null || _b === void 0 ? void 0 : _b.length) {
13979
+ takeOutOf(jodit, font, cs.options.exclude);
13980
+ }
13893
13981
  let state = {
13894
13982
  collapsed,
13895
13983
  mode,
13896
13984
  element: font,
13897
- next: _transactions_js__WEBPACK_IMPORTED_MODULE_2__.states.START,
13985
+ next: _transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.START,
13898
13986
  jodit,
13899
13987
  style: cs
13900
13988
  };
13901
- const machine = new _api_index_js__WEBPACK_IMPORTED_MODULE_0__.FiniteStateMachine(_transactions_js__WEBPACK_IMPORTED_MODULE_2__.states.START, _transactions_js__WEBPACK_IMPORTED_MODULE_2__.transactions);
13902
- while(!jodit.isInDestruct && machine.getState() !== _transactions_js__WEBPACK_IMPORTED_MODULE_2__.states.END){
13989
+ const machine = new _api_index_js__WEBPACK_IMPORTED_MODULE_2__.FiniteStateMachine(_transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.START, _transactions_js__WEBPACK_IMPORTED_MODULE_4__.transactions);
13990
+ while(!jodit.isInDestruct && machine.getState() !== _transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.END){
13903
13991
  state = machine.dispatch('exec', state);
13904
13992
  }
13905
13993
  // The first selected fragment determines how later fragments toggle.
@@ -18856,6 +18944,20 @@ const FOCUS_EVENTS = new Set([
18856
18944
  'focusin',
18857
18945
  'focusout'
18858
18946
  ]);
18947
+ const EDITING_KEYS = new Set([
18948
+ _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER,
18949
+ _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_BACKSPACE,
18950
+ _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_DELETE
18951
+ ]);
18952
+ /**
18953
+ * Whether the input method (IME) is using the key. Safari fires the keydown
18954
+ * that ends a composition, as the Enter that confirms Japanese text, after
18955
+ * `compositionend`, and types Korean without one, so `isComposing` is false and
18956
+ * only keyCode 229 tells. Only the keys the editor turns into edits are held
18957
+ * back: the handlers that follow typing still see the rest.
18958
+ */ function isInputMethodKey(event) {
18959
+ return event.isComposing || event.keyCode === 229 && EDITING_KEYS.has(event.key);
18960
+ }
18859
18961
  const __defaultStyleDisplayKey = 'data-jodit-default-style-display';
18860
18962
  const __defaultClassesKey = 'data-jodit-default-classes';
18861
18963
  const NOEDIT = {
@@ -19914,7 +20016,7 @@ let Jodit = Jodit_1 = class Jodit extends _modules_index_js__WEBPACK_IMPORTED_MO
19914
20016
  }
19915
20017
  }
19916
20018
  const w = this.ew;
19917
- if (event instanceof w.KeyboardEvent && event.isComposing) {
20019
+ if (event instanceof w.KeyboardEvent && isInputMethodKey(event)) {
19918
20020
  return;
19919
20021
  }
19920
20022
  if (this.e && this.e.fire) {
@@ -28518,8 +28620,9 @@ class DataProvider {
28518
28620
  this.progressHandler(100);
28519
28621
  }).catch(()=>null);
28520
28622
  return promise.then((resp)=>resp.json()).then((resp)=>{
28623
+ var _a;
28521
28624
  if (resp && !this.isSuccess(resp)) {
28522
- throw new Error(this.getMessage(resp));
28625
+ throw (0,_core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_7__.answer)(this.getMessage(resp), resp, (_a = resp.data) === null || _a === void 0 ? void 0 : _a.code);
28523
28626
  }
28524
28627
  return resp;
28525
28628
  });
@@ -28658,10 +28761,11 @@ class DataProvider {
28658
28761
  */ getPathByUrl(url) {
28659
28762
  ;(0,_core_helpers_utils_set_js__WEBPACK_IMPORTED_MODULE_8__.set)('options.getLocalFileByUrl.data.url', url, this);
28660
28763
  return this.get('getLocalFileByUrl').then((resp)=>{
28764
+ var _a;
28661
28765
  if (this.isSuccess(resp)) {
28662
28766
  return resp.data;
28663
28767
  }
28664
- throw (0,_core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
28768
+ throw (0,_core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_7__.answer)(this.getMessage(resp), resp, (_a = resp.data) === null || _a === void 0 ? void 0 : _a.code);
28665
28769
  });
28666
28770
  }
28667
28771
  /**
@@ -33585,6 +33689,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.uploader = {
33585
33689
  defaultHandlerError (e) {
33586
33690
  this.j.message.error(e.message);
33587
33691
  },
33692
+ promptOnExists: true,
33693
+ promptOnExistsSuggestName (name) {
33694
+ return name;
33695
+ },
33588
33696
  contentType (requestData) {
33589
33697
  return this.ow.FormData !== undefined && typeof requestData !== 'string' ? false : 'application/x-www-form-urlencoded; charset=UTF-8';
33590
33698
  }
@@ -33751,91 +33859,225 @@ function processOldBrowserDrag(self, cData, handlerSuccess, handlerError, onFina
33751
33859
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33752
33860
  /* harmony export */ sendFiles: function() { return /* binding */ sendFiles; }
33753
33861
  /* harmony export */ });
33754
- /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21537);
33755
- /* harmony import */ var _send_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71686);
33862
+ /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
33863
+ /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21537);
33864
+ /* harmony import */ var _core_traits_dlgs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70231);
33865
+ /* harmony import */ var _dialog_prompt_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36806);
33866
+ /* harmony import */ var _send_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71686);
33867
+ /* harmony import */ var _upload_error_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(76198);
33868
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
33869
+ try {
33870
+ var info = gen[key](arg);
33871
+ var value = info.value;
33872
+ } catch (error) {
33873
+ reject(error);
33874
+ return;
33875
+ }
33876
+ if (info.done) resolve(value);
33877
+ else Promise.resolve(value).then(_next, _throw);
33878
+ }
33879
+ function _async_to_generator(fn) {
33880
+ return function() {
33881
+ var self = this, args = arguments;
33882
+ return new Promise(function(resolve, reject) {
33883
+ var gen = fn.apply(self, args);
33884
+ function _next(value) {
33885
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
33886
+ }
33887
+ function _throw(err) {
33888
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
33889
+ }
33890
+ _next(undefined);
33891
+ });
33892
+ };
33893
+ }
33894
+ function _define_property(obj, key, value) {
33895
+ if (key in obj) {
33896
+ Object.defineProperty(obj, key, {
33897
+ value: value,
33898
+ enumerable: true,
33899
+ configurable: true,
33900
+ writable: true
33901
+ });
33902
+ } else obj[key] = value;
33903
+ return obj;
33904
+ }
33905
+ function _object_spread(target) {
33906
+ for(var i = 1; i < arguments.length; i++){
33907
+ var source = arguments[i] != null ? arguments[i] : {};
33908
+ var ownKeys = Object.keys(source);
33909
+ if (typeof Object.getOwnPropertySymbols === "function") {
33910
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
33911
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
33912
+ }));
33913
+ }
33914
+ ownKeys.forEach(function(key) {
33915
+ _define_property(target, key, source[key]);
33916
+ });
33917
+ }
33918
+ return target;
33919
+ }
33756
33920
  /*!
33757
33921
  * Jodit Editor (https://xdsoft.net/jodit/)
33758
33922
  * Released under MIT see LICENSE.txt in the project root for license information.
33759
33923
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
33760
- */
33924
+ */ ;
33925
+
33926
+
33927
+
33928
+
33761
33929
 
33762
33930
  /**
33763
33931
  * Send files to server
33764
- */ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
33765
- if (!files) {
33766
- return Promise.reject((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)('Need files'));
33767
- }
33768
- const { o } = uploader;
33769
- let fileList = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(files);
33770
- if (!fileList.length) {
33771
- return Promise.reject((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)('Need files'));
33772
- }
33773
- // Client-side validation hook — returning `false` aborts the upload.
33774
- // See https://github.com/xdan/jodit/issues/1329
33775
- if ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(o.beforeUpload)) {
33776
- if (o.beforeUpload.call(uploader, fileList) === false) {
33777
- const err = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)('Upload canceled');
33778
- (handlerError || o.defaultHandlerError).call(uploader, err);
33779
- return Promise.reject(err);
33780
- }
33781
- }
33782
- const promises = [];
33783
- if (o.insertImageAsBase64URI) {
33784
- readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
33785
- }
33786
- fileList = fileList.filter((a)=>a);
33787
- if (fileList.length) {
33788
- const form = new FormData();
33789
- form.append(o.pathVariableName, uploader.path);
33790
- form.append('source', uploader.source);
33791
- let file;
33792
- for(let i = 0; i < fileList.length; i += 1){
33793
- file = fileList[i];
33794
- if (file) {
33795
- const hasRealExtension = /\.\w+$/.test(file.name);
33796
- const mime = file.type.match(/\/([a-z0-9]+)/i);
33797
- const extension = mime && mime[1] ? mime[1].toLowerCase() : '';
33798
- let newName = fileList[i].name || Math.random().toString().replace('.', '');
33799
- if (!hasRealExtension && extension) {
33800
- let extForReg = extension;
33801
- if ([
33802
- 'jpeg',
33803
- 'jpg'
33804
- ].includes(extForReg)) {
33805
- extForReg = 'jpeg|jpg';
33806
- }
33807
- const reEnd = new RegExp('.(' + extForReg + ')$', 'i');
33808
- if (!reEnd.test(newName)) {
33809
- newName += '.' + extension;
33932
+ */ function sendFiles(uploader, files, handlerSuccess, handlerError, process, // Set when a refused upload is sent again: `beforeUpload` already had its say
33933
+ retryOf) {
33934
+ return _async_to_generator(function*() {
33935
+ if (!files) {
33936
+ throw (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.error)('Need files');
33937
+ }
33938
+ const { o } = uploader;
33939
+ let fileList = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.toArray)(files);
33940
+ if (!fileList.length) {
33941
+ throw (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.error)('Need files');
33942
+ }
33943
+ let extraData = retryOf === null || retryOf === void 0 ? void 0 : retryOf.data;
33944
+ // Client-side validation hook — returning `false` aborts the upload, and it may hand back the files to send instead
33945
+ // See https://github.com/xdan/jodit/issues/1329
33946
+ if (!retryOf && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(o.beforeUpload)) {
33947
+ let plan;
33948
+ try {
33949
+ plan = yield o.beforeUpload.call(uploader, fileList);
33950
+ } catch (e) {
33951
+ (handlerError || o.defaultHandlerError).call(uploader, e);
33952
+ throw e;
33953
+ }
33954
+ if (plan === false) {
33955
+ const err = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.error)('Upload canceled');
33956
+ (handlerError || o.defaultHandlerError).call(uploader, err);
33957
+ throw err;
33958
+ }
33959
+ if ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(plan)) {
33960
+ fileList = plan;
33961
+ } else if ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(plan) && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(plan.files)) {
33962
+ fileList = plan.files;
33963
+ extraData = plan.data;
33964
+ }
33965
+ if (!fileList.length) {
33966
+ return [];
33967
+ }
33968
+ }
33969
+ const promises = [];
33970
+ if (o.insertImageAsBase64URI) {
33971
+ readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
33972
+ }
33973
+ fileList = fileList.filter((a)=>a);
33974
+ if (fileList.length) {
33975
+ const form = new FormData();
33976
+ form.append(o.pathVariableName, uploader.path);
33977
+ form.append('source', uploader.source);
33978
+ let file;
33979
+ for(let i = 0; i < fileList.length; i += 1){
33980
+ file = fileList[i];
33981
+ if (file) {
33982
+ const hasRealExtension = /\.\w+$/.test(file.name);
33983
+ const mime = file.type.match(/\/([a-z0-9]+)/i);
33984
+ const extension = mime && mime[1] ? mime[1].toLowerCase() : '';
33985
+ let newName = fileList[i].name || Math.random().toString().replace('.', '');
33986
+ if (!hasRealExtension && extension) {
33987
+ let extForReg = extension;
33988
+ if ([
33989
+ 'jpeg',
33990
+ 'jpg'
33991
+ ].includes(extForReg)) {
33992
+ extForReg = 'jpeg|jpg';
33993
+ }
33994
+ const reEnd = new RegExp('.(' + extForReg + ')$', 'i');
33995
+ if (!reEnd.test(newName)) {
33996
+ newName += '.' + extension;
33997
+ }
33810
33998
  }
33999
+ const [key, iFile, name] = o.processFileName.call(uploader, o.filesVariableName(i), fileList[i], newName);
34000
+ form.append(key, iFile, name);
33811
34001
  }
33812
- const [key, iFile, name] = o.processFileName.call(uploader, o.filesVariableName(i), fileList[i], newName);
33813
- form.append(key, iFile, name);
33814
34002
  }
33815
- }
33816
- if (process) {
33817
- process(form);
33818
- }
33819
- if (o.data && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(o.data)) {
33820
- Object.keys(o.data).forEach((key)=>{
33821
- form.append(key, o.data[key]);
33822
- });
33823
- }
33824
- o.prepareData.call(uploader, form);
33825
- promises.push((0,_send_js__WEBPACK_IMPORTED_MODULE_1__.send)(uploader, form).then((resp)=>{
33826
- if (o.isSuccess.call(uploader, resp)) {
33827
- const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
33828
- handler.call(uploader, o.process.call(uploader, resp));
34003
+ if (process) {
34004
+ process(form);
34005
+ }
34006
+ if (o.data && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(o.data)) {
34007
+ Object.keys(o.data).forEach((key)=>{
34008
+ form.append(key, o.data[key]);
34009
+ });
34010
+ }
34011
+ if (extraData) {
34012
+ Object.keys(extraData).forEach((key)=>{
34013
+ form.append(key, extraData[key]);
34014
+ });
34015
+ }
34016
+ o.prepareData.call(uploader, form);
34017
+ promises.push((0,_send_js__WEBPACK_IMPORTED_MODULE_4__.send)(uploader, form).then((resp)=>{
34018
+ if (o.isSuccess.call(uploader, resp)) {
34019
+ const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
34020
+ handler.call(uploader, o.process.call(uploader, resp));
34021
+ return resp;
34022
+ }
34023
+ const err = new _upload_error_js__WEBPACK_IMPORTED_MODULE_5__.UploadError(o.getMessage.call(uploader, resp), resp, fileList, (plan)=>{
34024
+ var _a;
34025
+ return sendFiles(uploader, (_a = plan === null || plan === void 0 ? void 0 : plan.files) !== null && _a !== void 0 ? _a : fileList, handlerSuccess, handlerError, process, {
34026
+ data: _object_spread({}, extraData, plan === null || plan === void 0 ? void 0 : plan.data)
34027
+ });
34028
+ });
34029
+ // A taken name is part of the upload, not a failure: ask for another one first
34030
+ if (err.code === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.ERROR_CODE_CONFLICT && o.promptOnExists) {
34031
+ return askAnotherName(uploader, err);
34032
+ }
34033
+ const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
34034
+ handler.call(uploader, err);
33829
34035
  return resp;
34036
+ }).then(()=>{
34037
+ uploader.j.events && uploader.j.e.fire('filesWereUploaded');
34038
+ }));
34039
+ }
34040
+ return Promise.all(promises);
34041
+ })();
34042
+ }
34043
+ function askAnotherName(uploader, err) {
34044
+ const { files } = err;
34045
+ // A batch is refused as a whole (the connector saved nothing) and the answer does not say which name is taken,
34046
+ // so the files go again one by one: the free ones are simply stored, the taken one answers 409 alone and gets its prompt
34047
+ if (files.length > 1) {
34048
+ return files.reduce((chain, file)=>chain.then(()=>err.retry({
34049
+ files: [
34050
+ file
34051
+ ]
34052
+ })), Promise.resolve());
34053
+ }
34054
+ const [file] = files;
34055
+ const { j, o } = uploader;
34056
+ return new Promise((resolve)=>{
34057
+ let answered = false;
34058
+ // `Dlgs.prototype.dlg`: the uploader's view does not always carry the Dlgs trait
34059
+ const dialog = _dialog_prompt_js__WEBPACK_IMPORTED_MODULE_3__.Prompt.call(_core_traits_dlgs_js__WEBPACK_IMPORTED_MODULE_2__.Dlgs.prototype.dlg.call(j, {
34060
+ closeOnClickOverlay: true
34061
+ }), j.i18n(err.message), j.i18n('Rename'), (newName)=>{
34062
+ newName = newName.trim();
34063
+ if (!newName) {
34064
+ return false;
33830
34065
  }
33831
- const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
33832
- handler.call(uploader, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)(o.getMessage.call(uploader, resp)));
33833
- return resp;
33834
- }).then(()=>{
33835
- uploader.j.events && uploader.j.e.fire('filesWereUploaded');
33836
- }));
33837
- }
33838
- return Promise.all(promises);
34066
+ answered = true;
34067
+ resolve(err.retry({
34068
+ files: [
34069
+ new File([
34070
+ file
34071
+ ], newName, {
34072
+ type: file.type
34073
+ })
34074
+ ]
34075
+ }));
34076
+ }, j.i18n('Enter new name'), o.promptOnExistsSuggestName.call(uploader, file.name));
34077
+ dialog.e.on(dialog, 'afterClose', ()=>{
34078
+ !answered && resolve(undefined);
34079
+ });
34080
+ });
33839
34081
  }
33840
34082
  function readImagesWithReader(fileList, imagesExtensions, promises, uploader, handlerSuccess, defaultHandlerSuccess) {
33841
34083
  const readerPromises = [];
@@ -33865,7 +34107,7 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
33865
34107
  name
33866
34108
  ]
33867
34109
  };
33868
- const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
34110
+ const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
33869
34111
  handler.call(uploader, resp);
33870
34112
  resolve(resp);
33871
34113
  };
@@ -33978,6 +34220,32 @@ function send(uploader, data) {
33978
34220
  /* harmony export */ ]);
33979
34221
 
33980
34222
 
34223
+ /***/ }),
34224
+
34225
+ /***/ 76198:
34226
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34227
+
34228
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34229
+ /* harmony export */ UploadError: function() { return /* binding */ UploadError; }
34230
+ /* harmony export */ });
34231
+ /* harmony import */ var _core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89890);
34232
+ /*!
34233
+ * Jodit Editor (https://xdsoft.net/jodit/)
34234
+ * Released under MIT see LICENSE.txt in the project root for license information.
34235
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
34236
+ */
34237
+ // The connector refused these files: the handler can change the request and send it again
34238
+ class UploadError extends _core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_0__.AnswerError {
34239
+ constructor(message, answer, files, retry){
34240
+ var _a;
34241
+ super(message, answer, (_a = answer.data) === null || _a === void 0 ? void 0 : _a.code);
34242
+ this.files = files;
34243
+ this.retry = retry;
34244
+ Object.setPrototypeOf(this, UploadError.prototype);
34245
+ }
34246
+ }
34247
+
34248
+
33981
34249
  /***/ }),
33982
34250
 
33983
34251
  /***/ 57380:
@@ -33990,9 +34258,10 @@ function send(uploader, data) {
33990
34258
  /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82758);
33991
34259
  /* harmony import */ var _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
33992
34260
  /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
33993
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6441);
33994
- /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94122);
33995
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80536);
34261
+ /* harmony import */ var _core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89890);
34262
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6441);
34263
+ /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(94122);
34264
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80536);
33996
34265
  /*!
33997
34266
  * Jodit Editor (https://xdsoft.net/jodit/)
33998
34267
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34004,6 +34273,7 @@ function send(uploader, data) {
34004
34273
 
34005
34274
 
34006
34275
 
34276
+
34007
34277
  class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.ViewComponent {
34008
34278
  get j() {
34009
34279
  return this.jodit;
@@ -34059,14 +34329,14 @@ class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.Vie
34059
34329
  }
34060
34330
  };
34061
34331
  // send data on server
34062
- if (!_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_IE && (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(cData)) {
34063
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, cData.files, handlerSuccess, handlerError).finally(onFinally);
34332
+ if (!_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_IE && (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(cData)) {
34333
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, cData.files, handlerSuccess, handlerError).finally(onFinally);
34064
34334
  return false;
34065
34335
  }
34066
34336
  if (_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_IE && !_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_ES_NEXT) {
34067
- return (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.processOldBrowserDrag)(self, cData, handlerSuccess, handlerError, onFinally);
34337
+ return (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.processOldBrowserDrag)(self, cData, handlerSuccess, handlerError, onFinally);
34068
34338
  }
34069
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasItems)(cData)) {
34339
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasItems)(cData)) {
34070
34340
  const { items } = cData;
34071
34341
  for(i = 0; i < items.length; i += 1){
34072
34342
  if (items[i].kind === 'file' && items[i].type === 'image/png') {
@@ -34074,7 +34344,7 @@ class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.Vie
34074
34344
  if (file) {
34075
34345
  const mime = file.type.match(/\/([a-z0-9]+)/i);
34076
34346
  extension = mime[1] ? mime[1].toLowerCase() : '';
34077
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, [
34347
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, [
34078
34348
  file
34079
34349
  ], handlerSuccess, handlerError, processData).finally(onFinally);
34080
34350
  }
@@ -34096,21 +34366,21 @@ class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.Vie
34096
34366
  self.j.e.on(form, 'dragend dragover dragenter dragleave drop', (e)=>{
34097
34367
  e.preventDefault();
34098
34368
  }).on(form, 'dragover', (event)=>{
34099
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(event.dataTransfer) || (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasItems)(event.dataTransfer)) {
34369
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(event.dataTransfer) || (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasItems)(event.dataTransfer)) {
34100
34370
  form.classList.add('jodit_drag_hover');
34101
34371
  event.preventDefault();
34102
34372
  }
34103
34373
  }).on(form, 'dragend dragleave', (event)=>{
34104
34374
  form.classList.remove('jodit_drag_hover');
34105
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(event.dataTransfer)) {
34375
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(event.dataTransfer)) {
34106
34376
  event.preventDefault();
34107
34377
  }
34108
34378
  }).on(form, 'drop', (event)=>{
34109
34379
  form.classList.remove('jodit_drag_hover');
34110
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(event.dataTransfer)) {
34380
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(event.dataTransfer)) {
34111
34381
  event.preventDefault();
34112
34382
  event.stopImmediatePropagation();
34113
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, event.dataTransfer.files, handlerSuccess, handlerError).finally(onFinally);
34383
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, event.dataTransfer.files, handlerSuccess, handlerError).finally(onFinally);
34114
34384
  }
34115
34385
  });
34116
34386
  const inputFile = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.first(form, (node)=>{
@@ -34119,7 +34389,7 @@ class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.Vie
34119
34389
  });
34120
34390
  if (inputFile) {
34121
34391
  self.j.e.on(inputFile, 'change', ()=>{
34122
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, inputFile.files, handlerSuccess, handlerError).then(()=>{
34392
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, inputFile.files, handlerSuccess, handlerError).then(()=>{
34123
34393
  inputFile.value = '';
34124
34394
  if (!/safari/i.test(navigator.userAgent)) {
34125
34395
  inputFile.type = '';
@@ -34134,26 +34404,41 @@ class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.Vie
34134
34404
  */ uploadRemoteImage(url, handlerSuccess, handlerError) {
34135
34405
  const uploader = this, { o } = uploader;
34136
34406
  const handlerE = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
34137
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.send)(uploader, {
34407
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.send)(uploader, {
34138
34408
  action: 'fileUploadRemote',
34139
34409
  url
34140
34410
  }).then((resp)=>{
34411
+ var _a;
34141
34412
  if (o.isSuccess.call(uploader, resp)) {
34142
34413
  const handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
34143
34414
  handler.call(uploader, o.process.call(uploader, resp));
34144
34415
  return;
34145
34416
  }
34146
- handlerE.call(uploader, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.error)(o.getMessage.call(uploader, resp)));
34417
+ handlerE.call(uploader, (0,_core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_4__.answer)(o.getMessage.call(uploader, resp), resp, (_a = resp.data) === null || _a === void 0 ? void 0 : _a.code));
34147
34418
  }).catch((e)=>handlerE.call(uploader, e));
34148
34419
  }
34149
34420
  upload(files) {
34150
34421
  return this.async.promise((resolve, reject)=>{
34151
- ;(0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(this, files, resolve, reject);
34422
+ let settled = false;
34423
+ const settle = (end)=>(value)=>{
34424
+ settled = true;
34425
+ end(value);
34426
+ };
34427
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(this, files, settle(resolve), settle(reject)).then(()=>{
34428
+ // `beforeUpload` kept no file, so no handler ran
34429
+ if (!settled) {
34430
+ resolve({
34431
+ baseurl: '',
34432
+ files: [],
34433
+ isImages: []
34434
+ });
34435
+ }
34436
+ }, settle(reject));
34152
34437
  });
34153
34438
  }
34154
34439
  destruct() {
34155
34440
  this.setStatus(_core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.STATUSES.beforeDestruct);
34156
- const instances = _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.ajaxInstances.get(this);
34441
+ const instances = _helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.ajaxInstances.get(this);
34157
34442
  if (instances) {
34158
34443
  instances.forEach((ajax)=>{
34159
34444
  try {
@@ -34168,7 +34453,7 @@ class Uploader extends _core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.Vie
34168
34453
  super(editor);
34169
34454
  this.path = '';
34170
34455
  this.source = 'default';
34171
- this.options = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.ConfigProto)(options || {}, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.ConfigProto)(_config_js__WEBPACK_IMPORTED_MODULE_4__.Config.defaultOptions.uploader, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isJoditObject)(editor) ? editor.o.uploader : {}));
34456
+ this.options = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.ConfigProto)(options || {}, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.ConfigProto)(_config_js__WEBPACK_IMPORTED_MODULE_5__.Config.defaultOptions.uploader, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isJoditObject)(editor) ? editor.o.uploader : {}));
34172
34457
  }
34173
34458
  }
34174
34459
 
@@ -35888,6 +36173,13 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
35888
36173
  if (checkJoinBareText(jodit, fakeNode, backspace)) {
35889
36174
  return true;
35890
36175
  }
36176
+ // Old content can have an inline element round blocks beside the text:
36177
+ // moved inside them, the line joins the block as it would bare text
36178
+ // (#1781)
36179
+ const inline = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
36180
+ if (joinsBareText(jodit, edgeBlock(inline, backspace)) && moveInlineInside(inline, jodit.editor)) {
36181
+ return joinNeighbors(jodit, fakeNode, backspace, moved);
36182
+ }
35891
36183
  let nextBox = fakeNode, mainClosestBox = nextBox;
35892
36184
  // Find the main big closest element
35893
36185
  while(nextBox && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(nextBox, backspace) && nextBox.parentElement !== jodit.editor){
@@ -36168,7 +36460,7 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
36168
36460
  * in `<div>a|<p>b</p>c</div>` gives `<div>a|b<br>c</div>`
36169
36461
  */ function checkJoinBareText(jodit, fakeNode, backspace) {
36170
36462
  const block = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
36171
- if (!_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) || !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) || _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) || _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') || _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) || !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) || Array.from(block.childNodes).some((node)=>_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node))) {
36463
+ if (!joinsBareText(jodit, block)) {
36172
36464
  return false;
36173
36465
  }
36174
36466
  const filter = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
@@ -36195,6 +36487,24 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
36195
36487
  jodit.s.setCursorBefore(fakeNode);
36196
36488
  return true;
36197
36489
  }
36490
+ /**
36491
+ * Whether a block joins the bare text beside it: not a list, a table or a
36492
+ * cell, and holding no block of its own
36493
+ */ function joinsBareText(jodit, block) {
36494
+ return _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) && !Array.from(block.childNodes).some((node)=>_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node));
36495
+ }
36496
+ /**
36497
+ * The block an inline element holds on its side facing the caret, through
36498
+ * the inline elements in it: the `<p>` of `<span><strong><p>…</p></strong></span>`
36499
+ */ function edgeBlock(node, backspace) {
36500
+ var _a;
36501
+ let edge = node;
36502
+ while(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(edge) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(edge)){
36503
+ const children = Array.from(edge.childNodes).filter((child)=>!_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child));
36504
+ edge = (_a = backspace ? children[children.length - 1] : children[0]) !== null && _a !== void 0 ? _a : null;
36505
+ }
36506
+ return edge === node ? null : edge;
36507
+ }
36198
36508
  function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
36199
36509
  // Process UL/LI/OL cases
36200
36510
  const siblingIsList = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
@@ -36628,7 +36938,6 @@ function isNotEditable(jodit, node) {
36628
36938
  if (!prn || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn)) {
36629
36939
  return false;
36630
36940
  }
36631
- const neighbor = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
36632
36941
  do {
36633
36942
  if (prn && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(prn)) {
36634
36943
  _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.after(prn, fakeNode);
@@ -36643,6 +36952,9 @@ function isNotEditable(jodit, node) {
36643
36952
  if (found && (0,_check_join_two_lists_js__WEBPACK_IMPORTED_MODULE_2__.checkJoinTwoLists)(jodit, fakeNode, backspace)) {
36644
36953
  return true;
36645
36954
  }
36955
+ // Looked for once the empty elements have gone, as the one beside the
36956
+ // caret can be in them: the `<br>` that Delete in `<p>|<br></p>` leaves
36957
+ const neighbor = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
36646
36958
  if (neighbor && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(neighbor) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(neighbor, _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
36647
36959
  setCursorIn(neighbor, !backspace);
36648
36960
  } else {
@@ -37103,8 +37415,15 @@ function _object_spread(target) {
37103
37415
  }
37104
37416
  cssRules[key] = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(cssOptions[key]) ? cssOptions[key][0] : cssOptions[key];
37105
37417
  });
37418
+ const element = control.tags ? control.tags[0] : undefined;
37106
37419
  editor.s.commitStyle({
37107
- element: control.tags ? control.tags[0] : undefined
37420
+ element,
37421
+ // As in the browsers and Word, each takes the other's place
37422
+ exclude: element === 'sub' ? [
37423
+ 'sup'
37424
+ ] : element === 'sup' ? [
37425
+ 'sub'
37426
+ ] : []
37108
37427
  });
37109
37428
  editor.synchronizeValues();
37110
37429
  return false;
@@ -39703,11 +40022,12 @@ __webpack_require__.r(__webpack_exports__);
39703
40022
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
39704
40023
 
39705
40024
  /* unused harmony export deleteCommand */
39706
- /* harmony import */ var _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22732);
39707
- /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(580);
39708
- /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21537);
39709
- /* harmony import */ var _core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49055);
39710
- /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50911);
40025
+ /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
40026
+ /* harmony import */ var _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22732);
40027
+ /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(580);
40028
+ /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
40029
+ /* harmony import */ var _core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49055);
40030
+ /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
39711
40031
  /*!
39712
40032
  * Jodit Editor (https://xdsoft.net/jodit/)
39713
40033
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -39718,6 +40038,7 @@ __webpack_require__.r(__webpack_exports__);
39718
40038
 
39719
40039
 
39720
40040
 
40041
+
39721
40042
  const NOT_EMPTY_CONTENT_TAGS = new Set([
39722
40043
  'img',
39723
40044
  'table',
@@ -39725,7 +40046,19 @@ const NOT_EMPTY_CONTENT_TAGS = new Set([
39725
40046
  'iframe',
39726
40047
  'hr'
39727
40048
  ]);
39728
- class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.Plugin {
40049
+ const KEEPS_SPACES = new Set([
40050
+ 'pre',
40051
+ 'pre-wrap',
40052
+ 'break-spaces'
40053
+ ]);
40054
+ /**
40055
+ * A plain space beside this neighbor isn't shown: there is none, or it's a
40056
+ * line break, a block or text starting (or ending) with a plain space
40057
+ */ function hidesSpace(neighbor, edge) {
40058
+ var _a;
40059
+ return !neighbor || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(neighbor, 'br') || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(neighbor) || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(neighbor) && edge.test((_a = neighbor.nodeValue) !== null && _a !== void 0 ? _a : '');
40060
+ }
40061
+ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
39729
40062
  afterInit(jodit) {
39730
40063
  jodit.e.on('afterCommand.delete', (command)=>{
39731
40064
  if (command === 'delete') {
@@ -39746,11 +40079,11 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39746
40079
  */ __afterDeleteCommand() {
39747
40080
  const jodit = this.j;
39748
40081
  const current = jodit.s.current();
39749
- if (current && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(current.firstChild, 'br')) {
40082
+ if (current && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(current.firstChild, 'br')) {
39750
40083
  jodit.s.removeNode(current.firstChild);
39751
40084
  }
39752
- if (!(0,_core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_3__.trim)(jodit.editor.textContent || '') && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.first(jodit.editor, (node)=>_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS)) && (!current || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, 'table', jodit.editor))) {
39753
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.detach(jodit.editor);
40085
+ if (!(0,_core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_4__.trim)(jodit.editor.textContent || '') && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.first(jodit.editor, (node)=>_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS)) && (!current || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, 'table', jodit.editor))) {
40086
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(jodit.editor);
39754
40087
  const node = jodit.s.setCursorIn(jodit.editor);
39755
40088
  jodit.s.removeNode(node);
39756
40089
  }
@@ -39770,14 +40103,15 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39770
40103
  range.deleteContents();
39771
40104
  const fake = jodit.createInside.fake();
39772
40105
  range.insertNode(fake);
39773
- const leftSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(fake, true);
39774
- const rightSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(fake, false);
40106
+ const leftSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(fake, true);
40107
+ const rightSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(fake, false);
39775
40108
  this.__moveContentInLeftSibling(fake, leftSibling, rightSibling);
40109
+ this.__keepSpacesVisible(fake);
39776
40110
  range.setStartBefore(fake);
39777
40111
  range.collapse(true);
39778
40112
  this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
39779
40113
  this.__addBrInEmptyBlock(fake, range);
39780
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(fake);
40114
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
39781
40115
  jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
39782
40116
  return false;
39783
40117
  }
@@ -39791,23 +40125,23 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39791
40125
  * Returns where the caret goes, or null when no table is involved
39792
40126
  */ __clearSelectedCells(range) {
39793
40127
  const { editor, createInside } = this.j;
39794
- const startCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(range.startContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell, editor);
39795
- const endCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(range.endContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell, editor);
40128
+ const startCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
40129
+ const endCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.endContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
39796
40130
  if (startCell === endCell) {
39797
40131
  return null;
39798
40132
  }
39799
- const startTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(startCell, 'table', editor);
39800
- const endTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(endCell, 'table', editor);
40133
+ const startTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(startCell, 'table', editor);
40134
+ const endTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(endCell, 'table', editor);
39801
40135
  const caret = range.cloneRange();
39802
40136
  caret.collapse(true);
39803
40137
  const parts = [];
39804
40138
  const addParts = (table)=>{
39805
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.toArray)(table.rows).flatMap((row)=>(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.toArray)(row.cells)).filter((cell)=>range.intersectsNode(cell)).forEach((cell)=>{
40139
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.toArray)(table.rows).flatMap((row)=>(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.toArray)(row.cells)).filter((cell)=>range.intersectsNode(cell)).forEach((cell)=>{
39806
40140
  const part = range.cloneRange();
39807
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(cell, range.startContainer)) {
40141
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.startContainer)) {
39808
40142
  part.setStart(cell, 0);
39809
40143
  }
39810
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(cell, range.endContainer)) {
40144
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.endContainer)) {
39811
40145
  part.setEnd(cell, cell.childNodes.length);
39812
40146
  }
39813
40147
  parts.push([
@@ -39830,9 +40164,9 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39830
40164
  }
39831
40165
  parts.forEach(([cell, part])=>{
39832
40166
  part.deleteContents();
39833
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(cell)) {
39834
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.detach(cell);
39835
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(cell, createInside.element('br'));
40167
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(cell)) {
40168
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(cell);
40169
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(cell, createInside.element('br'));
39836
40170
  }
39837
40171
  });
39838
40172
  return startTable ? caret : null;
@@ -39840,46 +40174,76 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39840
40174
  __moveContentInLeftSibling(fake, leftSibling, rightSibling) {
39841
40175
  leftSibling = this.__defineRightLeftBox(leftSibling);
39842
40176
  // Nothing is moved into a table, and a block left empty after it goes
39843
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(leftSibling, 'table')) {
39844
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(rightSibling)) {
39845
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(rightSibling);
40177
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(leftSibling, 'table')) {
40178
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
40179
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
39846
40180
  }
39847
40181
  return;
39848
40182
  }
39849
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(rightSibling) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(rightSibling, 'table') && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(leftSibling)) {
39850
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, fake);
39851
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.moveContent(rightSibling, leftSibling);
39852
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(rightSibling);
40183
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table') && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
40184
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
40185
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(rightSibling, leftSibling);
40186
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
39853
40187
  }
39854
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(rightSibling.firstElementChild)) {
40188
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild)) {
39855
40189
  const item = rightSibling.firstElementChild;
39856
40190
  // What's left of the right list's first item joins the left block,
39857
40191
  // up to a list nested in the item
39858
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(item) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(leftSibling)) {
39859
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, fake);
39860
- while(item.firstChild && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(item.firstChild)){
39861
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, item.firstChild);
40192
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
40193
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
40194
+ while(item.firstChild && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(item.firstChild)){
40195
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, item.firstChild);
39862
40196
  }
39863
40197
  }
39864
40198
  // Remove empty right LI
39865
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(item)) {
39866
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(item);
40199
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item)) {
40200
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(item);
39867
40201
  }
39868
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(rightSibling)) {
39869
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(rightSibling);
40202
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
40203
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
39870
40204
  }
39871
40205
  }
39872
40206
  }
40207
+ /**
40208
+ * A plain space the deletion leaves at an edge of the block, before a line
40209
+ * break or next to another space isn't shown, and the browser drops it when
40210
+ * the next char is typed. It becomes non-breaking, as in the browsers' own
40211
+ * delete and in Backspace without a selection (#1522)
40212
+ */ __keepSpacesVisible(fake) {
40213
+ var _a;
40214
+ const { jodit } = this;
40215
+ const block = (_a = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor)) !== null && _a !== void 0 ? _a : jodit.editor;
40216
+ if (KEEPS_SPACES.has(jodit.ew.getComputedStyle(block).whiteSpace)) {
40217
+ return;
40218
+ }
40219
+ const before = this.__findNeighbor(fake, true, block);
40220
+ const after = this.__findNeighbor(fake, false, block);
40221
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(before) && hidesSpace(after, /^ /)) {
40222
+ before.nodeValue = before.nodeValue.replace(/ +$/, (spaces)=>_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces.length));
40223
+ }
40224
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(after) && hidesSpace(before, / $/)) {
40225
+ after.nodeValue = after.nodeValue.replace(/^ +/, (spaces)=>_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces.length));
40226
+ }
40227
+ }
40228
+ /**
40229
+ * The text, line break or other element next to the caret in its block,
40230
+ * looking inside inline elements
40231
+ */ __findNeighbor(fake, left, block) {
40232
+ return (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.call)(left ? _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.prev : _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.next, fake, (node)=>{
40233
+ var _a;
40234
+ return _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) ? (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.trimInv)((_a = node.nodeValue) !== null && _a !== void 0 ? _a : '').length > 0 : !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isComment(node) && !(_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(node) && node.firstChild);
40235
+ }, block);
40236
+ }
39873
40237
  /**
39874
40238
  * If left sibling is list - return last leaf
39875
40239
  */ __defineRightLeftBox(leftSibling) {
39876
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(leftSibling)) {
40240
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(leftSibling)) {
39877
40241
  return leftSibling;
39878
40242
  }
39879
40243
  let lastLeaf = leftSibling.lastElementChild;
39880
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(lastLeaf)) {
40244
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(lastLeaf)) {
39881
40245
  lastLeaf = this.j.createInside.element('li');
39882
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, lastLeaf);
40246
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, lastLeaf);
39883
40247
  }
39884
40248
  return lastLeaf;
39885
40249
  }
@@ -39887,22 +40251,22 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39887
40251
  * Add BR in the empty block left at the caret
39888
40252
  */ __addBrInEmptyBlock(fake, range) {
39889
40253
  const jodit = this.j;
39890
- if (fake.isConnected && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
40254
+ if (fake.isConnected && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
39891
40255
  const br = jodit.createInside.element('br');
39892
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.after(fake, br);
40256
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, br);
39893
40257
  range.setStartBefore(br);
39894
40258
  range.collapse(true);
39895
40259
  }
39896
40260
  }
39897
40261
  __moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
39898
40262
  var _a;
39899
- if (!leftSibling || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(leftSibling)) {
39900
- const root = (_a = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock, jodit.editor)) !== null && _a !== void 0 ? _a : jodit.editor;
39901
- const leftText = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.prev(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isText, root);
40263
+ if (!leftSibling || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(leftSibling)) {
40264
+ const root = (_a = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor)) !== null && _a !== void 0 ? _a : jodit.editor;
40265
+ const leftText = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.prev(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText, root);
39902
40266
  if (leftText) {
39903
40267
  range.setStartAfter(leftText);
39904
40268
  range.collapse(true);
39905
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(fake);
40269
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
39906
40270
  }
39907
40271
  }
39908
40272
  }
@@ -39910,7 +40274,7 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
39910
40274
  deleteCommand.requires = [
39911
40275
  'backspace'
39912
40276
  ];
39913
- _core_global_js__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('deleteCommand', deleteCommand);
40277
+ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('deleteCommand', deleteCommand);
39914
40278
 
39915
40279
 
39916
40280
  /***/ }),
@@ -51119,7 +51483,7 @@ const key = 'table_processor_observer-resize';
51119
51483
  /**
51120
51484
  * Click on resize handle
51121
51485
  */ onHandleMouseDown(event) {
51122
- if (this.j.isLocked) {
51486
+ if (this.j.isLocked || this.j.o.readonly) {
51123
51487
  return;
51124
51488
  }
51125
51489
  this.drag = true;
@@ -51154,10 +51518,15 @@ const key = 'table_processor_observer-resize';
51154
51518
  let box;
51155
51519
  this.minX = 0;
51156
51520
  this.maxX = 1000000;
51521
+ this.startTableWidth = this.workTable.offsetWidth;
51157
51522
  if (this.wholeTable != null) {
51158
- const tableBox = this.workTable.parentNode.getBoundingClientRect();
51523
+ const parent = this.workTable.parentNode;
51524
+ const tableBox = parent.getBoundingClientRect();
51159
51525
  this.minX = tableBox.left;
51160
51526
  this.maxX = this.minX + tableBox.width;
51527
+ const side = this.isRTL ? 'marginRight' : 'marginLeft';
51528
+ this.startParentWidth = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.getContentWidth)(parent, this.j.ew);
51529
+ this.startMargin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
51161
51530
  } else {
51162
51531
  // find maximum columns
51163
51532
  const coordinate = this.module.formalCoordinate(this.workTable, this.workCell, true);
@@ -51171,6 +51540,17 @@ const key = 'table_processor_observer-resize';
51171
51540
  this.maxX = Math.min(box.left + box.width - _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NEARBY / 2, this.maxX);
51172
51541
  }
51173
51542
  });
51543
+ const matrix = this.module.formalMatrix(this.workTable);
51544
+ this.startWidths = this.resizedColumns().map((column)=>{
51545
+ const cells = matrix.map((row)=>row[column]);
51546
+ const index = cells.findIndex((td)=>td.colSpan === 1 || cells.length === 1);
51547
+ const cell = cells[index];
51548
+ return [
51549
+ cell,
51550
+ cell ? cell.offsetWidth : 0,
51551
+ cells.slice(Math.max(index, 0) + 1)
51552
+ ];
51553
+ });
51174
51554
  }
51175
51555
  return false;
51176
51556
  }
@@ -51199,8 +51579,11 @@ const key = 'table_processor_observer-resize';
51199
51579
  x = this.maxX;
51200
51580
  }
51201
51581
  this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
51202
- this.restoreStyles();
51203
- this.resizeColumnsOrTable();
51582
+ if (this.wholeTable == null) {
51583
+ this.setColumnWidths();
51584
+ } else {
51585
+ this.resizeTable();
51586
+ }
51204
51587
  const tableBox = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.offset)(this.workTable, this.j, this.j.ed);
51205
51588
  Object.assign(this.resizeHandler.style, {
51206
51589
  left: this.startLeft + this.columnEdge() - this.startEdge + 'px',
@@ -51313,21 +51696,49 @@ const key = 'table_processor_observer-resize';
51313
51696
  };
51314
51697
  this.scrollFrame = this.j.async.requestAnimationFrame(scroll);
51315
51698
  }
51699
+ /**
51700
+ * The two columns a column drag resizes: the work cell's last, and the
51701
+ * next cell's first
51702
+ */ resizedColumns() {
51703
+ const nextTD = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.call)(this.isRTL ? _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.prev : _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.next, this.workCell, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, this.workCell.parentNode);
51704
+ return [
51705
+ this.module.formalCoordinate(this.workTable, this.workCell, true)[1],
51706
+ this.module.formalCoordinate(this.workTable, nextTD)[1]
51707
+ ];
51708
+ }
51316
51709
  /**
51317
51710
  * Resize only one column
51318
51711
  */ resizeColumns() {
51319
51712
  const delta = this.resizeDelta;
51320
51713
  const marked = [];
51321
51714
  const tableModule = this.module;
51322
- tableModule.setColumnWidthByDelta(this.workTable, tableModule.formalCoordinate(this.workTable, this.workCell, true)[1], delta, true, marked);
51323
- const nextTD = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.call)(this.isRTL ? _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.prev : _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.next, this.workCell, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, this.workCell.parentNode);
51324
- tableModule.setColumnWidthByDelta(this.workTable, tableModule.formalCoordinate(this.workTable, nextTD)[1], -delta, false, marked);
51715
+ const [column, nextColumn] = this.resizedColumns();
51716
+ tableModule.setColumnWidthByDelta(this.workTable, column, delta, true, marked);
51717
+ tableModule.setColumnWidthByDelta(this.workTable, nextColumn, -delta, false, marked);
51718
+ }
51719
+ /**
51720
+ * Sets the widths `resizeColumns` would while the handle is dragged, from
51721
+ * the widths the drag started with, so that a move doesn't put back every
51722
+ * cell's style and lay the table out again to measure them
51723
+ */ setColumnWidths() {
51724
+ this.startWidths.forEach(([cell, width, below], index)=>{
51725
+ const delta = index ? -this.resizeDelta : this.resizeDelta;
51726
+ if (cell) {
51727
+ (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(cell, 'width', ((width + delta) / this.startTableWidth * 100).toFixed(_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.ACCURACY) + '%');
51728
+ }
51729
+ below.forEach((td)=>{
51730
+ td.style.removeProperty('width');
51731
+ if (!(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(td, 'style')) {
51732
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(td, 'style', null);
51733
+ }
51734
+ });
51735
+ });
51325
51736
  }
51326
51737
  /**
51327
51738
  * Resize whole table
51328
51739
  */ resizeTable() {
51329
51740
  const delta = this.resizeDelta * (this.isRTL ? -1 : 1);
51330
- const width = this.workTable.offsetWidth, parentWidth = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.getContentWidth)(this.workTable.parentNode, this.j.ew);
51741
+ const width = this.startTableWidth, parentWidth = this.startParentWidth;
51331
51742
  // for RTL use mirror logic
51332
51743
  const rightSide = !this.wholeTable;
51333
51744
  const needChangeWidth = this.isRTL ? !rightSide : rightSide;
@@ -51336,10 +51747,9 @@ const key = 'table_processor_observer-resize';
51336
51747
  (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(this.workTable, 'width', (width + delta) / parentWidth * 100 + '%');
51337
51748
  } else {
51338
51749
  const side = this.isRTL ? 'marginRight' : 'marginLeft';
51339
- const margin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
51340
51750
  (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(this.workTable, {
51341
51751
  width: (width - delta) / parentWidth * 100 + '%',
51342
- [side]: (margin + delta) / parentWidth * 100 + '%'
51752
+ [side]: (this.startMargin + delta) / parentWidth * 100 + '%'
51343
51753
  });
51344
51754
  }
51345
51755
  }
@@ -51415,9 +51825,10 @@ const key = 'table_processor_observer-resize';
51415
51825
  if (!editor.o.tableAllowCellResize) {
51416
51826
  return;
51417
51827
  }
51418
- editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', ()=>{
51828
+ const observeTables = ()=>{
51419
51829
  ;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', editor.editor).forEach(this.observe);
51420
- }).on(this.j.ow, 'scroll.resize-cells', ()=>{
51830
+ };
51831
+ editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', observeTables).on(this.j.ow, 'scroll.resize-cells', ()=>{
51421
51832
  if (!this.drag || this.workRow) {
51422
51833
  return;
51423
51834
  }
@@ -51433,6 +51844,8 @@ const key = 'table_processor_observer-resize';
51433
51844
  tableModule.normalizeTable(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(td, 'table', editor.editor));
51434
51845
  });
51435
51846
  });
51847
+ // None of those events comes with the editor's starting value
51848
+ observeTables();
51436
51849
  }
51437
51850
  /**
51438
51851
  * Add to every Table listeners
@@ -51446,7 +51859,9 @@ const key = 'table_processor_observer-resize';
51446
51859
  this.hideResizeHandle();
51447
51860
  }
51448
51861
  }).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle((event)=>{
51449
- if (this.j.isLocked) {
51862
+ // A drag from a cell isn't a resize, and the handle on
51863
+ // a border it passes would take its moves (#1778)
51864
+ if (this.j.isLocked || this.j.o.readonly || event.buttons) {
51450
51865
  return;
51451
51866
  }
51452
51867
  const cell = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.up(event.target, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, table);
@@ -51488,10 +51903,21 @@ const key = 'table_processor_observer-resize';
51488
51903
  this.startX = 0;
51489
51904
  /**
51490
51905
  * The table's and its cells' styles as a column drag started, put back
51491
- * before each new width
51906
+ * as it ends, before the final widths
51492
51907
  */ this.startStyles = [];
51493
51908
  this.startLeft = 0;
51494
51909
  this.startEdge = 0;
51910
+ /**
51911
+ * For each of the two columns a drag resizes, the cell whose width
51912
+ * `setColumnWidthByDelta` sets, with its width as the drag started, and
51913
+ * the cells below it, whose widths it clears
51914
+ */ this.startWidths = [];
51915
+ /**
51916
+ * The table's width as the drag started, and for a drag of its edge, the
51917
+ * width inside what holds it and its margin on that side
51918
+ */ this.startTableWidth = 0;
51919
+ this.startParentWidth = 0;
51920
+ this.startMargin = 0;
51495
51921
  /**
51496
51922
  * The row whose height the handle sets, or null while it sets a width
51497
51923
  */ this.workRow = null;
@@ -53333,7 +53759,6 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelection
53333
53759
 
53334
53760
 
53335
53761
  const key = 'table_processor_observer';
53336
- const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
53337
53762
  class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
53338
53763
  /**
53339
53764
  * Shortcut for Jodit.modules.Table
@@ -53348,6 +53773,8 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53348
53773
  // move the caret, as table-keyboard-navigation's do
53349
53774
  .on('keydown', this.__onKeyDown, {
53350
53775
  top: true
53776
+ }).on('clickEditor', this.__onClickAfterDrag, {
53777
+ top: true
53351
53778
  }).on('keydown.select-cells', (event)=>{
53352
53779
  if (event.key === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
53353
53780
  this.unselectCells();
@@ -53467,18 +53894,36 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53467
53894
  }
53468
53895
  this.__isSelectionMode = true;
53469
53896
  this.__selectedCell = cell;
53897
+ this.__movedTo = cell;
53470
53898
  this.__tableModule.addSelection(cell);
53471
- this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', // Don't use decorator because need clear label on mouseup
53472
- this.j.async.throttle(this.__onMove.bind(this, table), {
53473
- label: MOUSE_MOVE_LABEL,
53474
- timeout: this.j.defaultTimeout / 2
53475
- })).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
53899
+ this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', this.__onMove.bind(this, table)).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
53900
+ new Set([
53901
+ this.j.ew,
53902
+ this.j.ow
53903
+ ]).forEach((win)=>this.j.e.on(win, 'mouseup.select-cells touchend.select-cells', this.__onRelease.bind(this, table)));
53476
53904
  return false;
53477
53905
  }
53478
53906
  onOutsideClick() {
53479
53907
  this.__selectedCell = null;
53480
53908
  this.__onRemoveSelection();
53481
53909
  }
53910
+ onMouseDown() {
53911
+ this.__keepMarks = false;
53912
+ }
53913
+ /**
53914
+ * The click that ends a drag let go outside the table, and inside the
53915
+ * editor, lands on the editor. Taken on, it would unmark the cells and
53916
+ * close their popup. As for the click on a row after a drag over the
53917
+ * cells, the browser's own selection from the drag goes
53918
+ */ __onClickAfterDrag() {
53919
+ var _a;
53920
+ if (this.__keepMarks) {
53921
+ this.__keepMarks = false;
53922
+ (_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
53923
+ this.j.e.stopPropagation('clickEditor');
53924
+ return false;
53925
+ }
53926
+ }
53482
53927
  onChange() {
53483
53928
  if (!this.j.isLocked && !this.__isSelectionMode) {
53484
53929
  this.__onRemoveSelection();
@@ -53497,16 +53942,20 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53497
53942
  // Inside Shadow DOM `document.elementFromPoint` returns the shadow
53498
53943
  // host, so the lookup must start from the shadow root
53499
53944
  const node = ((_a = this.j.o.shadowRoot) !== null && _a !== void 0 ? _a : this.j.ed).elementFromPoint(e.clientX, e.clientY);
53500
- if (!node) {
53501
- return;
53502
- }
53503
- const cell = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, [
53945
+ const cell = node && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, [
53504
53946
  'td',
53505
53947
  'th'
53506
53948
  ], table);
53507
53949
  if (!cell || !this.__selectedCell) {
53508
53950
  return;
53509
53951
  }
53952
+ // The marks change only when the mouse goes into another cell, and then
53953
+ // at once rather than throttled, as the browser's own selection from
53954
+ // the drag shows in the cells between until they do (#1778)
53955
+ if (cell === this.__movedTo) {
53956
+ return;
53957
+ }
53958
+ this.__movedTo = cell;
53510
53959
  if (cell !== this.__selectedCell) {
53511
53960
  this.j.lock(key);
53512
53961
  }
@@ -53543,7 +53992,7 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53543
53992
  /**
53544
53993
  * Stop a selection process
53545
53994
  */ __onStopSelection(table, e) {
53546
- var _a, _b, _c;
53995
+ var _a;
53547
53996
  if (!this.__selectedCell) {
53548
53997
  return;
53549
53998
  }
@@ -53566,11 +54015,34 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53566
54015
  if (ownTable && ownTable !== table) {
53567
54016
  return; // Nested tables
53568
54017
  }
53569
- const bound = this.__tableModule.getSelectedBound(table, [
54018
+ this.__showCellsPopup(table, [
53570
54019
  cell,
53571
54020
  this.__selectedCell
53572
- ]), box = this.__tableModule.formalMatrix(table);
53573
- const max = (_b = box[bound[1][0]]) === null || _b === void 0 ? void 0 : _b[bound[1][1]], min = (_c = box[bound[0][0]]) === null || _c === void 0 ? void 0 : _c[bound[0][1]];
54021
+ ]);
54022
+ this.__stopListening();
54023
+ }
54024
+ /**
54025
+ * A drag let go outside the table doesn't reach the table's `mouseup`, so
54026
+ * the window's ends it, leaving the cells marked as they were (#1774)
54027
+ */ __onRelease(table, e) {
54028
+ if (this.__isSelectionMode) {
54029
+ this.__isSelectionMode = false;
54030
+ if (!this.j.isLockedNotBy(key)) {
54031
+ this.j.unlock();
54032
+ }
54033
+ const cells = this.__tableModule.getAllSelectedCells();
54034
+ // One let go outside the editor clicks outside it, which unmarks them
54035
+ if (cells.length > 1 && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(this.j.editor, e.target)) {
54036
+ this.__keepMarks = true;
54037
+ this.__showCellsPopup(table, cells);
54038
+ }
54039
+ }
54040
+ this.__stopListening();
54041
+ }
54042
+ __showCellsPopup(table, cells) {
54043
+ var _a, _b;
54044
+ const bound = this.__tableModule.getSelectedBound(table, cells), box = this.__tableModule.formalMatrix(table);
54045
+ const max = (_a = box[bound[1][0]]) === null || _a === void 0 ? void 0 : _a[bound[1][1]], min = (_b = box[bound[0][0]]) === null || _b === void 0 ? void 0 : _b[bound[0][1]];
53574
54046
  // `getSelectedBound` keeps its `Infinity` sentinel when none of the
53575
54047
  // selected cells belong to this table's matrix — e.g. after a
53576
54048
  // drag-and-drop that moved/removed the cells, leaving a stale anchor and
@@ -53589,10 +54061,16 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53589
54061
  height: maxOffset.top - minOffset.top + maxOffset.height
53590
54062
  };
53591
54063
  }, 'cells');
53592
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', this.j.editor).forEach((table)=>{
54064
+ }
54065
+ __stopListening() {
54066
+ ;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', this.j.editor).forEach((table)=>{
53593
54067
  this.j.e.off(table, 'mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells');
53594
54068
  });
53595
- this.j.async.clearTimeout(MOUSE_MOVE_LABEL);
54069
+ new Set([
54070
+ this.j.ew,
54071
+ this.j.ow
54072
+ ]).forEach((win)=>this.j.e.off(win, 'mouseup.select-cells touchend.select-cells'));
54073
+ this.__movedTo = null;
53596
54074
  }
53597
54075
  /**
53598
54076
  * Remove selection for all cells
@@ -53763,7 +54241,8 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53763
54241
  }
53764
54242
  /** @override */ beforeDestruct(jodit) {
53765
54243
  this.__onRemoveSelection();
53766
- jodit.e.off('.select-cells').off('keydown', this.__onKeyDown);
54244
+ this.__stopListening();
54245
+ jodit.e.off('.select-cells').off('keydown', this.__onKeyDown).off('clickEditor', this.__onClickAfterDrag);
53767
54246
  }
53768
54247
  constructor(){
53769
54248
  super(...arguments);
@@ -53780,6 +54259,13 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
53780
54259
  /**
53781
54260
  * User is selecting cells now
53782
54261
  */ this.__isSelectionMode = false;
54262
+ /**
54263
+ * The cell the marks were last drawn to
54264
+ */ this.__movedTo = null;
54265
+ /**
54266
+ * A drag let go outside the table ends in a click on the editor, which
54267
+ * would unmark its cells
54268
+ */ this.__keepMarks = false;
53783
54269
  }
53784
54270
  }
53785
54271
  selectCells.requires = [
@@ -53797,6 +54283,15 @@ __decorate([
53797
54283
  __decorate([
53798
54284
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':outsideClick')
53799
54285
  ], selectCells.prototype, "onOutsideClick", null);
54286
+ __decorate([
54287
+ (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)([
54288
+ ':mousedown',
54289
+ ':touchstart'
54290
+ ])
54291
+ ], selectCells.prototype, "onMouseDown", null);
54292
+ __decorate([
54293
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
54294
+ ], selectCells.prototype, "__onClickAfterDrag", null);
53800
54295
  __decorate([
53801
54296
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':change')
53802
54297
  ], selectCells.prototype, "onChange", null);
@@ -53844,10 +54339,11 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
53844
54339
  /* harmony import */ var _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65478);
53845
54340
  /* harmony import */ var _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
53846
54341
  /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(580);
53847
- /* harmony import */ var _core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87058);
53848
- /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
53849
- /* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67510);
53850
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67215);
54342
+ /* harmony import */ var _core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4510);
54343
+ /* harmony import */ var _core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87058);
54344
+ /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50911);
54345
+ /* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67510);
54346
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(67215);
53851
54347
  /*!
53852
54348
  * Jodit Editor (https://xdsoft.net/jodit/)
53853
54349
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -53866,6 +54362,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
53866
54362
 
53867
54363
 
53868
54364
 
54365
+
53869
54366
  /**
53870
54367
  * A utility plugin that allows you to subscribe to a click/mousedown/touchstart/mouseup on an element in DOM order
53871
54368
  *
@@ -53876,22 +54373,27 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
53876
54373
  * console.log(img.src);
53877
54374
  * })
53878
54375
  * ```
53879
- */ class select extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
54376
+ */ class select extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_6__.Plugin {
53880
54377
  afterInit(jodit) {
53881
54378
  this.proxyEventsList.forEach((eventName)=>{
53882
54379
  jodit.e.on(eventName + '.select', this.onStartSelection);
53883
54380
  });
54381
+ jodit.e.on('dblclick', this.__onDblClickBesideRow, {
54382
+ top: true
54383
+ });
53884
54384
  }
53885
54385
  beforeDestruct(jodit) {
53886
54386
  this.proxyEventsList.forEach((eventName)=>{
53887
- jodit.e.on(eventName + '.select', this.onStartSelection);
54387
+ jodit.e.off(eventName + '.select', this.onStartSelection);
53888
54388
  });
54389
+ this.__endPressBesideRow();
54390
+ jodit.e.off('dblclick', this.__onDblClickBesideRow);
53889
54391
  }
53890
54392
  onStartSelection(e) {
53891
54393
  const { j } = this;
53892
54394
  let result, target = e.target;
53893
54395
  while(result === undefined && target && target !== j.editor){
53894
- result = j.e.fire((0,_core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_4__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
54396
+ result = j.e.fire((0,_core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_5__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
53895
54397
  target = target.parentElement;
53896
54398
  }
53897
54399
  if (e.type === 'click' && result === undefined && target === j.editor) {
@@ -53911,10 +54413,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
53911
54413
  }
53912
54414
  // Selecting the text of a popup input with the mouse and releasing
53913
54415
  // the button past the popup's edge is not a click outside of it.
53914
- if (pressed && _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.UIElement.closestElement(pressed, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.Popup)) {
54416
+ if (pressed && _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(pressed, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.Popup)) {
53915
54417
  return;
53916
54418
  }
53917
- const box = _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.UIElement.closestElement(node, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.Popup);
54419
+ const box = _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(node, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.Popup);
53918
54420
  if (!box) {
53919
54421
  this.j.e.fire('outsideClick', e);
53920
54422
  }
@@ -53960,6 +54462,127 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
53960
54462
  s.setCursorAfter(text);
53961
54463
  }
53962
54464
  }
54465
+ /**
54466
+ * The table row the mouse is to the right of
54467
+ */ __rowBeside(e) {
54468
+ var _a;
54469
+ const { j } = this;
54470
+ const target = e.target;
54471
+ if (j.o.readonly || e.button !== 0 || e.detail > 2 || !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isHTMLElement(target) || _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(target, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, j.editor)) {
54472
+ return null;
54473
+ }
54474
+ const table = (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(target.children).find((elm)=>{
54475
+ if (!_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(elm, 'table')) {
54476
+ return false;
54477
+ }
54478
+ const box = elm.getBoundingClientRect();
54479
+ return e.clientX >= box.right && e.clientY >= box.top && e.clientY < box.bottom;
54480
+ });
54481
+ const rows = table ? (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(table.rows).filter((row)=>row.cells.length) : [];
54482
+ if (!table || !rows.length) {
54483
+ return null;
54484
+ }
54485
+ const row = (_a = rows.find((row)=>e.clientY < row.getBoundingClientRect().bottom)) !== null && _a !== void 0 ? _a : rows[rows.length - 1];
54486
+ return {
54487
+ table,
54488
+ row
54489
+ };
54490
+ }
54491
+ /**
54492
+ * A press to the right of a table row puts the caret where Word's typing
54493
+ * goes from there: the start of the next row's first cell, or of the block
54494
+ * after the table for the last row (#1770). The browsers put it after the
54495
+ * table, whichever row it's beside, so typing starts a new line below it.
54496
+ * Their own press is stopped, as its drag would start after the table and
54497
+ * take in the rows below first
54498
+ */ onMouseDownBesideTableRow(e) {
54499
+ const { j } = this;
54500
+ const beside = this.__rowBeside(e);
54501
+ if (!beside) {
54502
+ return;
54503
+ }
54504
+ // A press before the last one was let go must not stack its listeners
54505
+ this.__endPressBesideRow();
54506
+ e.preventDefault();
54507
+ this.__putCaretBesideRow(beside.table, beside.row);
54508
+ this.__pressBesideRow = {
54509
+ row: beside.row,
54510
+ caret: j.s.range.cloneRange()
54511
+ };
54512
+ j.e.on(j.ew, 'mousemove', this.__onDragFromRow);
54513
+ new Set([
54514
+ j.ew,
54515
+ j.ow
54516
+ ]).forEach((win)=>j.e.on(win, 'mouseup', this.__onReleaseFromRow));
54517
+ }
54518
+ /**
54519
+ * A drag from beside a row selects from the end of the row to the mouse,
54520
+ * and back beside the row it's the caret again
54521
+ */ __onDragFromRow(e) {
54522
+ var _a, _b;
54523
+ const { s } = this.j;
54524
+ const press = this.__pressBesideRow;
54525
+ if (!press || !(e.buttons & 1)) {
54526
+ this.__endPressBesideRow();
54527
+ return;
54528
+ }
54529
+ if (((_a = this.__rowBeside(e)) === null || _a === void 0 ? void 0 : _a.row) === press.row) {
54530
+ if (!s.isCollapsed()) {
54531
+ s.selectRange(press.caret.cloneRange());
54532
+ }
54533
+ return;
54534
+ }
54535
+ const { cells } = press.row;
54536
+ const last = cells[cells.length - 1];
54537
+ if (s.insertCursorAtPoint(e.clientX, e.clientY)) {
54538
+ const { startContainer, startOffset } = s.range;
54539
+ (_b = s.sel) === null || _b === void 0 ? void 0 : _b.setBaseAndExtent(last, last.childNodes.length, startContainer, startOffset);
54540
+ }
54541
+ }
54542
+ /**
54543
+ * In iframe mode, a press in an editor without the focus puts the caret at
54544
+ * its end, so a release that selected nothing puts it back
54545
+ */ __onReleaseFromRow() {
54546
+ const press = this.__pressBesideRow;
54547
+ this.__endPressBesideRow();
54548
+ if (press && this.j.s.isCollapsed()) {
54549
+ this.j.s.selectRange(press.caret);
54550
+ }
54551
+ }
54552
+ __endPressBesideRow() {
54553
+ const { j } = this;
54554
+ this.__pressBesideRow = null;
54555
+ j.e.off(j.ew, 'mousemove', this.__onDragFromRow);
54556
+ new Set([
54557
+ j.ew,
54558
+ j.ow
54559
+ ]).forEach((win)=>j.e.off(win, 'mouseup', this.__onReleaseFromRow));
54560
+ }
54561
+ /**
54562
+ * A double click beside a row is two clicks there, so add-new-line,
54563
+ * which adds a line on a double click with a caret, doesn't see it
54564
+ */ __onDblClickBesideRow(e) {
54565
+ if (this.__rowBeside(e)) {
54566
+ this.j.e.stopPropagation('dblclick');
54567
+ return false;
54568
+ }
54569
+ }
54570
+ __putCaretBesideRow(table, row) {
54571
+ const { j } = this;
54572
+ const rows = (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(table.rows);
54573
+ const next = rows.slice(rows.indexOf(row) + 1).find((row)=>row.cells.length);
54574
+ let after = table.nextSibling;
54575
+ while(after && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmptyTextNode(after)){
54576
+ after = after.nextSibling;
54577
+ }
54578
+ if (next) {
54579
+ j.s.setCursorIn(next.cells[0], true);
54580
+ } else if (_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock(after) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(after, 'table') && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isContentEditable(after, j.editor)) {
54581
+ j.s.setCursorIn(after, true);
54582
+ } else {
54583
+ j.s.setCursorAfter(table);
54584
+ }
54585
+ }
53963
54586
  /**
53964
54587
  * Keep pending inline formatting after a click. Toggling Bold/Italic/etc. on
53965
54588
  * a collapsed cursor leaves empty marker elements with the caret inside; a
@@ -54025,6 +54648,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54025
54648
  * element and ends in another as a `click` on their common ancestor, so a
54026
54649
  * press inside a popup is remembered to tell such a drag from a real click.
54027
54650
  */ this.__pressTarget = null;
54651
+ /**
54652
+ * The row a press to its right was beside, and the caret it put there,
54653
+ * while the button is down
54654
+ */ this.__pressBesideRow = null;
54028
54655
  }
54029
54656
  }
54030
54657
  __decorate([
@@ -54054,6 +54681,18 @@ __decorate([
54054
54681
  ':click'
54055
54682
  ])
54056
54683
  ], select.prototype, "onClickRightOfNestedListItem", null);
54684
+ __decorate([
54685
+ (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':mousedown')
54686
+ ], select.prototype, "onMouseDownBesideTableRow", null);
54687
+ __decorate([
54688
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
54689
+ ], select.prototype, "__onDragFromRow", null);
54690
+ __decorate([
54691
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
54692
+ ], select.prototype, "__onReleaseFromRow", null);
54693
+ __decorate([
54694
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
54695
+ ], select.prototype, "__onDblClickBesideRow", null);
54057
54696
  __decorate([
54058
54697
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)([
54059
54698
  ':click'