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/es5/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
  */
@@ -2232,6 +2232,7 @@ __webpack_require__.r(__webpack_exports__);
2232
2232
  /* harmony export */ CLIPBOARD_ID: function() { return /* binding */ CLIPBOARD_ID; },
2233
2233
  /* harmony export */ COMMAND_KEYS: function() { return /* binding */ COMMAND_KEYS; },
2234
2234
  /* harmony export */ EMULATE_DBLCLICK_TIMEOUT: function() { return /* binding */ EMULATE_DBLCLICK_TIMEOUT; },
2235
+ /* harmony export */ ERROR_CODE_CONFLICT: function() { return /* binding */ ERROR_CODE_CONFLICT; },
2235
2236
  /* harmony export */ ES: function() { return /* binding */ ES; },
2236
2237
  /* harmony export */ FAT_MODE: function() { return /* binding */ FAT_MODE; },
2237
2238
  /* harmony export */ HOMEPAGE: function() { return /* binding */ HOMEPAGE; },
@@ -2333,7 +2334,7 @@ function _unsupported_iterable_to_array(o, minLen) {
2333
2334
  if (n === "Map" || n === "Set") return Array.from(n);
2334
2335
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
2335
2336
  }
2336
- var APP_VERSION = "4.19.4";
2337
+ var APP_VERSION = "4.19.6";
2337
2338
  // prettier-ignore
2338
2339
  var ES = "es5";
2339
2340
  var IS_ES_MODERN = false;
@@ -2485,6 +2486,8 @@ var EMULATE_DBLCLICK_TIMEOUT = 300;
2485
2486
  * ```
2486
2487
  */ var INSERT_ONLY_TEXT = 'insert_only_text';
2487
2488
  var SAFE_COUNT_CHANGE_CALL = 10;
2489
+ // Connector answer code for a file name that is already taken (same as the HTTP status)
2490
+ var ERROR_CODE_CONFLICT = 409;
2488
2491
  var IS_MAC = typeof globalWindow !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(globalWindow.navigator.platform);
2489
2492
  var KEY_ALIASES = {
2490
2493
  add: '+',
@@ -8363,6 +8366,7 @@ function isAdjacent(prev, item) {
8363
8366
  __webpack_require__.r(__webpack_exports__);
8364
8367
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8365
8368
  /* harmony export */ $$: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.$$; },
8369
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.AnswerError; },
8366
8370
  /* harmony export */ CamelCaseToKebabCase: function() { return /* reexport safe */ _string_index_js__WEBPACK_IMPORTED_MODULE_7__.CamelCaseToKebabCase; },
8367
8371
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.ConfigDeepFlatten; },
8368
8372
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.ConfigFlatten; },
@@ -8376,6 +8380,7 @@ __webpack_require__.r(__webpack_exports__);
8376
8380
  /* harmony export */ abort: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.abort; },
8377
8381
  /* harmony export */ alignElement: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.alignElement; },
8378
8382
  /* harmony export */ alreadyLoadedList: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.alreadyLoadedList; },
8383
+ /* harmony export */ answer: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.answer; },
8379
8384
  /* harmony export */ appendScriptAsync: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.appendScriptAsync; },
8380
8385
  /* harmony export */ appendStyleAsync: function() { return /* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_8__.appendStyleAsync; },
8381
8386
  /* harmony export */ applyStyles: function() { return /* reexport safe */ _html_index_js__WEBPACK_IMPORTED_MODULE_4__.applyStyles; },
@@ -10640,6 +10645,7 @@ var dataBind = function dataBind(elm, key, value) {
10640
10645
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10641
10646
 
10642
10647
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10648
+ /* harmony export */ answer: function() { return /* binding */ answer; },
10643
10649
  /* harmony export */ connection: function() { return /* binding */ connection; },
10644
10650
  /* harmony export */ error: function() { return /* binding */ error; },
10645
10651
  /* harmony export */ options: function() { return /* binding */ options; }
@@ -10663,6 +10669,9 @@ function connection(message) {
10663
10669
  function options(message) {
10664
10670
  return new _errors_index_js__WEBPACK_IMPORTED_MODULE_0__.OptionsError(message);
10665
10671
  }
10672
+ function answer(message, resp, code) {
10673
+ return new _errors_index_js__WEBPACK_IMPORTED_MODULE_0__.AnswerError(message, resp, code);
10674
+ }
10666
10675
 
10667
10676
 
10668
10677
  /***/ }),
@@ -10683,6 +10692,135 @@ function options(message) {
10683
10692
  }
10684
10693
 
10685
10694
 
10695
+ /***/ }),
10696
+
10697
+ /***/ 5311:
10698
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10699
+
10700
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10701
+ /* harmony export */ AnswerError: function() { return /* binding */ AnswerError; }
10702
+ /* harmony export */ });
10703
+ function _assert_this_initialized(self) {
10704
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10705
+ return self;
10706
+ }
10707
+ function _call_super(_this, derived, args) {
10708
+ derived = _get_prototype_of(derived);
10709
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10710
+ }
10711
+ function _class_call_check(instance, Constructor) {
10712
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
10713
+ }
10714
+ function _construct(Parent, args, Class) {
10715
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
10716
+ else {
10717
+ _construct = function construct(Parent, args, Class) {
10718
+ var a = [
10719
+ null
10720
+ ];
10721
+ a.push.apply(a, args);
10722
+ var Constructor = Function.bind.apply(Parent, a);
10723
+ var instance = new Constructor();
10724
+ if (Class) _set_prototype_of(instance, Class.prototype);
10725
+ return instance;
10726
+ };
10727
+ }
10728
+ return _construct.apply(null, arguments);
10729
+ }
10730
+ function _get_prototype_of(o) {
10731
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
10732
+ return o.__proto__ || Object.getPrototypeOf(o);
10733
+ };
10734
+ return _get_prototype_of(o);
10735
+ }
10736
+ function _inherits(subClass, superClass) {
10737
+ if (typeof superClass !== "function" && superClass !== null) {
10738
+ throw new TypeError("Super expression must either be null or a function");
10739
+ }
10740
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
10741
+ constructor: {
10742
+ value: subClass,
10743
+ writable: true,
10744
+ configurable: true
10745
+ }
10746
+ });
10747
+ if (superClass) _set_prototype_of(subClass, superClass);
10748
+ }
10749
+ function _is_native_function(fn) {
10750
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
10751
+ }
10752
+ function _is_native_reflect_construct() {
10753
+ try {
10754
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
10755
+ } catch (_) {}
10756
+ return (_is_native_reflect_construct = function() {
10757
+ return !!result;
10758
+ })();
10759
+ }
10760
+ function _possible_constructor_return(self, call) {
10761
+ if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
10762
+ return _assert_this_initialized(self);
10763
+ }
10764
+ function _set_prototype_of(o, p) {
10765
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
10766
+ o.__proto__ = p;
10767
+ return o;
10768
+ };
10769
+ return _set_prototype_of(o, p);
10770
+ }
10771
+ function _type_of(obj) {
10772
+ "@swc/helpers - typeof";
10773
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
10774
+ }
10775
+ function _wrap_native_super(Class) {
10776
+ var _cache = typeof Map === "function" ? new Map() : undefined;
10777
+ _wrap_native_super = function(Class) {
10778
+ if (Class === null || !_is_native_function(Class)) return Class;
10779
+ if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
10780
+ if (typeof _cache !== "undefined") {
10781
+ if (_cache.has(Class)) return _cache.get(Class);
10782
+ _cache.set(Class, Wrapper);
10783
+ }
10784
+ function Wrapper() {
10785
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
10786
+ }
10787
+ Wrapper.prototype = Object.create(Class.prototype, {
10788
+ constructor: {
10789
+ value: Wrapper,
10790
+ enumerable: false,
10791
+ writable: true,
10792
+ configurable: true
10793
+ }
10794
+ });
10795
+ return _set_prototype_of(Wrapper, Class);
10796
+ };
10797
+ return _wrap_native_super(Class);
10798
+ }
10799
+ /*!
10800
+ * Jodit Editor (https://xdsoft.net/jodit/)
10801
+ * Released under MIT see LICENSE.txt in the project root for license information.
10802
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
10803
+ */ /**
10804
+ * @module helpers/utils
10805
+ */ // A connector refused the request: the answer and its `data.code` stay reachable for the handler
10806
+ var AnswerError = /*#__PURE__*/ function(Error1) {
10807
+ "use strict";
10808
+ _inherits(AnswerError, Error1);
10809
+ function AnswerError(message, answer, code) {
10810
+ _class_call_check(this, AnswerError);
10811
+ var _this;
10812
+ _this = _call_super(this, AnswerError, [
10813
+ message
10814
+ ]);
10815
+ _this.answer = answer;
10816
+ _this.code = code;
10817
+ Object.setPrototypeOf(_this, AnswerError.prototype);
10818
+ return _this;
10819
+ }
10820
+ return AnswerError;
10821
+ }(_wrap_native_super(Error));
10822
+
10823
+
10686
10824
  /***/ }),
10687
10825
 
10688
10826
  /***/ 86397:
@@ -10815,13 +10953,15 @@ function _wrap_native_super(Class) {
10815
10953
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10816
10954
 
10817
10955
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10818
- /* harmony export */ ConnectionError: function() { return /* reexport safe */ _connection_error_js__WEBPACK_IMPORTED_MODULE_1__.ConnectionError; },
10819
- /* harmony export */ OptionsError: function() { return /* reexport safe */ _options_error_js__WEBPACK_IMPORTED_MODULE_2__.OptionsError; },
10956
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _answer_error_js__WEBPACK_IMPORTED_MODULE_1__.AnswerError; },
10957
+ /* harmony export */ ConnectionError: function() { return /* reexport safe */ _connection_error_js__WEBPACK_IMPORTED_MODULE_2__.ConnectionError; },
10958
+ /* harmony export */ OptionsError: function() { return /* reexport safe */ _options_error_js__WEBPACK_IMPORTED_MODULE_3__.OptionsError; },
10820
10959
  /* harmony export */ abort: function() { return /* reexport safe */ _abort_error_js__WEBPACK_IMPORTED_MODULE_0__.abort; }
10821
10960
  /* harmony export */ });
10822
10961
  /* harmony import */ var _abort_error_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93661);
10823
- /* harmony import */ var _connection_error_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86397);
10824
- /* harmony import */ var _options_error_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57865);
10962
+ /* harmony import */ var _answer_error_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5311);
10963
+ /* harmony import */ var _connection_error_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(86397);
10964
+ /* harmony import */ var _options_error_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57865);
10825
10965
  /*!
10826
10966
  * Jodit Editor (https://xdsoft.net/jodit/)
10827
10967
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -10833,6 +10973,7 @@ function _wrap_native_super(Class) {
10833
10973
 
10834
10974
 
10835
10975
 
10976
+
10836
10977
  /***/ }),
10837
10978
 
10838
10979
  /***/ 57865:
@@ -10965,9 +11106,11 @@ function _wrap_native_super(Class) {
10965
11106
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10966
11107
 
10967
11108
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11109
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.AnswerError; },
10968
11110
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.ConnectionError; },
10969
11111
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.OptionsError; },
10970
11112
  /* harmony export */ abort: function() { return /* reexport safe */ _errors_index_js__WEBPACK_IMPORTED_MODULE_1__.abort; },
11113
+ /* harmony export */ answer: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.answer; },
10971
11114
  /* harmony export */ connection: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.connection; },
10972
11115
  /* harmony export */ error: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.error; },
10973
11116
  /* harmony export */ options: function() { return /* reexport safe */ _error_js__WEBPACK_IMPORTED_MODULE_0__.options; }
@@ -11219,6 +11362,7 @@ var isPart = function isPart(node, part) {
11219
11362
 
11220
11363
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11221
11364
  /* harmony export */ $$: function() { return /* reexport safe */ _selector_js__WEBPACK_IMPORTED_MODULE_27__.$$; },
11365
+ /* harmony export */ AnswerError: function() { return /* reexport safe */ _error_index_js__WEBPACK_IMPORTED_MODULE_13__.AnswerError; },
11222
11366
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto_js__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
11223
11367
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto_js__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
11224
11368
  /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto_js__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
@@ -11230,6 +11374,7 @@ var isPart = function isPart(node, part) {
11230
11374
  /* harmony export */ abort: function() { return /* reexport safe */ _error_index_js__WEBPACK_IMPORTED_MODULE_13__.abort; },
11231
11375
  /* harmony export */ alignElement: function() { return /* reexport safe */ _align_js__WEBPACK_IMPORTED_MODULE_0__.alignElement; },
11232
11376
  /* harmony export */ alreadyLoadedList: function() { return /* reexport safe */ _append_script_js__WEBPACK_IMPORTED_MODULE_1__.alreadyLoadedList; },
11377
+ /* harmony export */ answer: function() { return /* reexport safe */ _error_index_js__WEBPACK_IMPORTED_MODULE_13__.answer; },
11233
11378
  /* harmony export */ appendScriptAsync: function() { return /* reexport safe */ _append_script_js__WEBPACK_IMPORTED_MODULE_1__.appendScriptAsync; },
11234
11379
  /* harmony export */ appendStyleAsync: function() { return /* reexport safe */ _append_script_js__WEBPACK_IMPORTED_MODULE_1__.appendStyleAsync; },
11235
11380
  /* harmony export */ assert: function() { return /* reexport safe */ _assert_js__WEBPACK_IMPORTED_MODULE_2__.assert; },
@@ -13556,6 +13701,26 @@ var Ajax = /*#__PURE__*/ function() {
13556
13701
  return this;
13557
13702
  }
13558
13703
  },
13704
+ {
13705
+ // 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
13706
+ key: "__hasAnswerEnvelope",
13707
+ value: function __hasAnswerEnvelope() {
13708
+ var xhr = this.xhr;
13709
+ if (xhr.responseType && xhr.responseType !== 'text') {
13710
+ return false;
13711
+ }
13712
+ var text = xhr.responseText;
13713
+ if (!text || text[0] !== '{') {
13714
+ return false;
13715
+ }
13716
+ try {
13717
+ var answer = JSON.parse(text);
13718
+ return (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isPlainObject)(answer) && 'success' in answer;
13719
+ } catch (_a) {
13720
+ return false;
13721
+ }
13722
+ }
13723
+ },
13559
13724
  {
13560
13725
  key: "send",
13561
13726
  value: function send() {
@@ -13600,7 +13765,7 @@ var Ajax = /*#__PURE__*/ function() {
13600
13765
  var _a, _b;
13601
13766
  (_b = (_a = _this.options).onProgress) === null || _b === void 0 ? void 0 : _b.call(_a, 10);
13602
13767
  if (xhr.readyState === XMLHttpRequest.DONE) {
13603
- if (o.successStatuses.includes(xhr.status)) {
13768
+ if (o.successStatuses.includes(xhr.status) || _this.__hasAnswerEnvelope()) {
13604
13769
  onResolve();
13605
13770
  } else if (xhr.statusText) {
13606
13771
  _this.__isFulfilled = true;
@@ -17730,9 +17895,11 @@ var WRAP_NODES = new Set([
17730
17895
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17731
17896
  /* harmony export */ ApplyStyle: function() { return /* binding */ ApplyStyle; }
17732
17897
  /* harmony export */ });
17733
- /* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63687);
17734
- /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77361);
17735
- /* harmony import */ var _transactions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55307);
17898
+ /* harmony import */ var _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2748);
17899
+ /* harmony import */ var _helpers_utils_selector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76078);
17900
+ /* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63687);
17901
+ /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77361);
17902
+ /* harmony import */ var _transactions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55307);
17736
17903
  /*!
17737
17904
  * Jodit Editor (https://xdsoft.net/jodit/)
17738
17905
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -17740,13 +17907,40 @@ var WRAP_NODES = new Set([
17740
17907
  */
17741
17908
 
17742
17909
 
17910
+
17911
+
17912
+ /**
17913
+ * Take a selected fragment out of the elements its style takes the place
17914
+ * of: one around it is split, so the fragment leaves it, and one in it is
17915
+ * unwrapped
17916
+ */ function takeOutOf(jodit, font, tags) {
17917
+ var range = jodit.s.createRange();
17918
+ var outer = _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
17919
+ while(outer){
17920
+ range.selectNodeContents(outer);
17921
+ range.setEndBefore(font);
17922
+ var before = range.cloneContents();
17923
+ range.selectNodeContents(outer);
17924
+ range.setStartAfter(font);
17925
+ // Split only when there's more in it, as a split leaves empty copies
17926
+ // of the elements between
17927
+ if (!_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(before) || !_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(range.cloneContents())) {
17928
+ (0,_api_index_js__WEBPACK_IMPORTED_MODULE_2__.extractSelectedPart)(outer, font, jodit);
17929
+ }
17930
+ _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(outer);
17931
+ outer = _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
17932
+ }
17933
+ ;(0,_helpers_utils_selector_js__WEBPACK_IMPORTED_MODULE_1__.$$)(tags.join(','), font).forEach(function(inner) {
17934
+ return _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(inner);
17935
+ });
17936
+ }
17743
17937
  /** @internal */ function ApplyStyle(jodit, cs) {
17744
- var _a;
17938
+ var _a, _b;
17745
17939
  var sel = jodit.s, editor = jodit.editor;
17746
17940
  (_a = editor.firstChild) === null || _a === void 0 ? void 0 : _a.normalize(); // FF fix for test "commandsTest - Exec command "bold"
17747
17941
  var fakes = sel.fakes();
17748
17942
  var collapsed = sel.isCollapsed();
17749
- var mode = _constants_js__WEBPACK_IMPORTED_MODULE_1__.INITIAL;
17943
+ var mode = _constants_js__WEBPACK_IMPORTED_MODULE_3__.INITIAL;
17750
17944
  try {
17751
17945
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
17752
17946
  try {
@@ -17754,16 +17948,19 @@ var WRAP_NODES = new Set([
17754
17948
  // temporary wrapper before the selection is restored in finally.
17755
17949
  for(var _iterator = sel.wrapInTagGen(fakes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
17756
17950
  var font = _step.value;
17951
+ if ((_b = cs.options.exclude) === null || _b === void 0 ? void 0 : _b.length) {
17952
+ takeOutOf(jodit, font, cs.options.exclude);
17953
+ }
17757
17954
  var state = {
17758
17955
  collapsed: collapsed,
17759
17956
  mode: mode,
17760
17957
  element: font,
17761
- next: _transactions_js__WEBPACK_IMPORTED_MODULE_2__.states.START,
17958
+ next: _transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.START,
17762
17959
  jodit: jodit,
17763
17960
  style: cs
17764
17961
  };
17765
- var 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);
17766
- while(!jodit.isInDestruct && machine.getState() !== _transactions_js__WEBPACK_IMPORTED_MODULE_2__.states.END){
17962
+ var 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);
17963
+ while(!jodit.isInDestruct && machine.getState() !== _transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.END){
17767
17964
  state = machine.dispatch('exec', state);
17768
17965
  }
17769
17966
  // The first selected fragment determines how later fragments toggle.
@@ -26499,6 +26696,20 @@ var FOCUS_EVENTS = new Set([
26499
26696
  'focusin',
26500
26697
  'focusout'
26501
26698
  ]);
26699
+ var EDITING_KEYS = new Set([
26700
+ _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER,
26701
+ _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_BACKSPACE,
26702
+ _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_DELETE
26703
+ ]);
26704
+ /**
26705
+ * Whether the input method (IME) is using the key. Safari fires the keydown
26706
+ * that ends a composition, as the Enter that confirms Japanese text, after
26707
+ * `compositionend`, and types Korean without one, so `isComposing` is false and
26708
+ * only keyCode 229 tells. Only the keys the editor turns into edits are held
26709
+ * back: the handlers that follow typing still see the rest.
26710
+ */ function isInputMethodKey(event) {
26711
+ return event.isComposing || event.keyCode === 229 && EDITING_KEYS.has(event.key);
26712
+ }
26502
26713
  var __defaultStyleDisplayKey = 'data-jodit-default-style-display';
26503
26714
  var __defaultClassesKey = 'data-jodit-default-classes';
26504
26715
  var NOEDIT = {
@@ -27789,7 +28000,7 @@ var Jodit = Jodit_1 = /*#__PURE__*/ function(ViewWithToolbar) {
27789
28000
  }
27790
28001
  }
27791
28002
  var w = _this.ew;
27792
- if (_instanceof(event, w.KeyboardEvent) && event.isComposing) {
28003
+ if (_instanceof(event, w.KeyboardEvent) && isInputMethodKey(event)) {
27793
28004
  return;
27794
28005
  }
27795
28006
  if (_this.e && _this.e.fire) {
@@ -37083,8 +37294,9 @@ var DataProvider = /*#__PURE__*/ function() {
37083
37294
  return promise.then(function(resp) {
37084
37295
  return resp.json();
37085
37296
  }).then(function(resp) {
37297
+ var _a;
37086
37298
  if (resp && !_this.isSuccess(resp)) {
37087
- throw new Error(_this.getMessage(resp));
37299
+ 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);
37088
37300
  }
37089
37301
  return resp;
37090
37302
  });
@@ -37301,10 +37513,11 @@ var DataProvider = /*#__PURE__*/ function() {
37301
37513
  var _this = this;
37302
37514
  (0,_core_helpers_utils_set_js__WEBPACK_IMPORTED_MODULE_8__.set)('options.getLocalFileByUrl.data.url', url, this);
37303
37515
  return this.get('getLocalFileByUrl').then(function(resp) {
37516
+ var _a;
37304
37517
  if (_this.isSuccess(resp)) {
37305
37518
  return resp.data;
37306
37519
  }
37307
- throw (0,_core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_7__.error)(_this.getMessage(resp));
37520
+ 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);
37308
37521
  });
37309
37522
  }
37310
37523
  },
@@ -44667,6 +44880,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.uploader = {
44667
44880
  defaultHandlerError: function defaultHandlerError(e) {
44668
44881
  this.j.message.error(e.message);
44669
44882
  },
44883
+ promptOnExists: true,
44884
+ promptOnExistsSuggestName: function promptOnExistsSuggestName(name) {
44885
+ return name;
44886
+ },
44670
44887
  contentType: function contentType(requestData) {
44671
44888
  return this.ow.FormData !== undefined && typeof requestData !== 'string' ? false : 'application/x-www-form-urlencoded; charset=UTF-8';
44672
44889
  }
@@ -44868,8 +45085,12 @@ function processOldBrowserDrag(self, cData, handlerSuccess, handlerError, onFina
44868
45085
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44869
45086
  /* harmony export */ sendFiles: function() { return /* binding */ sendFiles; }
44870
45087
  /* harmony export */ });
44871
- /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21537);
44872
- /* harmony import */ var _send_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71686);
45088
+ /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
45089
+ /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21537);
45090
+ /* harmony import */ var _core_traits_dlgs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70231);
45091
+ /* harmony import */ var _dialog_prompt_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36806);
45092
+ /* harmony import */ var _send_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71686);
45093
+ /* harmony import */ var _upload_error_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(76198);
44873
45094
  function _array_like_to_array(arr, len) {
44874
45095
  if (len == null || len > arr.length) len = arr.length;
44875
45096
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -44878,6 +45099,43 @@ function _array_like_to_array(arr, len) {
44878
45099
  function _array_with_holes(arr) {
44879
45100
  if (Array.isArray(arr)) return arr;
44880
45101
  }
45102
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
45103
+ try {
45104
+ var info = gen[key](arg);
45105
+ var value = info.value;
45106
+ } catch (error) {
45107
+ reject(error);
45108
+ return;
45109
+ }
45110
+ if (info.done) resolve(value);
45111
+ else Promise.resolve(value).then(_next, _throw);
45112
+ }
45113
+ function _async_to_generator(fn) {
45114
+ return function() {
45115
+ var self = this, args = arguments;
45116
+ return new Promise(function(resolve, reject) {
45117
+ var gen = fn.apply(self, args);
45118
+ function _next(value) {
45119
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
45120
+ }
45121
+ function _throw(err) {
45122
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45123
+ }
45124
+ _next(undefined);
45125
+ });
45126
+ };
45127
+ }
45128
+ function _define_property(obj, key, value) {
45129
+ if (key in obj) {
45130
+ Object.defineProperty(obj, key, {
45131
+ value: value,
45132
+ enumerable: true,
45133
+ configurable: true,
45134
+ writable: true
45135
+ });
45136
+ } else obj[key] = value;
45137
+ return obj;
45138
+ }
44881
45139
  function _iterable_to_array_limit(arr, i) {
44882
45140
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
44883
45141
  if (_i == null) return;
@@ -44905,9 +45163,123 @@ function _iterable_to_array_limit(arr, i) {
44905
45163
  function _non_iterable_rest() {
44906
45164
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
44907
45165
  }
45166
+ function _object_spread(target) {
45167
+ for(var i = 1; i < arguments.length; i++){
45168
+ var source = arguments[i] != null ? arguments[i] : {};
45169
+ var ownKeys = Object.keys(source);
45170
+ if (typeof Object.getOwnPropertySymbols === "function") {
45171
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
45172
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
45173
+ }));
45174
+ }
45175
+ ownKeys.forEach(function(key) {
45176
+ _define_property(target, key, source[key]);
45177
+ });
45178
+ }
45179
+ return target;
45180
+ }
44908
45181
  function _sliced_to_array(arr, i) {
44909
45182
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
44910
45183
  }
45184
+ function _ts_generator(thisArg, body) {
45185
+ var f, y, t, _ = {
45186
+ label: 0,
45187
+ sent: function() {
45188
+ if (t[0] & 1) throw t[1];
45189
+ return t[1];
45190
+ },
45191
+ trys: [],
45192
+ ops: []
45193
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
45194
+ return d(g, "next", {
45195
+ value: verb(0)
45196
+ }), d(g, "throw", {
45197
+ value: verb(1)
45198
+ }), d(g, "return", {
45199
+ value: verb(2)
45200
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
45201
+ value: function() {
45202
+ return this;
45203
+ }
45204
+ }), g;
45205
+ function verb(n) {
45206
+ return function(v) {
45207
+ return step([
45208
+ n,
45209
+ v
45210
+ ]);
45211
+ };
45212
+ }
45213
+ function step(op) {
45214
+ if (f) throw new TypeError("Generator is already executing.");
45215
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
45216
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45217
+ if (y = 0, t) op = [
45218
+ op[0] & 2,
45219
+ t.value
45220
+ ];
45221
+ switch(op[0]){
45222
+ case 0:
45223
+ case 1:
45224
+ t = op;
45225
+ break;
45226
+ case 4:
45227
+ _.label++;
45228
+ return {
45229
+ value: op[1],
45230
+ done: false
45231
+ };
45232
+ case 5:
45233
+ _.label++;
45234
+ y = op[1];
45235
+ op = [
45236
+ 0
45237
+ ];
45238
+ continue;
45239
+ case 7:
45240
+ op = _.ops.pop();
45241
+ _.trys.pop();
45242
+ continue;
45243
+ default:
45244
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
45245
+ _ = 0;
45246
+ continue;
45247
+ }
45248
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
45249
+ _.label = op[1];
45250
+ break;
45251
+ }
45252
+ if (op[0] === 6 && _.label < t[1]) {
45253
+ _.label = t[1];
45254
+ t = op;
45255
+ break;
45256
+ }
45257
+ if (t && _.label < t[2]) {
45258
+ _.label = t[2];
45259
+ _.ops.push(op);
45260
+ break;
45261
+ }
45262
+ if (t[2]) _.ops.pop();
45263
+ _.trys.pop();
45264
+ continue;
45265
+ }
45266
+ op = body.call(thisArg, _);
45267
+ } catch (e) {
45268
+ op = [
45269
+ 6,
45270
+ e
45271
+ ];
45272
+ y = 0;
45273
+ } finally{
45274
+ f = t = 0;
45275
+ }
45276
+ if (op[0] & 5) throw op[1];
45277
+ return {
45278
+ value: op[0] ? op[1] : void 0,
45279
+ done: true
45280
+ };
45281
+ }
45282
+ }
44911
45283
  function _unsupported_iterable_to_array(o, minLen) {
44912
45284
  if (!o) return;
44913
45285
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -44922,85 +45294,197 @@ function _unsupported_iterable_to_array(o, minLen) {
44922
45294
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
44923
45295
  */ ;
44924
45296
 
45297
+
45298
+
45299
+
45300
+
44925
45301
  /**
44926
45302
  * Send files to server
44927
- */ function sendFiles(uploader, files, handlerSuccess, handlerError, process) {
44928
- if (!files) {
44929
- return Promise.reject((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)('Need files'));
44930
- }
44931
- var o = uploader.o;
44932
- var fileList = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(files);
44933
- if (!fileList.length) {
44934
- return Promise.reject((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)('Need files'));
44935
- }
44936
- // Client-side validation hook — returning `false` aborts the upload.
44937
- // See https://github.com/xdan/jodit/issues/1329
44938
- if ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(o.beforeUpload)) {
44939
- if (o.beforeUpload.call(uploader, fileList) === false) {
44940
- var err = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)('Upload canceled');
44941
- (handlerError || o.defaultHandlerError).call(uploader, err);
44942
- return Promise.reject(err);
44943
- }
44944
- }
44945
- var promises = [];
44946
- if (o.insertImageAsBase64URI) {
44947
- readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
44948
- }
44949
- fileList = fileList.filter(function(a) {
44950
- return a;
44951
- });
44952
- if (fileList.length) {
44953
- var form = new FormData();
44954
- form.append(o.pathVariableName, uploader.path);
44955
- form.append('source', uploader.source);
44956
- var file;
44957
- for(var i = 0; i < fileList.length; i += 1){
44958
- file = fileList[i];
44959
- if (file) {
44960
- var hasRealExtension = /\.\w+$/.test(file.name);
44961
- var mime = file.type.match(/\/([a-z0-9]+)/i);
44962
- var extension = mime && mime[1] ? mime[1].toLowerCase() : '';
44963
- var newName = fileList[i].name || Math.random().toString().replace('.', '');
44964
- if (!hasRealExtension && extension) {
44965
- var extForReg = extension;
44966
- if ([
44967
- 'jpeg',
44968
- 'jpg'
44969
- ].includes(extForReg)) {
44970
- extForReg = 'jpeg|jpg';
45303
+ */ function sendFiles(uploader, files, handlerSuccess, handlerError, process, // Set when a refused upload is sent again: `beforeUpload` already had its say
45304
+ retryOf) {
45305
+ return _async_to_generator(function() {
45306
+ var o, fileList, extraData, plan, e, err, promises, form, file, i, hasRealExtension, mime, extension, newName, extForReg, reEnd, _o_processFileName_call, key, iFile, name;
45307
+ return _ts_generator(this, function(_state) {
45308
+ switch(_state.label){
45309
+ case 0:
45310
+ if (!files) {
45311
+ throw (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.error)('Need files');
44971
45312
  }
44972
- var reEnd = new RegExp('.(' + extForReg + ')$', 'i');
44973
- if (!reEnd.test(newName)) {
44974
- newName += '.' + extension;
45313
+ o = uploader.o;
45314
+ fileList = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.toArray)(files);
45315
+ if (!fileList.length) {
45316
+ throw (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.error)('Need files');
44975
45317
  }
44976
- }
44977
- var _o_processFileName_call = _sliced_to_array(o.processFileName.call(uploader, o.filesVariableName(i), fileList[i], newName), 3), key = _o_processFileName_call[0], iFile = _o_processFileName_call[1], name = _o_processFileName_call[2];
44978
- form.append(key, iFile, name);
45318
+ extraData = retryOf === null || retryOf === void 0 ? void 0 : retryOf.data;
45319
+ if (!(!retryOf && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(o.beforeUpload))) return [
45320
+ 3,
45321
+ 5
45322
+ ];
45323
+ _state.label = 1;
45324
+ case 1:
45325
+ _state.trys.push([
45326
+ 1,
45327
+ 3,
45328
+ ,
45329
+ 4
45330
+ ]);
45331
+ return [
45332
+ 4,
45333
+ o.beforeUpload.call(uploader, fileList)
45334
+ ];
45335
+ case 2:
45336
+ plan = _state.sent();
45337
+ return [
45338
+ 3,
45339
+ 4
45340
+ ];
45341
+ case 3:
45342
+ e = _state.sent();
45343
+ (handlerError || o.defaultHandlerError).call(uploader, e);
45344
+ throw e;
45345
+ case 4:
45346
+ if (plan === false) {
45347
+ err = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.error)('Upload canceled');
45348
+ (handlerError || o.defaultHandlerError).call(uploader, err);
45349
+ throw err;
45350
+ }
45351
+ if ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(plan)) {
45352
+ fileList = plan;
45353
+ } 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)) {
45354
+ fileList = plan.files;
45355
+ extraData = plan.data;
45356
+ }
45357
+ if (!fileList.length) {
45358
+ return [
45359
+ 2,
45360
+ []
45361
+ ];
45362
+ }
45363
+ _state.label = 5;
45364
+ case 5:
45365
+ promises = [];
45366
+ if (o.insertImageAsBase64URI) {
45367
+ readImagesWithReader(fileList, o.imagesExtensions, promises, uploader, handlerSuccess, o.defaultHandlerSuccess);
45368
+ }
45369
+ fileList = fileList.filter(function(a) {
45370
+ return a;
45371
+ });
45372
+ if (fileList.length) {
45373
+ form = new FormData();
45374
+ form.append(o.pathVariableName, uploader.path);
45375
+ form.append('source', uploader.source);
45376
+ ;
45377
+ for(i = 0; i < fileList.length; i += 1){
45378
+ file = fileList[i];
45379
+ if (file) {
45380
+ hasRealExtension = /\.\w+$/.test(file.name);
45381
+ mime = file.type.match(/\/([a-z0-9]+)/i);
45382
+ extension = mime && mime[1] ? mime[1].toLowerCase() : '';
45383
+ newName = fileList[i].name || Math.random().toString().replace('.', '');
45384
+ if (!hasRealExtension && extension) {
45385
+ extForReg = extension;
45386
+ if ([
45387
+ 'jpeg',
45388
+ 'jpg'
45389
+ ].includes(extForReg)) {
45390
+ extForReg = 'jpeg|jpg';
45391
+ }
45392
+ reEnd = new RegExp('.(' + extForReg + ')$', 'i');
45393
+ if (!reEnd.test(newName)) {
45394
+ newName += '.' + extension;
45395
+ }
45396
+ }
45397
+ _o_processFileName_call = _sliced_to_array(o.processFileName.call(uploader, o.filesVariableName(i), fileList[i], newName), 3), key = _o_processFileName_call[0], iFile = _o_processFileName_call[1], name = _o_processFileName_call[2];
45398
+ form.append(key, iFile, name);
45399
+ }
45400
+ }
45401
+ if (process) {
45402
+ process(form);
45403
+ }
45404
+ if (o.data && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(o.data)) {
45405
+ Object.keys(o.data).forEach(function(key) {
45406
+ form.append(key, o.data[key]);
45407
+ });
45408
+ }
45409
+ if (extraData) {
45410
+ Object.keys(extraData).forEach(function(key) {
45411
+ form.append(key, extraData[key]);
45412
+ });
45413
+ }
45414
+ o.prepareData.call(uploader, form);
45415
+ promises.push((0,_send_js__WEBPACK_IMPORTED_MODULE_4__.send)(uploader, form).then(function(resp) {
45416
+ if (o.isSuccess.call(uploader, resp)) {
45417
+ var handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
45418
+ handler.call(uploader, o.process.call(uploader, resp));
45419
+ return resp;
45420
+ }
45421
+ var err = new _upload_error_js__WEBPACK_IMPORTED_MODULE_5__.UploadError(o.getMessage.call(uploader, resp), resp, fileList, function(plan) {
45422
+ var _a;
45423
+ return sendFiles(uploader, (_a = plan === null || plan === void 0 ? void 0 : plan.files) !== null && _a !== void 0 ? _a : fileList, handlerSuccess, handlerError, process, {
45424
+ data: _object_spread({}, extraData, plan === null || plan === void 0 ? void 0 : plan.data)
45425
+ });
45426
+ });
45427
+ // A taken name is part of the upload, not a failure: ask for another one first
45428
+ if (err.code === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.ERROR_CODE_CONFLICT && o.promptOnExists) {
45429
+ return askAnotherName(uploader, err);
45430
+ }
45431
+ var handler1 = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
45432
+ handler1.call(uploader, err);
45433
+ return resp;
45434
+ }).then(function() {
45435
+ uploader.j.events && uploader.j.e.fire('filesWereUploaded');
45436
+ }));
45437
+ }
45438
+ return [
45439
+ 2,
45440
+ Promise.all(promises)
45441
+ ];
44979
45442
  }
44980
- }
44981
- if (process) {
44982
- process(form);
44983
- }
44984
- if (o.data && (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(o.data)) {
44985
- Object.keys(o.data).forEach(function(key) {
44986
- form.append(key, o.data[key]);
45443
+ });
45444
+ })();
45445
+ }
45446
+ function askAnotherName(uploader, err) {
45447
+ var files = err.files;
45448
+ // A batch is refused as a whole (the connector saved nothing) and the answer does not say which name is taken,
45449
+ // so the files go again one by one: the free ones are simply stored, the taken one answers 409 alone and gets its prompt
45450
+ if (files.length > 1) {
45451
+ return files.reduce(function(chain, file) {
45452
+ return chain.then(function() {
45453
+ return err.retry({
45454
+ files: [
45455
+ file
45456
+ ]
45457
+ });
44987
45458
  });
44988
- }
44989
- o.prepareData.call(uploader, form);
44990
- promises.push((0,_send_js__WEBPACK_IMPORTED_MODULE_1__.send)(uploader, form).then(function(resp) {
44991
- if (o.isSuccess.call(uploader, resp)) {
44992
- var handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
44993
- handler.call(uploader, o.process.call(uploader, resp));
44994
- return resp;
45459
+ }, Promise.resolve());
45460
+ }
45461
+ var _files = _sliced_to_array(files, 1), file = _files[0];
45462
+ var j = uploader.j, o = uploader.o;
45463
+ return new Promise(function(resolve) {
45464
+ var answered = false;
45465
+ // `Dlgs.prototype.dlg`: the uploader's view does not always carry the Dlgs trait
45466
+ var dialog = _dialog_prompt_js__WEBPACK_IMPORTED_MODULE_3__.Prompt.call(_core_traits_dlgs_js__WEBPACK_IMPORTED_MODULE_2__.Dlgs.prototype.dlg.call(j, {
45467
+ closeOnClickOverlay: true
45468
+ }), j.i18n(err.message), j.i18n('Rename'), function(newName) {
45469
+ newName = newName.trim();
45470
+ if (!newName) {
45471
+ return false;
44995
45472
  }
44996
- var handler1 = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
44997
- handler1.call(uploader, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.error)(o.getMessage.call(uploader, resp)));
44998
- return resp;
44999
- }).then(function() {
45000
- uploader.j.events && uploader.j.e.fire('filesWereUploaded');
45001
- }));
45002
- }
45003
- return Promise.all(promises);
45473
+ answered = true;
45474
+ resolve(err.retry({
45475
+ files: [
45476
+ new File([
45477
+ file
45478
+ ], newName, {
45479
+ type: file.type
45480
+ })
45481
+ ]
45482
+ }));
45483
+ }, j.i18n('Enter new name'), o.promptOnExistsSuggestName.call(uploader, file.name));
45484
+ dialog.e.on(dialog, 'afterClose', function() {
45485
+ !answered && resolve(undefined);
45486
+ });
45487
+ });
45004
45488
  }
45005
45489
  function readImagesWithReader(fileList, imagesExtensions, promises, uploader, handlerSuccess, defaultHandlerSuccess) {
45006
45490
  var _loop = function() {
@@ -45028,7 +45512,7 @@ function readImagesWithReader(fileList, imagesExtensions, promises, uploader, ha
45028
45512
  name
45029
45513
  ]
45030
45514
  };
45031
- var handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
45515
+ var handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handlerSuccess) ? handlerSuccess : defaultHandlerSuccess;
45032
45516
  handler.call(uploader, resp);
45033
45517
  resolve(resp);
45034
45518
  };
@@ -45145,6 +45629,95 @@ function send(uploader, data) {
45145
45629
  }
45146
45630
 
45147
45631
 
45632
+ /***/ }),
45633
+
45634
+ /***/ 76198:
45635
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
45636
+
45637
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45638
+ /* harmony export */ UploadError: function() { return /* binding */ UploadError; }
45639
+ /* harmony export */ });
45640
+ /* harmony import */ var _core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89890);
45641
+ function _assert_this_initialized(self) {
45642
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
45643
+ return self;
45644
+ }
45645
+ function _call_super(_this, derived, args) {
45646
+ derived = _get_prototype_of(derived);
45647
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
45648
+ }
45649
+ function _class_call_check(instance, Constructor) {
45650
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
45651
+ }
45652
+ function _get_prototype_of(o) {
45653
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
45654
+ return o.__proto__ || Object.getPrototypeOf(o);
45655
+ };
45656
+ return _get_prototype_of(o);
45657
+ }
45658
+ function _inherits(subClass, superClass) {
45659
+ if (typeof superClass !== "function" && superClass !== null) {
45660
+ throw new TypeError("Super expression must either be null or a function");
45661
+ }
45662
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
45663
+ constructor: {
45664
+ value: subClass,
45665
+ writable: true,
45666
+ configurable: true
45667
+ }
45668
+ });
45669
+ if (superClass) _set_prototype_of(subClass, superClass);
45670
+ }
45671
+ function _is_native_reflect_construct() {
45672
+ try {
45673
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
45674
+ } catch (_) {}
45675
+ return (_is_native_reflect_construct = function() {
45676
+ return !!result;
45677
+ })();
45678
+ }
45679
+ function _possible_constructor_return(self, call) {
45680
+ if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
45681
+ return _assert_this_initialized(self);
45682
+ }
45683
+ function _set_prototype_of(o, p) {
45684
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
45685
+ o.__proto__ = p;
45686
+ return o;
45687
+ };
45688
+ return _set_prototype_of(o, p);
45689
+ }
45690
+ function _type_of(obj) {
45691
+ "@swc/helpers - typeof";
45692
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
45693
+ }
45694
+ /*!
45695
+ * Jodit Editor (https://xdsoft.net/jodit/)
45696
+ * Released under MIT see LICENSE.txt in the project root for license information.
45697
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
45698
+ */ ;
45699
+ // The connector refused these files: the handler can change the request and send it again
45700
+ var UploadError = /*#__PURE__*/ function(AnswerError) {
45701
+ "use strict";
45702
+ _inherits(UploadError, AnswerError);
45703
+ function UploadError(message, answer, files, retry) {
45704
+ _class_call_check(this, UploadError);
45705
+ var _this;
45706
+ var _a;
45707
+ _this = _call_super(this, UploadError, [
45708
+ message,
45709
+ answer,
45710
+ (_a = answer.data) === null || _a === void 0 ? void 0 : _a.code
45711
+ ]);
45712
+ _this.files = files;
45713
+ _this.retry = retry;
45714
+ Object.setPrototypeOf(_this, UploadError.prototype);
45715
+ return _this;
45716
+ }
45717
+ return UploadError;
45718
+ }(_core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_0__.AnswerError);
45719
+
45720
+
45148
45721
  /***/ }),
45149
45722
 
45150
45723
  /***/ 57380:
@@ -45157,9 +45730,10 @@ function send(uploader, data) {
45157
45730
  /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82758);
45158
45731
  /* harmony import */ var _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
45159
45732
  /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
45160
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6441);
45161
- /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94122);
45162
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80536);
45733
+ /* harmony import */ var _core_helpers_utils_error_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89890);
45734
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6441);
45735
+ /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(94122);
45736
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80536);
45163
45737
  function _assert_this_initialized(self) {
45164
45738
  if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
45165
45739
  return self;
@@ -45258,6 +45832,7 @@ function _type_of(obj) {
45258
45832
 
45259
45833
 
45260
45834
 
45835
+
45261
45836
  var Uploader = /*#__PURE__*/ function(ViewComponent) {
45262
45837
  "use strict";
45263
45838
  _inherits(Uploader, ViewComponent);
@@ -45269,7 +45844,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45269
45844
  ]);
45270
45845
  _this.path = '';
45271
45846
  _this.source = 'default';
45272
- _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 : {}));
45847
+ _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 : {}));
45273
45848
  return _this;
45274
45849
  }
45275
45850
  _create_class(Uploader, [
@@ -45344,14 +45919,14 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45344
45919
  }
45345
45920
  };
45346
45921
  // send data on server
45347
- if (!_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_IE && (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(cData)) {
45348
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, cData.files, handlerSuccess, handlerError).finally(onFinally);
45922
+ if (!_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_IE && (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(cData)) {
45923
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, cData.files, handlerSuccess, handlerError).finally(onFinally);
45349
45924
  return false;
45350
45925
  }
45351
45926
  if (_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_IE && !_core_constants_js__WEBPACK_IMPORTED_MODULE_1__.IS_ES_NEXT) {
45352
- return (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.processOldBrowserDrag)(self, cData, handlerSuccess, handlerError, onFinally);
45927
+ return (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.processOldBrowserDrag)(self, cData, handlerSuccess, handlerError, onFinally);
45353
45928
  }
45354
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasItems)(cData)) {
45929
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasItems)(cData)) {
45355
45930
  var items = cData.items;
45356
45931
  for(i = 0; i < items.length; i += 1){
45357
45932
  if (items[i].kind === 'file' && items[i].type === 'image/png') {
@@ -45359,7 +45934,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45359
45934
  if (file) {
45360
45935
  var mime = file.type.match(/\/([a-z0-9]+)/i);
45361
45936
  extension = mime[1] ? mime[1].toLowerCase() : '';
45362
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, [
45937
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, [
45363
45938
  file
45364
45939
  ], handlerSuccess, handlerError, processData).finally(onFinally);
45365
45940
  }
@@ -45384,21 +45959,21 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45384
45959
  self.j.e.on(form, 'dragend dragover dragenter dragleave drop', function(e) {
45385
45960
  e.preventDefault();
45386
45961
  }).on(form, 'dragover', function(event) {
45387
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(event.dataTransfer) || (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasItems)(event.dataTransfer)) {
45962
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(event.dataTransfer) || (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasItems)(event.dataTransfer)) {
45388
45963
  form.classList.add('jodit_drag_hover');
45389
45964
  event.preventDefault();
45390
45965
  }
45391
45966
  }).on(form, 'dragend dragleave', function(event) {
45392
45967
  form.classList.remove('jodit_drag_hover');
45393
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(event.dataTransfer)) {
45968
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(event.dataTransfer)) {
45394
45969
  event.preventDefault();
45395
45970
  }
45396
45971
  }).on(form, 'drop', function(event) {
45397
45972
  form.classList.remove('jodit_drag_hover');
45398
- if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.hasFiles)(event.dataTransfer)) {
45973
+ if ((0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.hasFiles)(event.dataTransfer)) {
45399
45974
  event.preventDefault();
45400
45975
  event.stopImmediatePropagation();
45401
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, event.dataTransfer.files, handlerSuccess, handlerError).finally(onFinally);
45976
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, event.dataTransfer.files, handlerSuccess, handlerError).finally(onFinally);
45402
45977
  }
45403
45978
  });
45404
45979
  var inputFile = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.first(form, function(node) {
@@ -45407,7 +45982,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45407
45982
  });
45408
45983
  if (inputFile) {
45409
45984
  self.j.e.on(inputFile, 'change', function() {
45410
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(self, inputFile.files, handlerSuccess, handlerError).then(function() {
45985
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(self, inputFile.files, handlerSuccess, handlerError).then(function() {
45411
45986
  inputFile.value = '';
45412
45987
  if (!/safari/i.test(navigator.userAgent)) {
45413
45988
  inputFile.type = '';
@@ -45425,16 +46000,17 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45425
46000
  value: function uploadRemoteImage(url, handlerSuccess, handlerError) {
45426
46001
  var uploader = this, o = uploader.o;
45427
46002
  var handlerE = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isFunction)(handlerError) ? handlerError : o.defaultHandlerError;
45428
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.send)(uploader, {
46003
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.send)(uploader, {
45429
46004
  action: 'fileUploadRemote',
45430
46005
  url: url
45431
46006
  }).then(function(resp) {
46007
+ var _a;
45432
46008
  if (o.isSuccess.call(uploader, resp)) {
45433
46009
  var handler = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.isFunction)(handlerSuccess) ? handlerSuccess : o.defaultHandlerSuccess;
45434
46010
  handler.call(uploader, o.process.call(uploader, resp));
45435
46011
  return;
45436
46012
  }
45437
- handlerE.call(uploader, (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.error)(o.getMessage.call(uploader, resp)));
46013
+ 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));
45438
46014
  }).catch(function(e) {
45439
46015
  return handlerE.call(uploader, e);
45440
46016
  });
@@ -45445,7 +46021,23 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45445
46021
  value: function upload(files) {
45446
46022
  var _this = this;
45447
46023
  return this.async.promise(function(resolve, reject) {
45448
- (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.sendFiles)(_this, files, resolve, reject);
46024
+ var settled = false;
46025
+ var settle = function settle(end) {
46026
+ return function(value) {
46027
+ settled = true;
46028
+ end(value);
46029
+ };
46030
+ };
46031
+ (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.sendFiles)(_this, files, settle(resolve), settle(reject)).then(function() {
46032
+ // `beforeUpload` kept no file, so no handler ran
46033
+ if (!settled) {
46034
+ resolve({
46035
+ baseurl: '',
46036
+ files: [],
46037
+ isImages: []
46038
+ });
46039
+ }
46040
+ }, settle(reject));
45449
46041
  });
45450
46042
  }
45451
46043
  },
@@ -45453,7 +46045,7 @@ var Uploader = /*#__PURE__*/ function(ViewComponent) {
45453
46045
  key: "destruct",
45454
46046
  value: function destruct() {
45455
46047
  this.setStatus(_core_component_index_js__WEBPACK_IMPORTED_MODULE_0__.STATUSES.beforeDestruct);
45456
- var instances = _helpers_index_js__WEBPACK_IMPORTED_MODULE_5__.ajaxInstances.get(this);
46048
+ var instances = _helpers_index_js__WEBPACK_IMPORTED_MODULE_6__.ajaxInstances.get(this);
45457
46049
  if (instances) {
45458
46050
  instances.forEach(function(ajax) {
45459
46051
  try {
@@ -47892,6 +48484,13 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
47892
48484
  if (checkJoinBareText(jodit, fakeNode, backspace)) {
47893
48485
  return true;
47894
48486
  }
48487
+ // Old content can have an inline element round blocks beside the text:
48488
+ // moved inside them, the line joins the block as it would bare text
48489
+ // (#1781)
48490
+ var inline = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
48491
+ if (joinsBareText(jodit, edgeBlock(inline, backspace)) && moveInlineInside(inline, jodit.editor)) {
48492
+ return joinNeighbors(jodit, fakeNode, backspace, moved);
48493
+ }
47895
48494
  var nextBox = fakeNode, mainClosestBox = nextBox;
47896
48495
  // Find the main big closest element
47897
48496
  while(nextBox && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(nextBox, backspace) && nextBox.parentElement !== jodit.editor){
@@ -48199,9 +48798,7 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
48199
48798
  * in `<div>a|<p>b</p>c</div>` gives `<div>a|b<br>c</div>`
48200
48799
  */ function checkJoinBareText(jodit, fakeNode, backspace) {
48201
48800
  var block = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
48202
- 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(function(node) {
48203
- return _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
48204
- })) {
48801
+ if (!joinsBareText(jodit, block)) {
48205
48802
  return false;
48206
48803
  }
48207
48804
  var filter = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
@@ -48228,6 +48825,28 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
48228
48825
  jodit.s.setCursorBefore(fakeNode);
48229
48826
  return true;
48230
48827
  }
48828
+ /**
48829
+ * Whether a block joins the bare text beside it: not a list, a table or a
48830
+ * cell, and holding no block of its own
48831
+ */ function joinsBareText(jodit, block) {
48832
+ 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(function(node) {
48833
+ return _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
48834
+ });
48835
+ }
48836
+ /**
48837
+ * The block an inline element holds on its side facing the caret, through
48838
+ * the inline elements in it: the `<p>` of `<span><strong><p>…</p></strong></span>`
48839
+ */ function edgeBlock(node, backspace) {
48840
+ var _a;
48841
+ var edge = node;
48842
+ while(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(edge) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(edge)){
48843
+ var children = Array.from(edge.childNodes).filter(function(child) {
48844
+ return !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child);
48845
+ });
48846
+ edge = (_a = backspace ? children[children.length - 1] : children[0]) !== null && _a !== void 0 ? _a : null;
48847
+ }
48848
+ return edge === node ? null : edge;
48849
+ }
48231
48850
  function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
48232
48851
  // Process UL/LI/OL cases
48233
48852
  var siblingIsList = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
@@ -48664,7 +49283,6 @@ function isNotEditable(jodit, node) {
48664
49283
  if (!prn || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn)) {
48665
49284
  return false;
48666
49285
  }
48667
- var neighbor = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
48668
49286
  do {
48669
49287
  if (prn && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(prn)) {
48670
49288
  _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.after(prn, fakeNode);
@@ -48681,6 +49299,9 @@ function isNotEditable(jodit, node) {
48681
49299
  if (found && (0,_check_join_two_lists_js__WEBPACK_IMPORTED_MODULE_2__.checkJoinTwoLists)(jodit, fakeNode, backspace)) {
48682
49300
  return true;
48683
49301
  }
49302
+ // Looked for once the empty elements have gone, as the one beside the
49303
+ // caret can be in them: the `<br>` that Delete in `<p>|<br></p>` leaves
49304
+ var neighbor = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
48684
49305
  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)) {
48685
49306
  setCursorIn(neighbor, !backspace);
48686
49307
  } else {
@@ -49196,8 +49817,15 @@ function _object_spread(target) {
49196
49817
  }
49197
49818
  cssRules[key] = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(cssOptions[key]) ? cssOptions[key][0] : cssOptions[key];
49198
49819
  });
49820
+ var element = control.tags ? control.tags[0] : undefined;
49199
49821
  editor.s.commitStyle({
49200
- element: control.tags ? control.tags[0] : undefined
49822
+ element: element,
49823
+ // As in the browsers and Word, each takes the other's place
49824
+ exclude: element === 'sub' ? [
49825
+ 'sup'
49826
+ ] : element === 'sup' ? [
49827
+ 'sub'
49828
+ ] : []
49201
49829
  });
49202
49830
  editor.synchronizeValues();
49203
49831
  return false;
@@ -52319,11 +52947,12 @@ __webpack_require__.r(__webpack_exports__);
52319
52947
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
52320
52948
 
52321
52949
  /* unused harmony export deleteCommand */
52322
- /* harmony import */ var _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22732);
52323
- /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(580);
52324
- /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21537);
52325
- /* harmony import */ var _core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49055);
52326
- /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50911);
52950
+ /* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
52951
+ /* harmony import */ var _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22732);
52952
+ /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(580);
52953
+ /* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
52954
+ /* harmony import */ var _core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49055);
52955
+ /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
52327
52956
  function _array_like_to_array(arr, len) {
52328
52957
  if (len == null || len > arr.length) len = arr.length;
52329
52958
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -52490,6 +53119,7 @@ function _wrap_native_super(Class) {
52490
53119
 
52491
53120
 
52492
53121
 
53122
+
52493
53123
  var NOT_EMPTY_CONTENT_TAGS = new Set([
52494
53124
  'img',
52495
53125
  'table',
@@ -52497,6 +53127,18 @@ var NOT_EMPTY_CONTENT_TAGS = new Set([
52497
53127
  'iframe',
52498
53128
  'hr'
52499
53129
  ]);
53130
+ var KEEPS_SPACES = new Set([
53131
+ 'pre',
53132
+ 'pre-wrap',
53133
+ 'break-spaces'
53134
+ ]);
53135
+ /**
53136
+ * A plain space beside this neighbor isn't shown: there is none, or it's a
53137
+ * line break, a block or text starting (or ending) with a plain space
53138
+ */ function hidesSpace(neighbor, edge) {
53139
+ var _a;
53140
+ 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 : '');
53141
+ }
52500
53142
  var deleteCommand = /*#__PURE__*/ function(Plugin) {
52501
53143
  "use strict";
52502
53144
  _inherits(deleteCommand, Plugin);
@@ -52534,13 +53176,13 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52534
53176
  value: function __afterDeleteCommand() {
52535
53177
  var jodit = this.j;
52536
53178
  var current = jodit.s.current();
52537
- if (current && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(current.firstChild, 'br')) {
53179
+ if (current && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(current.firstChild, 'br')) {
52538
53180
  jodit.s.removeNode(current.firstChild);
52539
53181
  }
52540
- 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, function(node) {
52541
- return _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS);
52542
- }) && (!current || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, 'table', jodit.editor))) {
52543
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.detach(jodit.editor);
53182
+ 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, function(node) {
53183
+ return _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS);
53184
+ }) && (!current || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, 'table', jodit.editor))) {
53185
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(jodit.editor);
52544
53186
  var node = jodit.s.setCursorIn(jodit.editor);
52545
53187
  jodit.s.removeNode(node);
52546
53188
  }
@@ -52563,14 +53205,15 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52563
53205
  range.deleteContents();
52564
53206
  var fake = jodit.createInside.fake();
52565
53207
  range.insertNode(fake);
52566
- var leftSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(fake, true);
52567
- var rightSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(fake, false);
53208
+ var leftSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(fake, true);
53209
+ var rightSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(fake, false);
52568
53210
  this.__moveContentInLeftSibling(fake, leftSibling, rightSibling);
53211
+ this.__keepSpacesVisible(fake);
52569
53212
  range.setStartBefore(fake);
52570
53213
  range.collapse(true);
52571
53214
  this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
52572
53215
  this.__addBrInEmptyBlock(fake, range);
52573
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(fake);
53216
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
52574
53217
  jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
52575
53218
  return false;
52576
53219
  }
@@ -52587,27 +53230,27 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52587
53230
  */ key: "__clearSelectedCells",
52588
53231
  value: function __clearSelectedCells(range) {
52589
53232
  var _this_j = this.j, editor = _this_j.editor, createInside = _this_j.createInside;
52590
- var startCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(range.startContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell, editor);
52591
- var endCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(range.endContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell, editor);
53233
+ var startCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
53234
+ var endCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.endContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
52592
53235
  if (startCell === endCell) {
52593
53236
  return null;
52594
53237
  }
52595
- var startTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(startCell, 'table', editor);
52596
- var endTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(endCell, 'table', editor);
53238
+ var startTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(startCell, 'table', editor);
53239
+ var endTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(endCell, 'table', editor);
52597
53240
  var caret = range.cloneRange();
52598
53241
  caret.collapse(true);
52599
53242
  var parts = [];
52600
53243
  var addParts = function addParts(table) {
52601
- (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.toArray)(table.rows).flatMap(function(row) {
52602
- return (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_2__.toArray)(row.cells);
53244
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.toArray)(table.rows).flatMap(function(row) {
53245
+ return (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.toArray)(row.cells);
52603
53246
  }).filter(function(cell) {
52604
53247
  return range.intersectsNode(cell);
52605
53248
  }).forEach(function(cell) {
52606
53249
  var part = range.cloneRange();
52607
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(cell, range.startContainer)) {
53250
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.startContainer)) {
52608
53251
  part.setStart(cell, 0);
52609
53252
  }
52610
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isOrContains(cell, range.endContainer)) {
53253
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.endContainer)) {
52611
53254
  part.setEnd(cell, cell.childNodes.length);
52612
53255
  }
52613
53256
  parts.push([
@@ -52631,9 +53274,9 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52631
53274
  parts.forEach(function(param) {
52632
53275
  var _param = _sliced_to_array(param, 2), cell = _param[0], part = _param[1];
52633
53276
  part.deleteContents();
52634
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(cell)) {
52635
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.detach(cell);
52636
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(cell, createInside.element('br'));
53277
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(cell)) {
53278
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(cell);
53279
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(cell, createInside.element('br'));
52637
53280
  }
52638
53281
  });
52639
53282
  return startTable ? caret : null;
@@ -52644,49 +53287,89 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52644
53287
  value: function __moveContentInLeftSibling(fake, leftSibling, rightSibling) {
52645
53288
  leftSibling = this.__defineRightLeftBox(leftSibling);
52646
53289
  // Nothing is moved into a table, and a block left empty after it goes
52647
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(leftSibling, 'table')) {
52648
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(rightSibling)) {
52649
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(rightSibling);
53290
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(leftSibling, 'table')) {
53291
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
53292
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
52650
53293
  }
52651
53294
  return;
52652
53295
  }
52653
- 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)) {
52654
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, fake);
52655
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.moveContent(rightSibling, leftSibling);
52656
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(rightSibling);
53296
+ 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)) {
53297
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
53298
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(rightSibling, leftSibling);
53299
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
52657
53300
  }
52658
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(rightSibling.firstElementChild)) {
53301
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild)) {
52659
53302
  var item = rightSibling.firstElementChild;
52660
53303
  // What's left of the right list's first item joins the left block,
52661
53304
  // up to a list nested in the item
52662
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(item) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(leftSibling)) {
52663
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, fake);
52664
- while(item.firstChild && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(item.firstChild)){
52665
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, item.firstChild);
53305
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
53306
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
53307
+ while(item.firstChild && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(item.firstChild)){
53308
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, item.firstChild);
52666
53309
  }
52667
53310
  }
52668
53311
  // Remove empty right LI
52669
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(item)) {
52670
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(item);
53312
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item)) {
53313
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(item);
52671
53314
  }
52672
- if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(rightSibling)) {
52673
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(rightSibling);
53315
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
53316
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
52674
53317
  }
52675
53318
  }
52676
53319
  }
52677
53320
  },
52678
53321
  {
52679
53322
  /**
53323
+ * A plain space the deletion leaves at an edge of the block, before a line
53324
+ * break or next to another space isn't shown, and the browser drops it when
53325
+ * the next char is typed. It becomes non-breaking, as in the browsers' own
53326
+ * delete and in Backspace without a selection (#1522)
53327
+ */ key: "__keepSpacesVisible",
53328
+ value: function __keepSpacesVisible(fake) {
53329
+ var _a;
53330
+ var jodit = this.jodit;
53331
+ var 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;
53332
+ if (KEEPS_SPACES.has(jodit.ew.getComputedStyle(block).whiteSpace)) {
53333
+ return;
53334
+ }
53335
+ var before = this.__findNeighbor(fake, true, block);
53336
+ var after = this.__findNeighbor(fake, false, block);
53337
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(before) && hidesSpace(after, /^ /)) {
53338
+ before.nodeValue = before.nodeValue.replace(/ +$/, function(spaces) {
53339
+ return _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces.length);
53340
+ });
53341
+ }
53342
+ if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(after) && hidesSpace(before, / $/)) {
53343
+ after.nodeValue = after.nodeValue.replace(/^ +/, function(spaces) {
53344
+ return _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces.length);
53345
+ });
53346
+ }
53347
+ }
53348
+ },
53349
+ {
53350
+ /**
53351
+ * The text, line break or other element next to the caret in its block,
53352
+ * looking inside inline elements
53353
+ */ key: "__findNeighbor",
53354
+ value: function __findNeighbor(fake, left, block) {
53355
+ 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, function(node) {
53356
+ var _a;
53357
+ 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);
53358
+ }, block);
53359
+ }
53360
+ },
53361
+ {
53362
+ /**
52680
53363
  * If left sibling is list - return last leaf
52681
53364
  */ key: "__defineRightLeftBox",
52682
53365
  value: function __defineRightLeftBox(leftSibling) {
52683
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(leftSibling)) {
53366
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(leftSibling)) {
52684
53367
  return leftSibling;
52685
53368
  }
52686
53369
  var lastLeaf = leftSibling.lastElementChild;
52687
- if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(lastLeaf)) {
53370
+ if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(lastLeaf)) {
52688
53371
  lastLeaf = this.j.createInside.element('li');
52689
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.append(leftSibling, lastLeaf);
53372
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, lastLeaf);
52690
53373
  }
52691
53374
  return lastLeaf;
52692
53375
  }
@@ -52697,9 +53380,9 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52697
53380
  */ key: "__addBrInEmptyBlock",
52698
53381
  value: function __addBrInEmptyBlock(fake, range) {
52699
53382
  var jodit = this.j;
52700
- if (fake.isConnected && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
53383
+ if (fake.isConnected && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
52701
53384
  var br = jodit.createInside.element('br');
52702
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.after(fake, br);
53385
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, br);
52703
53386
  range.setStartBefore(br);
52704
53387
  range.collapse(true);
52705
53388
  }
@@ -52709,24 +53392,24 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
52709
53392
  key: "__moveCursorInEditableSibling",
52710
53393
  value: function __moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
52711
53394
  var _a;
52712
- if (!leftSibling || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(leftSibling)) {
52713
- var 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;
52714
- var leftText = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.prev(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isText, root);
53395
+ if (!leftSibling || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(leftSibling)) {
53396
+ var 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;
53397
+ var leftText = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.prev(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText, root);
52715
53398
  if (leftText) {
52716
53399
  range.setStartAfter(leftText);
52717
53400
  range.collapse(true);
52718
- _core_dom_index_js__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(fake);
53401
+ _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
52719
53402
  }
52720
53403
  }
52721
53404
  }
52722
53405
  }
52723
53406
  ]);
52724
53407
  return deleteCommand;
52725
- }(_wrap_native_super(_core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.Plugin));
53408
+ }(_wrap_native_super(_core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin));
52726
53409
  deleteCommand.requires = [
52727
53410
  'backspace'
52728
53411
  ];
52729
- _core_global_js__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('deleteCommand', deleteCommand);
53412
+ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('deleteCommand', deleteCommand);
52730
53413
 
52731
53414
 
52732
53415
  /***/ }),
@@ -69551,10 +70234,21 @@ var key = 'table_processor_observer-resize';
69551
70234
  _this.startX = 0;
69552
70235
  /**
69553
70236
  * The table's and its cells' styles as a column drag started, put back
69554
- * before each new width
70237
+ * as it ends, before the final widths
69555
70238
  */ _this.startStyles = [];
69556
70239
  _this.startLeft = 0;
69557
70240
  _this.startEdge = 0;
70241
+ /**
70242
+ * For each of the two columns a drag resizes, the cell whose width
70243
+ * `setColumnWidthByDelta` sets, with its width as the drag started, and
70244
+ * the cells below it, whose widths it clears
70245
+ */ _this.startWidths = [];
70246
+ /**
70247
+ * The table's width as the drag started, and for a drag of its edge, the
70248
+ * width inside what holds it and its margin on that side
70249
+ */ _this.startTableWidth = 0;
70250
+ _this.startParentWidth = 0;
70251
+ _this.startMargin = 0;
69558
70252
  /**
69559
70253
  * The row whose height the handle sets, or null while it sets a width
69560
70254
  */ _this.workRow = null;
@@ -69616,7 +70310,7 @@ var key = 'table_processor_observer-resize';
69616
70310
  */ key: "onHandleMouseDown",
69617
70311
  value: function onHandleMouseDown(event) {
69618
70312
  var _this = this;
69619
- if (this.j.isLocked) {
70313
+ if (this.j.isLocked || this.j.o.readonly) {
69620
70314
  return;
69621
70315
  }
69622
70316
  this.drag = true;
@@ -69652,10 +70346,15 @@ var key = 'table_processor_observer-resize';
69652
70346
  var box;
69653
70347
  this.minX = 0;
69654
70348
  this.maxX = 1000000;
70349
+ this.startTableWidth = this.workTable.offsetWidth;
69655
70350
  if (this.wholeTable != null) {
69656
- var tableBox = this.workTable.parentNode.getBoundingClientRect();
70351
+ var parent = this.workTable.parentNode;
70352
+ var tableBox = parent.getBoundingClientRect();
69657
70353
  this.minX = tableBox.left;
69658
70354
  this.maxX = this.minX + tableBox.width;
70355
+ var side = this.isRTL ? 'marginRight' : 'marginLeft';
70356
+ this.startParentWidth = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.getContentWidth)(parent, this.j.ew);
70357
+ this.startMargin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
69659
70358
  } else {
69660
70359
  // find maximum columns
69661
70360
  var coordinate = this.module.formalCoordinate(this.workTable, this.workCell, true);
@@ -69669,6 +70368,21 @@ var key = 'table_processor_observer-resize';
69669
70368
  _this.maxX = Math.min(box.left + box.width - _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NEARBY / 2, _this.maxX);
69670
70369
  }
69671
70370
  });
70371
+ var matrix = this.module.formalMatrix(this.workTable);
70372
+ this.startWidths = this.resizedColumns().map(function(column) {
70373
+ var cells = matrix.map(function(row) {
70374
+ return row[column];
70375
+ });
70376
+ var index = cells.findIndex(function(td) {
70377
+ return td.colSpan === 1 || cells.length === 1;
70378
+ });
70379
+ var cell = cells[index];
70380
+ return [
70381
+ cell,
70382
+ cell ? cell.offsetWidth : 0,
70383
+ cells.slice(Math.max(index, 0) + 1)
70384
+ ];
70385
+ });
69672
70386
  }
69673
70387
  return false;
69674
70388
  }
@@ -69700,8 +70414,11 @@ var key = 'table_processor_observer-resize';
69700
70414
  x = this.maxX;
69701
70415
  }
69702
70416
  this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
69703
- this.restoreStyles();
69704
- this.resizeColumnsOrTable();
70417
+ if (this.wholeTable == null) {
70418
+ this.setColumnWidths();
70419
+ } else {
70420
+ this.resizeTable();
70421
+ }
69705
70422
  var tableBox = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.offset)(this.workTable, this.j, this.j.ed);
69706
70423
  Object.assign(this.resizeHandler.style, {
69707
70424
  left: this.startLeft + this.columnEdge() - this.startEdge + 'px',
@@ -69842,15 +70559,51 @@ var key = 'table_processor_observer-resize';
69842
70559
  },
69843
70560
  {
69844
70561
  /**
70562
+ * The two columns a column drag resizes: the work cell's last, and the
70563
+ * next cell's first
70564
+ */ key: "resizedColumns",
70565
+ value: function resizedColumns() {
70566
+ var 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);
70567
+ return [
70568
+ this.module.formalCoordinate(this.workTable, this.workCell, true)[1],
70569
+ this.module.formalCoordinate(this.workTable, nextTD)[1]
70570
+ ];
70571
+ }
70572
+ },
70573
+ {
70574
+ /**
69845
70575
  * Resize only one column
69846
70576
  */ key: "resizeColumns",
69847
70577
  value: function resizeColumns() {
69848
70578
  var delta = this.resizeDelta;
69849
70579
  var marked = [];
69850
70580
  var tableModule = this.module;
69851
- tableModule.setColumnWidthByDelta(this.workTable, tableModule.formalCoordinate(this.workTable, this.workCell, true)[1], delta, true, marked);
69852
- var 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);
69853
- tableModule.setColumnWidthByDelta(this.workTable, tableModule.formalCoordinate(this.workTable, nextTD)[1], -delta, false, marked);
70581
+ var _this_resizedColumns = _sliced_to_array(this.resizedColumns(), 2), column = _this_resizedColumns[0], nextColumn = _this_resizedColumns[1];
70582
+ tableModule.setColumnWidthByDelta(this.workTable, column, delta, true, marked);
70583
+ tableModule.setColumnWidthByDelta(this.workTable, nextColumn, -delta, false, marked);
70584
+ }
70585
+ },
70586
+ {
70587
+ /**
70588
+ * Sets the widths `resizeColumns` would while the handle is dragged, from
70589
+ * the widths the drag started with, so that a move doesn't put back every
70590
+ * cell's style and lay the table out again to measure them
70591
+ */ key: "setColumnWidths",
70592
+ value: function setColumnWidths() {
70593
+ var _this = this;
70594
+ this.startWidths.forEach(function(param, index) {
70595
+ var _param = _sliced_to_array(param, 3), cell = _param[0], width = _param[1], below = _param[2];
70596
+ var delta = index ? -_this.resizeDelta : _this.resizeDelta;
70597
+ if (cell) {
70598
+ (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) + '%');
70599
+ }
70600
+ below.forEach(function(td) {
70601
+ td.style.removeProperty('width');
70602
+ if (!(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(td, 'style')) {
70603
+ (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(td, 'style', null);
70604
+ }
70605
+ });
70606
+ });
69854
70607
  }
69855
70608
  },
69856
70609
  {
@@ -69859,7 +70612,7 @@ var key = 'table_processor_observer-resize';
69859
70612
  */ key: "resizeTable",
69860
70613
  value: function resizeTable() {
69861
70614
  var delta = this.resizeDelta * (this.isRTL ? -1 : 1);
69862
- var width = this.workTable.offsetWidth, parentWidth = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.getContentWidth)(this.workTable.parentNode, this.j.ew);
70615
+ var width = this.startTableWidth, parentWidth = this.startParentWidth;
69863
70616
  // for RTL use mirror logic
69864
70617
  var rightSide = !this.wholeTable;
69865
70618
  var needChangeWidth = this.isRTL ? !rightSide : rightSide;
@@ -69868,10 +70621,9 @@ var key = 'table_processor_observer-resize';
69868
70621
  (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(this.workTable, 'width', (width + delta) / parentWidth * 100 + '%');
69869
70622
  } else {
69870
70623
  var side = this.isRTL ? 'marginRight' : 'marginLeft';
69871
- var margin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
69872
70624
  (0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(this.workTable, _define_property({
69873
70625
  width: (width - delta) / parentWidth * 100 + '%'
69874
- }, side, (margin + delta) / parentWidth * 100 + '%'));
70626
+ }, side, (this.startMargin + delta) / parentWidth * 100 + '%'));
69875
70627
  }
69876
70628
  }
69877
70629
  },
@@ -69968,9 +70720,10 @@ var key = 'table_processor_observer-resize';
69968
70720
  if (!editor.o.tableAllowCellResize) {
69969
70721
  return;
69970
70722
  }
69971
- editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', function() {
70723
+ var observeTables = function observeTables() {
69972
70724
  ;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', editor.editor).forEach(_this.observe);
69973
- }).on(this.j.ow, 'scroll.resize-cells', function() {
70725
+ };
70726
+ 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', function() {
69974
70727
  if (!_this.drag || _this.workRow) {
69975
70728
  return;
69976
70729
  }
@@ -69988,6 +70741,8 @@ var key = 'table_processor_observer-resize';
69988
70741
  tableModule.normalizeTable(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(td, 'table', editor.editor));
69989
70742
  });
69990
70743
  });
70744
+ // None of those events comes with the editor's starting value
70745
+ observeTables();
69991
70746
  }
69992
70747
  },
69993
70748
  {
@@ -70005,7 +70760,9 @@ var key = 'table_processor_observer-resize';
70005
70760
  _this.hideResizeHandle();
70006
70761
  }
70007
70762
  }).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle(function(event) {
70008
- if (_this.j.isLocked) {
70763
+ // A drag from a cell isn't a resize, and the handle on
70764
+ // a border it passes would take its moves (#1778)
70765
+ if (_this.j.isLocked || _this.j.o.readonly || event.buttons) {
70009
70766
  return;
70010
70767
  }
70011
70768
  var cell = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.up(event.target, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, table);
@@ -73183,7 +73940,6 @@ function _wrap_native_super(Class) {
73183
73940
 
73184
73941
 
73185
73942
  var key = 'table_processor_observer';
73186
- var MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
73187
73943
  var selectCells = /*#__PURE__*/ function(Plugin) {
73188
73944
  "use strict";
73189
73945
  _inherits(selectCells, Plugin);
@@ -73204,6 +73960,13 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73204
73960
  /**
73205
73961
  * User is selecting cells now
73206
73962
  */ _this.__isSelectionMode = false;
73963
+ /**
73964
+ * The cell the marks were last drawn to
73965
+ */ _this.__movedTo = null;
73966
+ /**
73967
+ * A drag let go outside the table ends in a click on the editor, which
73968
+ * would unmark its cells
73969
+ */ _this.__keepMarks = false;
73207
73970
  return _this;
73208
73971
  }
73209
73972
  _create_class(selectCells, [
@@ -73226,6 +73989,8 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73226
73989
  // move the caret, as table-keyboard-navigation's do
73227
73990
  .on('keydown', this.__onKeyDown, {
73228
73991
  top: true
73992
+ }).on('clickEditor', this.__onClickAfterDrag, {
73993
+ top: true
73229
73994
  }).on('keydown.select-cells', function(event) {
73230
73995
  if (event.key === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
73231
73996
  _this.unselectCells();
@@ -73371,12 +74136,15 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73371
74136
  }
73372
74137
  this.__isSelectionMode = true;
73373
74138
  this.__selectedCell = cell;
74139
+ this.__movedTo = cell;
73374
74140
  this.__tableModule.addSelection(cell);
73375
- this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', // Don't use decorator because need clear label on mouseup
73376
- this.j.async.throttle(this.__onMove.bind(this, table), {
73377
- label: MOUSE_MOVE_LABEL,
73378
- timeout: this.j.defaultTimeout / 2
73379
- })).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
74141
+ 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));
74142
+ new Set([
74143
+ this.j.ew,
74144
+ this.j.ow
74145
+ ]).forEach(function(win) {
74146
+ return _this.j.e.on(win, 'mouseup.select-cells touchend.select-cells', _this.__onRelease.bind(_this, table));
74147
+ });
73380
74148
  return false;
73381
74149
  }
73382
74150
  },
@@ -73387,6 +74155,29 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73387
74155
  this.__onRemoveSelection();
73388
74156
  }
73389
74157
  },
74158
+ {
74159
+ key: "onMouseDown",
74160
+ value: function onMouseDown() {
74161
+ this.__keepMarks = false;
74162
+ }
74163
+ },
74164
+ {
74165
+ /**
74166
+ * The click that ends a drag let go outside the table, and inside the
74167
+ * editor, lands on the editor. Taken on, it would unmark the cells and
74168
+ * close their popup. As for the click on a row after a drag over the
74169
+ * cells, the browser's own selection from the drag goes
74170
+ */ key: "__onClickAfterDrag",
74171
+ value: function __onClickAfterDrag() {
74172
+ var _a;
74173
+ if (this.__keepMarks) {
74174
+ this.__keepMarks = false;
74175
+ (_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
74176
+ this.j.e.stopPropagation('clickEditor');
74177
+ return false;
74178
+ }
74179
+ }
74180
+ },
73390
74181
  {
73391
74182
  key: "onChange",
73392
74183
  value: function onChange() {
@@ -73410,16 +74201,20 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73410
74201
  // Inside Shadow DOM `document.elementFromPoint` returns the shadow
73411
74202
  // host, so the lookup must start from the shadow root
73412
74203
  var node = ((_a = this.j.o.shadowRoot) !== null && _a !== void 0 ? _a : this.j.ed).elementFromPoint(e.clientX, e.clientY);
73413
- if (!node) {
73414
- return;
73415
- }
73416
- var cell = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, [
74204
+ var cell = node && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, [
73417
74205
  'td',
73418
74206
  'th'
73419
74207
  ], table);
73420
74208
  if (!cell || !this.__selectedCell) {
73421
74209
  return;
73422
74210
  }
74211
+ // The marks change only when the mouse goes into another cell, and then
74212
+ // at once rather than throttled, as the browser's own selection from
74213
+ // the drag shows in the cells between until they do (#1778)
74214
+ if (cell === this.__movedTo) {
74215
+ return;
74216
+ }
74217
+ this.__movedTo = cell;
73423
74218
  if (cell !== this.__selectedCell) {
73424
74219
  this.j.lock(key);
73425
74220
  }
@@ -73462,8 +74257,7 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73462
74257
  * Stop a selection process
73463
74258
  */ key: "__onStopSelection",
73464
74259
  value: function __onStopSelection(table, e) {
73465
- var _this = this;
73466
- var _a, _b, _c;
74260
+ var _a;
73467
74261
  if (!this.__selectedCell) {
73468
74262
  return;
73469
74263
  }
@@ -73486,11 +74280,41 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73486
74280
  if (ownTable && ownTable !== table) {
73487
74281
  return; // Nested tables
73488
74282
  }
73489
- var bound = this.__tableModule.getSelectedBound(table, [
74283
+ this.__showCellsPopup(table, [
73490
74284
  cell,
73491
74285
  this.__selectedCell
73492
- ]), box = this.__tableModule.formalMatrix(table);
73493
- var 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]];
74286
+ ]);
74287
+ this.__stopListening();
74288
+ }
74289
+ },
74290
+ {
74291
+ /**
74292
+ * A drag let go outside the table doesn't reach the table's `mouseup`, so
74293
+ * the window's ends it, leaving the cells marked as they were (#1774)
74294
+ */ key: "__onRelease",
74295
+ value: function __onRelease(table, e) {
74296
+ if (this.__isSelectionMode) {
74297
+ this.__isSelectionMode = false;
74298
+ if (!this.j.isLockedNotBy(key)) {
74299
+ this.j.unlock();
74300
+ }
74301
+ var cells = this.__tableModule.getAllSelectedCells();
74302
+ // One let go outside the editor clicks outside it, which unmarks them
74303
+ if (cells.length > 1 && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(this.j.editor, e.target)) {
74304
+ this.__keepMarks = true;
74305
+ this.__showCellsPopup(table, cells);
74306
+ }
74307
+ }
74308
+ this.__stopListening();
74309
+ }
74310
+ },
74311
+ {
74312
+ key: "__showCellsPopup",
74313
+ value: function __showCellsPopup(table, cells) {
74314
+ var _this = this;
74315
+ var _a, _b;
74316
+ var bound = this.__tableModule.getSelectedBound(table, cells), box = this.__tableModule.formalMatrix(table);
74317
+ var 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]];
73494
74318
  // `getSelectedBound` keeps its `Infinity` sentinel when none of the
73495
74319
  // selected cells belong to this table's matrix — e.g. after a
73496
74320
  // drag-and-drop that moved/removed the cells, leaving a stale anchor and
@@ -73509,10 +74333,22 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73509
74333
  height: maxOffset.top - minOffset.top + maxOffset.height
73510
74334
  };
73511
74335
  }, 'cells');
74336
+ }
74337
+ },
74338
+ {
74339
+ key: "__stopListening",
74340
+ value: function __stopListening() {
74341
+ var _this = this;
73512
74342
  (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', this.j.editor).forEach(function(table) {
73513
74343
  _this.j.e.off(table, 'mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells');
73514
74344
  });
73515
- this.j.async.clearTimeout(MOUSE_MOVE_LABEL);
74345
+ new Set([
74346
+ this.j.ew,
74347
+ this.j.ow
74348
+ ]).forEach(function(win) {
74349
+ return _this.j.e.off(win, 'mouseup.select-cells touchend.select-cells');
74350
+ });
74351
+ this.__movedTo = null;
73516
74352
  }
73517
74353
  },
73518
74354
  {
@@ -73715,7 +74551,8 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
73715
74551
  /** @override */ key: "beforeDestruct",
73716
74552
  value: function beforeDestruct(jodit) {
73717
74553
  this.__onRemoveSelection();
73718
- jodit.e.off('.select-cells').off('keydown', this.__onKeyDown);
74554
+ this.__stopListening();
74555
+ jodit.e.off('.select-cells').off('keydown', this.__onKeyDown).off('clickEditor', this.__onClickAfterDrag);
73719
74556
  }
73720
74557
  }
73721
74558
  ]);
@@ -73736,6 +74573,15 @@ __decorate([
73736
74573
  __decorate([
73737
74574
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':outsideClick')
73738
74575
  ], selectCells.prototype, "onOutsideClick", null);
74576
+ __decorate([
74577
+ (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)([
74578
+ ':mousedown',
74579
+ ':touchstart'
74580
+ ])
74581
+ ], selectCells.prototype, "onMouseDown", null);
74582
+ __decorate([
74583
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
74584
+ ], selectCells.prototype, "__onClickAfterDrag", null);
73739
74585
  __decorate([
73740
74586
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':change')
73741
74587
  ], selectCells.prototype, "onChange", null);
@@ -73783,10 +74629,11 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
73783
74629
  /* harmony import */ var _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65478);
73784
74630
  /* harmony import */ var _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
73785
74631
  /* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(580);
73786
- /* harmony import */ var _core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87058);
73787
- /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
73788
- /* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67510);
73789
- /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67215);
74632
+ /* harmony import */ var _core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4510);
74633
+ /* harmony import */ var _core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87058);
74634
+ /* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50911);
74635
+ /* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67510);
74636
+ /* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(67215);
73790
74637
  function _assert_this_initialized(self) {
73791
74638
  if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
73792
74639
  return self;
@@ -73915,6 +74762,7 @@ function _wrap_native_super(Class) {
73915
74762
 
73916
74763
 
73917
74764
 
74765
+
73918
74766
  /**
73919
74767
  * A utility plugin that allows you to subscribe to a click/mousedown/touchstart/mouseup on an element in DOM order
73920
74768
  *
@@ -73944,6 +74792,10 @@ function _wrap_native_super(Class) {
73944
74792
  * element and ends in another as a `click` on their common ancestor, so a
73945
74793
  * press inside a popup is remembered to tell such a drag from a real click.
73946
74794
  */ _this.__pressTarget = null;
74795
+ /**
74796
+ * The row a press to its right was beside, and the caret it put there,
74797
+ * while the button is down
74798
+ */ _this.__pressBesideRow = null;
73947
74799
  return _this;
73948
74800
  }
73949
74801
  _create_class(select, [
@@ -73954,6 +74806,9 @@ function _wrap_native_super(Class) {
73954
74806
  this.proxyEventsList.forEach(function(eventName) {
73955
74807
  jodit.e.on(eventName + '.select', _this.onStartSelection);
73956
74808
  });
74809
+ jodit.e.on('dblclick', this.__onDblClickBesideRow, {
74810
+ top: true
74811
+ });
73957
74812
  }
73958
74813
  },
73959
74814
  {
@@ -73961,8 +74816,10 @@ function _wrap_native_super(Class) {
73961
74816
  value: function beforeDestruct(jodit) {
73962
74817
  var _this = this;
73963
74818
  this.proxyEventsList.forEach(function(eventName) {
73964
- jodit.e.on(eventName + '.select', _this.onStartSelection);
74819
+ jodit.e.off(eventName + '.select', _this.onStartSelection);
73965
74820
  });
74821
+ this.__endPressBesideRow();
74822
+ jodit.e.off('dblclick', this.__onDblClickBesideRow);
73966
74823
  }
73967
74824
  },
73968
74825
  {
@@ -73971,7 +74828,7 @@ function _wrap_native_super(Class) {
73971
74828
  var j = this.j;
73972
74829
  var result, target = e.target;
73973
74830
  while(result === undefined && target && target !== j.editor){
73974
- result = j.e.fire((0,_core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_4__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
74831
+ result = j.e.fire((0,_core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_5__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
73975
74832
  target = target.parentElement;
73976
74833
  }
73977
74834
  if (e.type === 'click' && result === undefined && target === j.editor) {
@@ -74000,10 +74857,10 @@ function _wrap_native_super(Class) {
74000
74857
  }
74001
74858
  // Selecting the text of a popup input with the mouse and releasing
74002
74859
  // the button past the popup's edge is not a click outside of it.
74003
- if (pressed && _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.UIElement.closestElement(pressed, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.Popup)) {
74860
+ if (pressed && _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(pressed, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.Popup)) {
74004
74861
  return;
74005
74862
  }
74006
- var box = _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.UIElement.closestElement(node, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_6__.Popup);
74863
+ var box = _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(node, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.Popup);
74007
74864
  if (!box) {
74008
74865
  this.j.e.fire('outsideClick', e);
74009
74866
  }
@@ -74063,6 +74920,160 @@ function _wrap_native_super(Class) {
74063
74920
  },
74064
74921
  {
74065
74922
  /**
74923
+ * The table row the mouse is to the right of
74924
+ */ key: "__rowBeside",
74925
+ value: function __rowBeside(e) {
74926
+ var _a;
74927
+ var j = this.j;
74928
+ var target = e.target;
74929
+ 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)) {
74930
+ return null;
74931
+ }
74932
+ var table = (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(target.children).find(function(elm) {
74933
+ if (!_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(elm, 'table')) {
74934
+ return false;
74935
+ }
74936
+ var box = elm.getBoundingClientRect();
74937
+ return e.clientX >= box.right && e.clientY >= box.top && e.clientY < box.bottom;
74938
+ });
74939
+ var rows = table ? (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(table.rows).filter(function(row) {
74940
+ return row.cells.length;
74941
+ }) : [];
74942
+ if (!table || !rows.length) {
74943
+ return null;
74944
+ }
74945
+ var row = (_a = rows.find(function(row) {
74946
+ return e.clientY < row.getBoundingClientRect().bottom;
74947
+ })) !== null && _a !== void 0 ? _a : rows[rows.length - 1];
74948
+ return {
74949
+ table: table,
74950
+ row: row
74951
+ };
74952
+ }
74953
+ },
74954
+ {
74955
+ /**
74956
+ * A press to the right of a table row puts the caret where Word's typing
74957
+ * goes from there: the start of the next row's first cell, or of the block
74958
+ * after the table for the last row (#1770). The browsers put it after the
74959
+ * table, whichever row it's beside, so typing starts a new line below it.
74960
+ * Their own press is stopped, as its drag would start after the table and
74961
+ * take in the rows below first
74962
+ */ key: "onMouseDownBesideTableRow",
74963
+ value: function onMouseDownBesideTableRow(e) {
74964
+ var _this = this;
74965
+ var j = this.j;
74966
+ var beside = this.__rowBeside(e);
74967
+ if (!beside) {
74968
+ return;
74969
+ }
74970
+ // A press before the last one was let go must not stack its listeners
74971
+ this.__endPressBesideRow();
74972
+ e.preventDefault();
74973
+ this.__putCaretBesideRow(beside.table, beside.row);
74974
+ this.__pressBesideRow = {
74975
+ row: beside.row,
74976
+ caret: j.s.range.cloneRange()
74977
+ };
74978
+ j.e.on(j.ew, 'mousemove', this.__onDragFromRow);
74979
+ new Set([
74980
+ j.ew,
74981
+ j.ow
74982
+ ]).forEach(function(win) {
74983
+ return j.e.on(win, 'mouseup', _this.__onReleaseFromRow);
74984
+ });
74985
+ }
74986
+ },
74987
+ {
74988
+ /**
74989
+ * A drag from beside a row selects from the end of the row to the mouse,
74990
+ * and back beside the row it's the caret again
74991
+ */ key: "__onDragFromRow",
74992
+ value: function __onDragFromRow(e) {
74993
+ var _a, _b;
74994
+ var s = this.j.s;
74995
+ var press = this.__pressBesideRow;
74996
+ if (!press || !(e.buttons & 1)) {
74997
+ this.__endPressBesideRow();
74998
+ return;
74999
+ }
75000
+ if (((_a = this.__rowBeside(e)) === null || _a === void 0 ? void 0 : _a.row) === press.row) {
75001
+ if (!s.isCollapsed()) {
75002
+ s.selectRange(press.caret.cloneRange());
75003
+ }
75004
+ return;
75005
+ }
75006
+ var cells = press.row.cells;
75007
+ var last = cells[cells.length - 1];
75008
+ if (s.insertCursorAtPoint(e.clientX, e.clientY)) {
75009
+ var _s_range = s.range, startContainer = _s_range.startContainer, startOffset = _s_range.startOffset;
75010
+ (_b = s.sel) === null || _b === void 0 ? void 0 : _b.setBaseAndExtent(last, last.childNodes.length, startContainer, startOffset);
75011
+ }
75012
+ }
75013
+ },
75014
+ {
75015
+ /**
75016
+ * In iframe mode, a press in an editor without the focus puts the caret at
75017
+ * its end, so a release that selected nothing puts it back
75018
+ */ key: "__onReleaseFromRow",
75019
+ value: function __onReleaseFromRow() {
75020
+ var press = this.__pressBesideRow;
75021
+ this.__endPressBesideRow();
75022
+ if (press && this.j.s.isCollapsed()) {
75023
+ this.j.s.selectRange(press.caret);
75024
+ }
75025
+ }
75026
+ },
75027
+ {
75028
+ key: "__endPressBesideRow",
75029
+ value: function __endPressBesideRow() {
75030
+ var _this = this;
75031
+ var j = this.j;
75032
+ this.__pressBesideRow = null;
75033
+ j.e.off(j.ew, 'mousemove', this.__onDragFromRow);
75034
+ new Set([
75035
+ j.ew,
75036
+ j.ow
75037
+ ]).forEach(function(win) {
75038
+ return j.e.off(win, 'mouseup', _this.__onReleaseFromRow);
75039
+ });
75040
+ }
75041
+ },
75042
+ {
75043
+ /**
75044
+ * A double click beside a row is two clicks there, so add-new-line,
75045
+ * which adds a line on a double click with a caret, doesn't see it
75046
+ */ key: "__onDblClickBesideRow",
75047
+ value: function __onDblClickBesideRow(e) {
75048
+ if (this.__rowBeside(e)) {
75049
+ this.j.e.stopPropagation('dblclick');
75050
+ return false;
75051
+ }
75052
+ }
75053
+ },
75054
+ {
75055
+ key: "__putCaretBesideRow",
75056
+ value: function __putCaretBesideRow(table, row) {
75057
+ var j = this.j;
75058
+ var rows = (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(table.rows);
75059
+ var next = rows.slice(rows.indexOf(row) + 1).find(function(row) {
75060
+ return row.cells.length;
75061
+ });
75062
+ var after = table.nextSibling;
75063
+ while(after && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmptyTextNode(after)){
75064
+ after = after.nextSibling;
75065
+ }
75066
+ if (next) {
75067
+ j.s.setCursorIn(next.cells[0], true);
75068
+ } 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)) {
75069
+ j.s.setCursorIn(after, true);
75070
+ } else {
75071
+ j.s.setCursorAfter(table);
75072
+ }
75073
+ }
75074
+ },
75075
+ {
75076
+ /**
74066
75077
  * Keep pending inline formatting after a click. Toggling Bold/Italic/etc. on
74067
75078
  * a collapsed cursor leaves empty marker elements with the caret inside; a
74068
75079
  * click puts the caret right before them (outside), so they get cleaned up
@@ -74123,7 +75134,7 @@ function _wrap_native_super(Class) {
74123
75134
  }
74124
75135
  ]);
74125
75136
  return select;
74126
- }(_wrap_native_super(_core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin));
75137
+ }(_wrap_native_super(_core_plugin_index_js__WEBPACK_IMPORTED_MODULE_6__.Plugin));
74127
75138
  __decorate([
74128
75139
  _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
74129
75140
  ], select.prototype, "onStartSelection", null);
@@ -74151,6 +75162,18 @@ __decorate([
74151
75162
  ':click'
74152
75163
  ])
74153
75164
  ], select.prototype, "onClickRightOfNestedListItem", null);
75165
+ __decorate([
75166
+ (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':mousedown')
75167
+ ], select.prototype, "onMouseDownBesideTableRow", null);
75168
+ __decorate([
75169
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
75170
+ ], select.prototype, "__onDragFromRow", null);
75171
+ __decorate([
75172
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
75173
+ ], select.prototype, "__onReleaseFromRow", null);
75174
+ __decorate([
75175
+ _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
75176
+ ], select.prototype, "__onDblClickBesideRow", null);
74154
75177
  __decorate([
74155
75178
  (0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)([
74156
75179
  ':click'