jodit-pro 4.6.21 → 4.6.22

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 (296) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.js +2 -2
  3. package/es2015/jodit.js +2 -2
  4. package/es2015/jodit.min.js +2 -2
  5. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  6. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  7. package/es2015/plugins/backup/backup.css +1 -1
  8. package/es2015/plugins/backup/backup.js +1 -1
  9. package/es2015/plugins/backup/backup.min.js +1 -1
  10. package/es2015/plugins/button-generator/button-generator.css +1 -1
  11. package/es2015/plugins/button-generator/button-generator.js +1 -1
  12. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  13. package/es2015/plugins/change-case/change-case.js +1 -1
  14. package/es2015/plugins/change-case/change-case.min.js +1 -1
  15. package/es2015/plugins/color-picker/color-picker.css +1 -1
  16. package/es2015/plugins/color-picker/color-picker.js +1 -1
  17. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  18. package/es2015/plugins/emoji/emoji.css +1 -1
  19. package/es2015/plugins/emoji/emoji.js +1 -1
  20. package/es2015/plugins/emoji/emoji.min.js +1 -1
  21. package/es2015/plugins/export-docs/export-docs.js +1 -1
  22. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  23. package/es2015/plugins/finder/finder.css +1 -1
  24. package/es2015/plugins/finder/finder.js +1 -1
  25. package/es2015/plugins/finder/finder.min.js +1 -1
  26. package/es2015/plugins/google-maps/google-maps.css +1 -1
  27. package/es2015/plugins/google-maps/google-maps.js +1 -1
  28. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  29. package/es2015/plugins/google-search/google-search.js +1 -1
  30. package/es2015/plugins/google-search/google-search.min.js +1 -1
  31. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  32. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  33. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  34. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  35. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  36. package/es2015/plugins/keyboard/keyboard.css +1 -1
  37. package/es2015/plugins/keyboard/keyboard.js +1 -1
  38. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  39. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  40. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  41. package/es2015/plugins/page-break/page-break.js +1 -1
  42. package/es2015/plugins/page-break/page-break.min.js +1 -1
  43. package/es2015/plugins/paste-code/paste-code.css +1 -1
  44. package/es2015/plugins/paste-code/paste-code.js +1 -1
  45. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  46. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  47. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  48. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  49. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  50. package/es2015/plugins/todo-list/todo-list.css +1 -1
  51. package/es2015/plugins/todo-list/todo-list.js +1 -1
  52. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  53. package/es2015/plugins/translate/translate.css +1 -1
  54. package/es2015/plugins/translate/translate.js +154 -27
  55. package/es2015/plugins/translate/translate.min.js +2 -2
  56. package/es2015/plugins/tune-block/tune-block.css +1 -1
  57. package/es2015/plugins/tune-block/tune-block.js +1 -1
  58. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  59. package/es2018/jodit.css +1 -1
  60. package/es2018/jodit.fat.min.js +2 -2
  61. package/es2018/jodit.js +2 -2
  62. package/es2018/jodit.min.js +2 -2
  63. package/es2018/plugins/autocomplete/autocomplete.js +1 -1
  64. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  65. package/es2018/plugins/backup/backup.css +1 -1
  66. package/es2018/plugins/backup/backup.js +1 -1
  67. package/es2018/plugins/backup/backup.min.js +1 -1
  68. package/es2018/plugins/button-generator/button-generator.css +1 -1
  69. package/es2018/plugins/button-generator/button-generator.js +1 -1
  70. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  71. package/es2018/plugins/change-case/change-case.js +1 -1
  72. package/es2018/plugins/change-case/change-case.min.js +1 -1
  73. package/es2018/plugins/color-picker/color-picker.css +1 -1
  74. package/es2018/plugins/color-picker/color-picker.js +1 -1
  75. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  76. package/es2018/plugins/emoji/emoji.css +1 -1
  77. package/es2018/plugins/emoji/emoji.js +1 -1
  78. package/es2018/plugins/emoji/emoji.min.js +1 -1
  79. package/es2018/plugins/export-docs/export-docs.js +1 -1
  80. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  81. package/es2018/plugins/finder/finder.css +1 -1
  82. package/es2018/plugins/finder/finder.js +1 -1
  83. package/es2018/plugins/finder/finder.min.js +1 -1
  84. package/es2018/plugins/google-maps/google-maps.css +1 -1
  85. package/es2018/plugins/google-maps/google-maps.js +1 -1
  86. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  87. package/es2018/plugins/google-search/google-search.js +1 -1
  88. package/es2018/plugins/google-search/google-search.min.js +1 -1
  89. package/es2018/plugins/highlight-signature/highlight-signature.js +1 -1
  90. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  91. package/es2018/plugins/iframe-editor/iframe-editor.css +1 -1
  92. package/es2018/plugins/iframe-editor/iframe-editor.js +1 -1
  93. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  94. package/es2018/plugins/keyboard/keyboard.css +1 -1
  95. package/es2018/plugins/keyboard/keyboard.js +1 -1
  96. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  97. package/es2018/plugins/mobile-view/mobile-view.js +1 -1
  98. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  99. package/es2018/plugins/page-break/page-break.js +1 -1
  100. package/es2018/plugins/page-break/page-break.min.js +1 -1
  101. package/es2018/plugins/paste-code/paste-code.css +1 -1
  102. package/es2018/plugins/paste-code/paste-code.js +1 -1
  103. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  104. package/es2018/plugins/paste-from-word/paste-from-word.js +1 -1
  105. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  106. package/es2018/plugins/show-blocks/show-blocks.js +1 -1
  107. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  108. package/es2018/plugins/todo-list/todo-list.css +1 -1
  109. package/es2018/plugins/todo-list/todo-list.js +1 -1
  110. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  111. package/es2018/plugins/translate/translate.css +1 -1
  112. package/es2018/plugins/translate/translate.js +154 -27
  113. package/es2018/plugins/translate/translate.min.js +2 -2
  114. package/es2018/plugins/tune-block/tune-block.css +1 -1
  115. package/es2018/plugins/tune-block/tune-block.js +1 -1
  116. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  117. package/es2021/jodit.css +1 -1
  118. package/es2021/jodit.fat.min.js +2 -2
  119. package/es2021/jodit.js +2 -2
  120. package/es2021/jodit.min.js +2 -2
  121. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  122. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  123. package/es2021/plugins/backup/backup.css +1 -1
  124. package/es2021/plugins/backup/backup.js +1 -1
  125. package/es2021/plugins/backup/backup.min.js +1 -1
  126. package/es2021/plugins/button-generator/button-generator.css +1 -1
  127. package/es2021/plugins/button-generator/button-generator.js +1 -1
  128. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  129. package/es2021/plugins/change-case/change-case.js +1 -1
  130. package/es2021/plugins/change-case/change-case.min.js +1 -1
  131. package/es2021/plugins/color-picker/color-picker.css +1 -1
  132. package/es2021/plugins/color-picker/color-picker.js +1 -1
  133. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  134. package/es2021/plugins/emoji/emoji.css +1 -1
  135. package/es2021/plugins/emoji/emoji.js +1 -1
  136. package/es2021/plugins/emoji/emoji.min.js +1 -1
  137. package/es2021/plugins/export-docs/export-docs.js +1 -1
  138. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  139. package/es2021/plugins/finder/finder.css +1 -1
  140. package/es2021/plugins/finder/finder.js +1 -1
  141. package/es2021/plugins/finder/finder.min.js +1 -1
  142. package/es2021/plugins/google-maps/google-maps.css +1 -1
  143. package/es2021/plugins/google-maps/google-maps.js +1 -1
  144. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  145. package/es2021/plugins/google-search/google-search.js +1 -1
  146. package/es2021/plugins/google-search/google-search.min.js +1 -1
  147. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  148. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  149. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  150. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  151. package/es2021/plugins/iframe-editor/iframe-editor.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/mobile-view/mobile-view.js +1 -1
  156. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  157. package/es2021/plugins/page-break/page-break.js +1 -1
  158. package/es2021/plugins/page-break/page-break.min.js +1 -1
  159. package/es2021/plugins/paste-code/paste-code.css +1 -1
  160. package/es2021/plugins/paste-code/paste-code.js +1 -1
  161. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  162. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  163. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  164. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  165. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  166. package/es2021/plugins/todo-list/todo-list.css +1 -1
  167. package/es2021/plugins/todo-list/todo-list.js +1 -1
  168. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  169. package/es2021/plugins/translate/translate.css +1 -1
  170. package/es2021/plugins/translate/translate.js +154 -27
  171. package/es2021/plugins/translate/translate.min.js +2 -2
  172. package/es2021/plugins/tune-block/tune-block.css +1 -1
  173. package/es2021/plugins/tune-block/tune-block.js +1 -1
  174. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  175. package/es2021.en/jodit.css +1 -1
  176. package/es2021.en/jodit.fat.min.js +2 -2
  177. package/es2021.en/jodit.js +2 -2
  178. package/es2021.en/jodit.min.js +2 -2
  179. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  180. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  181. package/es2021.en/plugins/backup/backup.css +1 -1
  182. package/es2021.en/plugins/backup/backup.js +1 -1
  183. package/es2021.en/plugins/backup/backup.min.js +1 -1
  184. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  185. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  186. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  187. package/es2021.en/plugins/change-case/change-case.js +1 -1
  188. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  189. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  190. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  191. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  192. package/es2021.en/plugins/emoji/emoji.css +1 -1
  193. package/es2021.en/plugins/emoji/emoji.js +1 -1
  194. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  195. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  196. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  197. package/es2021.en/plugins/finder/finder.css +1 -1
  198. package/es2021.en/plugins/finder/finder.js +1 -1
  199. package/es2021.en/plugins/finder/finder.min.js +1 -1
  200. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  201. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  202. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  203. package/es2021.en/plugins/google-search/google-search.js +1 -1
  204. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  205. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  206. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  207. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  208. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  209. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  210. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  211. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  212. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  213. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  214. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  215. package/es2021.en/plugins/page-break/page-break.js +1 -1
  216. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  217. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  218. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  219. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  220. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  221. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  222. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  223. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  224. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  225. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  226. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  227. package/es2021.en/plugins/translate/translate.css +1 -1
  228. package/es2021.en/plugins/translate/translate.js +154 -27
  229. package/es2021.en/plugins/translate/translate.min.js +2 -2
  230. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  231. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  232. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  233. package/es5/jodit.css +2 -2
  234. package/es5/jodit.fat.min.js +2 -2
  235. package/es5/jodit.js +2 -2
  236. package/es5/jodit.min.css +2 -2
  237. package/es5/jodit.min.js +2 -2
  238. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  239. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  240. package/es5/plugins/backup/backup.css +1 -1
  241. package/es5/plugins/backup/backup.js +1 -1
  242. package/es5/plugins/backup/backup.min.js +1 -1
  243. package/es5/plugins/button-generator/button-generator.css +1 -1
  244. package/es5/plugins/button-generator/button-generator.js +1 -1
  245. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  246. package/es5/plugins/change-case/change-case.js +1 -1
  247. package/es5/plugins/change-case/change-case.min.js +1 -1
  248. package/es5/plugins/color-picker/color-picker.css +1 -1
  249. package/es5/plugins/color-picker/color-picker.js +1 -1
  250. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  251. package/es5/plugins/emoji/emoji.css +1 -1
  252. package/es5/plugins/emoji/emoji.js +1 -1
  253. package/es5/plugins/emoji/emoji.min.js +1 -1
  254. package/es5/plugins/export-docs/export-docs.js +1 -1
  255. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  256. package/es5/plugins/finder/finder.css +1 -1
  257. package/es5/plugins/finder/finder.js +1 -1
  258. package/es5/plugins/finder/finder.min.js +1 -1
  259. package/es5/plugins/google-maps/google-maps.css +1 -1
  260. package/es5/plugins/google-maps/google-maps.js +1 -1
  261. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  262. package/es5/plugins/google-search/google-search.js +1 -1
  263. package/es5/plugins/google-search/google-search.min.js +1 -1
  264. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  265. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  266. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  267. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  268. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  269. package/es5/plugins/keyboard/keyboard.css +1 -1
  270. package/es5/plugins/keyboard/keyboard.js +1 -1
  271. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  272. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  273. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  274. package/es5/plugins/page-break/page-break.js +1 -1
  275. package/es5/plugins/page-break/page-break.min.js +1 -1
  276. package/es5/plugins/paste-code/paste-code.css +1 -1
  277. package/es5/plugins/paste-code/paste-code.js +1 -1
  278. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  279. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  280. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  281. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  282. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  283. package/es5/plugins/todo-list/todo-list.css +1 -1
  284. package/es5/plugins/todo-list/todo-list.js +1 -1
  285. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  286. package/es5/plugins/translate/translate.css +1 -1
  287. package/es5/plugins/translate/translate.js +154 -27
  288. package/es5/plugins/translate/translate.min.js +2 -2
  289. package/es5/plugins/tune-block/tune-block.css +1 -1
  290. package/es5/plugins/tune-block/tune-block.js +1 -1
  291. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  292. package/esm/plugins/translate/replace-text-fragments.d.ts +7 -0
  293. package/esm/plugins/translate/replace-text-fragments.js +1 -0
  294. package/esm/plugins/translate/translate.js +1 -1
  295. package/package.json +1 -1
  296. package/types/plugins/translate/replace-text-fragments.d.ts +7 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valeriy <chupurnov@gmail.com>
4
- * Version: v4.6.21
4
+ * Version: v4.6.22
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -30,13 +30,14 @@ __webpack_require__.r(__webpack_exports__);
30
30
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97527);
31
31
  /* harmony import */ var _providers_google_google__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56903);
32
32
  /* harmony import */ var _ui_settings_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97195);
33
- /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65478);
34
- /* harmony import */ var jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70799);
35
- /* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38837);
36
- /* harmony import */ var jodit_esm_core_helpers_utils_default_language__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(96325);
37
- /* harmony import */ var jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(50911);
38
- /* harmony import */ var jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10830);
39
- /* harmony import */ var jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(34013);
33
+ /* harmony import */ var _replace_text_fragments__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(75637);
34
+ /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65478);
35
+ /* harmony import */ var jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(70799);
36
+ /* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38837);
37
+ /* harmony import */ var jodit_esm_core_helpers_utils_default_language__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(96325);
38
+ /* harmony import */ var jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(50911);
39
+ /* harmony import */ var jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(10830);
40
+ /* harmony import */ var jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(34013);
40
41
  /*!
41
42
  * Jodit Editor PRO (https://xdsoft.net/jodit/)
42
43
  * See LICENSE.md in the project root for license information.
@@ -54,6 +55,7 @@ __webpack_require__.r(__webpack_exports__);
54
55
 
55
56
 
56
57
 
58
+
57
59
  var Translate = /** @class */ (function (_super) {
58
60
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(Translate, _super);
59
61
  function Translate() {
@@ -72,7 +74,7 @@ var Translate = /** @class */ (function (_super) {
72
74
  }
73
75
  Translate.prototype.__getProvider = function () {
74
76
  var provider = this.jodit.options.translate.provider;
75
- if ((0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__/* .isString */ .K)(provider)) {
77
+ if ((0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__/* .isString */ .K)(provider)) {
76
78
  switch (provider) {
77
79
  case 'google':
78
80
  return new _providers_google_google__WEBPACK_IMPORTED_MODULE_2__/* .GoogleTranslateProvider */ .l(this.j);
@@ -85,7 +87,7 @@ var Translate = /** @class */ (function (_super) {
85
87
  };
86
88
  Translate.prototype.afterInit = function (jodit) {
87
89
  var _this = this;
88
- var defaultLanguage = (0,jodit_esm_core_helpers_utils_default_language__WEBPACK_IMPORTED_MODULE_7__/* .defaultLanguage */ .e)(jodit.o.language, jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_10__/* .JoditPro */ .A.defaultOptions.language), language = (0,jodit_esm_core_helpers_utils_default_language__WEBPACK_IMPORTED_MODULE_7__/* .defaultLanguage */ .e)(jodit.o.language, defaultLanguage);
90
+ var defaultLanguage = (0,jodit_esm_core_helpers_utils_default_language__WEBPACK_IMPORTED_MODULE_8__/* .defaultLanguage */ .e)(jodit.o.language, jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_11__/* .JoditPro */ .A.defaultOptions.language), language = (0,jodit_esm_core_helpers_utils_default_language__WEBPACK_IMPORTED_MODULE_8__/* .defaultLanguage */ .e)(jodit.o.language, defaultLanguage);
89
91
  var provider = this.__getProvider();
90
92
  jodit
91
93
  .registerCommand('translateOptions', {
@@ -110,10 +112,10 @@ var Translate = /** @class */ (function (_super) {
110
112
  });
111
113
  dlg.setContent(settings);
112
114
  dlg.setFooter([
113
- (0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_9__/* .Button */ .$n)(jodit, 'cancel', 'Cancel').onAction(function () {
115
+ (0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_10__/* .Button */ .$n)(jodit, 'cancel', 'Cancel').onAction(function () {
114
116
  return dlg.close();
115
117
  }),
116
- (0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_9__/* .Button */ .$n)(jodit, 'ok', 'Save', 'primary').onAction(function () {
118
+ (0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_10__/* .Button */ .$n)(jodit, 'ok', 'Save', 'primary').onAction(function () {
117
119
  _this.state = newState;
118
120
  dlg.close();
119
121
  })
@@ -128,23 +130,27 @@ var Translate = /** @class */ (function (_super) {
128
130
  })
129
131
  .registerCommand('translate', {
130
132
  exec: function () {
131
- var selection = jodit.s.html;
132
- if (!selection) {
133
+ var selection = (0,_replace_text_fragments__WEBPACK_IMPORTED_MODULE_4__/* .getSelectionFragments */ .a)(jodit).filter(function (fragment) { return fragment.text.trim().length > 0; });
134
+ if (!selection.length) {
133
135
  jodit.message.error('Select text for translate');
134
136
  return;
135
137
  }
136
- return provider
137
- .translate(selection, !_this.state.sourceLang ||
138
+ var source = !_this.state.sourceLang ||
138
139
  _this.state.sourceLang === 'auto'
139
140
  ? language
140
- : _this.state.sourceLang, _this.state.targetLang)
141
- .then(function (response) {
142
- var range = jodit.s.range;
143
- range.deleteContents();
144
- jodit.s.insertNode(jodit.createInside.text(response.text));
145
- })
146
- .catch(function (error) {
147
- jodit.message.error((0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__/* .isString */ .K)(error) ? error : error.message);
141
+ : _this.state.sourceLang;
142
+ var target = _this.state.targetLang;
143
+ return Promise.all(selection.map(function (fragment) {
144
+ provider
145
+ .translate(fragment.text, source, target)
146
+ .then(function (response) {
147
+ fragment.replace(response.text);
148
+ })
149
+ .catch(function (error) {
150
+ jodit.message.error((0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__/* .isString */ .K)(error) ? error : error.message);
151
+ });
152
+ })).then(function () {
153
+ jodit.synchronizeValues();
148
154
  });
149
155
  },
150
156
  hotkeys: jodit.o.translate.hotkeys.translateSelection
@@ -153,12 +159,12 @@ var Translate = /** @class */ (function (_super) {
153
159
  Translate.prototype.beforeDestruct = function (jodit) { };
154
160
  Translate.requires = ['license'];
155
161
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
156
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_4__.persistent
162
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__.persistent
157
163
  ], Translate.prototype, "state", void 0);
158
164
  return Translate;
159
- }(jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__/* .Plugin */ .k));
165
+ }(jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_9__/* .Plugin */ .k));
160
166
 
161
- jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_10__/* .JoditPro */ .A.plugins.add('translate', Translate);
167
+ jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_11__/* .JoditPro */ .A.plugins.add('translate', Translate);
162
168
 
163
169
 
164
170
  /***/ }),
@@ -396,6 +402,127 @@ var GoogleTranslateProvider = /** @class */ (function () {
396
402
 
397
403
  module.exports = "<svg viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M13.98 22L6 30l7.98 8v-6H28v-4H13.98v-6zM42 18l-7.98-8v6H20v4h14.02v6L42 18z\"/> <path d=\"M0 0h48v48H0z\" fill=\"none\"/> </svg>"
398
404
 
405
+ /***/ }),
406
+
407
+ /***/ 75637:
408
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
409
+
410
+ "use strict";
411
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
412
+ /* harmony export */ a: function() { return /* binding */ getSelectionFragments; }
413
+ /* harmony export */ });
414
+ /* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2748);
415
+
416
+ function getSelectionFragments(jodit) {
417
+ var result = [];
418
+ var selection = jodit.s.expandSelection().sel;
419
+ if (!selection || selection.rangeCount === 0 || selection.isCollapsed) {
420
+ return result;
421
+ }
422
+ jodit.s.range.commonAncestorContainer.normalize();
423
+ var range = jodit.s.range;
424
+ var commonAncestorContainer = range.commonAncestorContainer, startContainer = range.startContainer, endContainer = range.endContainer, startOffset = range.startOffset, endOffset = range.endOffset;
425
+ if (startContainer === endContainer) {
426
+ if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(startContainer)) {
427
+ return [replaceTextNode(startContainer, startOffset, endOffset)];
428
+ }
429
+ // One child selected exactly
430
+ if (endOffset - startOffset === 1) {
431
+ var childNode = startContainer.childNodes[startOffset];
432
+ if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(childNode)) {
433
+ return [
434
+ replaceTextNode(childNode, 0, childNode.nodeValue.length)
435
+ ];
436
+ }
437
+ return [replaceElementNode(childNode)];
438
+ }
439
+ // Whole container contents selected
440
+ if (startOffset === 0 &&
441
+ startContainer.childNodes.length === endOffset) {
442
+ return [replaceElementNode(startContainer)];
443
+ }
444
+ // Range spans multiple children of the same container
445
+ for (var i = startOffset; i < endOffset; i++) {
446
+ var childNode = startContainer.childNodes[i];
447
+ if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(childNode)) {
448
+ result.push(replaceTextNode(childNode, 0, childNode.nodeValue.length));
449
+ }
450
+ else {
451
+ result.push(replaceElementNode(childNode));
452
+ }
453
+ }
454
+ return result;
455
+ }
456
+ var allContainedEls = new Set();
457
+ var walker = jodit.ed.createTreeWalker(commonAncestorContainer, NodeFilter.SHOW_ALL, {
458
+ acceptNode: function (n) {
459
+ if (!range.intersectsNode(n))
460
+ return NodeFilter.FILTER_REJECT;
461
+ if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(n, function (el) { return el && allContainedEls.has(el); }, commonAncestorContainer)) {
462
+ return NodeFilter.FILTER_REJECT;
463
+ }
464
+ return NodeFilter.FILTER_ACCEPT;
465
+ }
466
+ });
467
+ var nextNode = walker.nextNode();
468
+ while (nextNode) {
469
+ if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isElement(nextNode) && fullyContains(range, nextNode)) {
470
+ allContainedEls.add(nextNode);
471
+ result.push(replaceElementNode(nextNode));
472
+ }
473
+ else if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(nextNode) && fullyContains(range, nextNode)) {
474
+ result.push(replaceTextNode(nextNode, 0, nextNode.nodeValue.length));
475
+ }
476
+ else if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(nextNode)) {
477
+ var sOffset = 0;
478
+ var eOffset = nextNode.nodeValue.length;
479
+ if (nextNode === startContainer) {
480
+ sOffset = startOffset;
481
+ }
482
+ if (nextNode === endContainer) {
483
+ eOffset = endOffset;
484
+ }
485
+ result.push(replaceTextNode(nextNode, sOffset, eOffset));
486
+ }
487
+ nextNode = walker.nextNode();
488
+ }
489
+ return result;
490
+ }
491
+ var fullyContains = function (r, node) {
492
+ var nr = document.createRange();
493
+ // For containment, we want the node’s *contents*
494
+ try {
495
+ nr.selectNodeContents(node);
496
+ }
497
+ catch (_a) {
498
+ nr.selectNode(node);
499
+ }
500
+ return (r.compareBoundaryPoints(Range.START_TO_START, nr) <= 0 &&
501
+ r.compareBoundaryPoints(Range.END_TO_END, nr) >= 0);
502
+ };
503
+ function replaceTextNode(node, start, end) {
504
+ var text = node.nodeValue.slice(start, end);
505
+ return {
506
+ text: text,
507
+ replace: function (newText) {
508
+ node.nodeValue =
509
+ node.nodeValue.slice(0, start) +
510
+ newText +
511
+ node.nodeValue.slice(end);
512
+ }
513
+ };
514
+ }
515
+ function replaceElementNode(node) {
516
+ var el = node;
517
+ return {
518
+ text: el.innerHTML,
519
+ replace: function (newHTML) {
520
+ el.innerHTML = newHTML;
521
+ }
522
+ };
523
+ }
524
+
525
+
399
526
  /***/ }),
400
527
 
401
528
  /***/ 76697:
@@ -1,10 +1,10 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valeriy <chupurnov@gmail.com>
4
- * Version: v4.6.21
4
+ * Version: v4.6.22
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
8
8
 
9
9
 
10
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var a in n)("object"==typeof exports?exports:t)[a]=n[a]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[954],{3407:function(t,e,n){"use strict";n.r(e),n.d(e,{Translate:function(){return g}});var a=n(31635),i=(n(97527),n(56903)),o=n(97195),s=n(65478),r=n(70799),l=(n(38837),n(96325)),c=n(50911),u=n(10830),h=n(34013),g=function(t){function e(){var e=t.apply(this,(0,a.fX)([],(0,a.zs)(arguments),!1))||this;return e.buttons=[{name:"translate.translate",group:"insert"}],e.state={sourceLang:e.jodit.o.translate.defaultSourceLang||"en",targetLang:e.jodit.o.translate.defaultTargetLang},e}return(0,a.C6)(e,t),e.prototype.__getProvider=function(){var t=this.jodit.options.translate.provider;if((0,r.K)(t)){if("google"===t)return new i.l(this.j);throw new Error("Unknown provider")}return t(this.jodit)},e.prototype.afterInit=function(t){var e=this,n=(0,l.e)(t.o.language,h.A.defaultOptions.language),i=(0,l.e)(t.o.language,n),s=this.__getProvider();t.registerCommand("translateOptions",{exec:function(){return(0,a.sH)(e,void 0,void 0,function(){var e,n,i,r,l=this;return(0,a.YH)(this,function(a){switch(a.label){case 0:return e=this.state,(n=t.dlg()).setHeader("Translate options"),[4,s.supportedLanguages()];case 1:return i=a.sent(),r=new o.g(n,this.state,{sourceList:i.langs,targetList:i.langs,onChange:function(t){e=t}}),n.setContent(r),n.setFooter([(0,u.$n)(t,"cancel","Cancel").onAction(function(){return n.close()}),(0,u.$n)(t,"ok","Save","primary").onAction(function(){l.state=e,n.close()})]),r.bindDestruct(n),n.setSize(500,400).open(!0),[2]}})})},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:function(){var n=t.s.html;if(n)return s.translate(n,e.state.sourceLang&&"auto"!==e.state.sourceLang?e.state.sourceLang:i,e.state.targetLang).then(function(e){t.s.range.deleteContents(),t.s.insertNode(t.createInside.text(e.text))}).catch(function(e){t.message.error((0,r.K)(e)?e:e.message)});t.message.error("Select text for translate")},hotkeys:t.o.translate.hotkeys.translateSelection})},e.prototype.beforeDestruct=function(t){},e.requires=["license"],(0,a.Cg)([s.persistent],e.prototype,"state",void 0),e}(c.k);h.A.plugins.add("translate",g)},17391:function(t,e,n){"use strict";n.d(e,{e:function(){return a}});var a={Afrikaans:"af",Albanian:"sq",Amharic:"am",Arabic:"ar",Armenian:"hy","Assamese*":"as","Aymara*":"ay",Azerbaijani:"az","Bambara*":"bm",Basque:"eu",Belarusian:"be",Bengali:"bn","Bhojpuri*":"bho",Bosnian:"bs",Bulgarian:"bg",Catalan:"ca",Cebuano:"ceb","Chinese (Simplified)":"zh-CN","Chinese (Traditional)":"zh-TW",Corsican:"co",Croatian:"hr",Czech:"cs",Danish:"da","Dhivehi*":"dv","Dogri*":"doi",Dutch:"nl",English:"en",Esperanto:"eo",Estonian:"et","Ewe*":"ee","Filipino (Tagalog)":"fil",Finnish:"fi",French:"fr",Frisian:"fy",Galician:"gl",Georgian:"ka",German:"de",Greek:"el","Guarani*":"gn",Gujarati:"gu","Haitian Creole":"ht",Hausa:"ha",Hawaiian:"haw",Hebrew:"he",Hindi:"hi",Hmong:"hmn",Hungarian:"hu",Icelandic:"is",Igbo:"ig","Ilocano*":"ilo",Indonesian:"id",Irish:"ga",Italian:"it",Japanese:"ja",Kannada:"kn",Kazakh:"kk",Khmer:"km",Kinyarwanda:"rw","Konkani*":"gom",Korean:"ko","Krio*":"kri",Kurdish:"ku","Kurdish (Sorani)*":"ckb",Kyrgyz:"ky",Lao:"lo",Latin:"la",Latvian:"lv","Lingala*":"ln",Lithuanian:"lt","Luganda*":"lg",Luxembourgish:"lb",Macedonian:"mk","Maithili*":"mai",Malagasy:"mg",Malay:"ms",Malayalam:"ml",Maltese:"mt",Maori:"mi",Marathi:"mr","Meiteilon (Manipuri)*":"mni-Mtei",Mizo:"lus",Mongolian:"mn","Myanmar (Burmese)":"my",Nepali:"ne",Norwegian:"no","Nyanja (Chichewa)":"ny","Odia (Oriya)":"or","Oromo*":"om",Pashto:"ps",Persian:"fa",Polish:"pl",Portuguese:"pt",Punjabi:"pa","Quechua*":"qu",Romanian:"ro",Russian:"ru",Samoan:"sm","Sanskrit*":"sa","Scots Gaelic":"gd","Sepedi*":"nso",Serbian:"sr",Sesotho:"st",Shona:"sn",Sindhi:"sd","Sinhala (Sinhalese)":"si",Slovak:"sk",Slovenian:"sl",Somali:"so",Spanish:"es",Sundanese:"su",Swahili:"sw",Swedish:"sv","Tagalog (Filipino)":"tl",Tajik:"tg",Tamil:"ta",Tatar:"tt",Telugu:"te",Thai:"th","Tigrinya*":"ti","Tsonga*":"ts",Turkish:"tr",Turkmen:"tk","Twi (Akan)*":"ak",Ukrainian:"uk",Urdu:"ur",Uyghur:"ug",Uzbek:"uz",Vietnamese:"vi",Welsh:"cy",Xhosa:"xh",Yiddish:"yi",Yoruba:"yo",Zulu:"zu"}},34575:function(t){t.exports='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286H4.545zm1.634-.736L5.5 3.956h-.049l-.679 2.022H6.18z"/> <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zm7.138 9.995c.193.301.402.583.63.846-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6.066 6.066 0 0 1-.415-.492 1.988 1.988 0 0 1-.94.31z"/> </svg>'},56903:function(t,e,n){"use strict";n.d(e,{l:function(){return o}});var a=n(31635),i=(n(82758),n(38837),n(17391)),o=function(){function t(t){this.jodit=t}return t.prototype.__fetch=function(t,e){var n=this;void 0===e&&(e={});var i=this.jodit.o.translate.googleProviderOptions;return this.jodit.fetch(i.url+"?key="+i.key,{method:"POST",data:(0,a.Cl)((0,a.Cl)({},e),{ui:this.jodit.o.language}),contentType:"application/json; charset=utf-8",withCredentials:!1}).then(function(t){return t.json()}).catch(function(t){try{n.jodit.message.error(t.json().message)}catch(t){}})},t.prototype.translate=function(t,e,n){return this.__fetch("translate",{q:t,source:e,target:n,format:"html"}).then(function(t){return{text:t.data.translations[0].translatedText}})},t.prototype.supportedLanguages=function(){return Promise.resolve({langs:i.e})},t}()},74922:function(t){t.exports='<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M13.98 22L6 30l7.98 8v-6H28v-4H13.98v-6zM42 18l-7.98-8v6H20v4h14.02v6L42 18z"/> <path d="M0 0h48v48H0z" fill="none"/> </svg>'},76697:function(t,e,n){"use strict";n.d(e,{F:function(){return h}});var a=n(31635),i=n(82758),o=n(65478),s=n(2748),r=n(21537),l=n(29960),c=n(48538),u=n(80256),h=function(t){function e(e,n){var a,i=t.call(this,e,n)||this;i.options=n,i.state={active:""},i.state.active=n.active;var o=new u.t(e,{placeholder:e.i18n("Filter"),icon:"search",onChange:i.__onChangeFilter,clearButton:!0});return null===(a=i.getElm("input"))||void 0===a||a.appendChild(o.container),i.__onActiveChange(),i}return(0,a.C6)(e,t),e.prototype.className=function(){return"UITranslateList"},Object.defineProperty(e.prototype,"items",{get:function(){return this.getElms("item")},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this,n=[];return Object.keys(t.list).sort().forEach(function(a){var i=t.list[a];n.push("<a role='button' tabindex='0' class='&__item' data-lang='".concat(i,"'>\n\t\t\t\t\t\t<span class='&__item-key'>").concat(i,"</span>\n\t\t\t\t\t\t<span class='&__item-title'>").concat(e.j.i18n(a),"</span>\n\t\t\t\t\t</a>"))}),"<div class='&'>\n\t\t\t<div class='&__input'></div>\n\t\t\t<div class='&__list'>".concat(n.join(""),"</div>\n\t\t</div>")},e.prototype.__onChangeFilter=function(t){this.items.forEach(function(e){var n,a,i=null!==(a=null===(n=e.textContent)||void 0===n?void 0:n.toLowerCase())&&void 0!==a?a:"";(0,l.C)(e,"data-hidden","true"!==(0,l.C)(e,"data-active")&&!i.includes(t.toLowerCase()))})},e.prototype.__scrollToActive=function(){var t=this.container.querySelector('[data-active="true"]'),e=this.getElm("list");t&&e&&(0,r.scrollIntoViewIfNeeded)(t,e,this.j.od)},e.prototype.onClickItem=function(t){if("keydown"!==t.type||!("key"in t)||t.key===i.KEY_ENTER){var e=t.target;if(s.J.isHTMLElement(e)&&e.getAttribute("data-lang")){var n=(0,l.C)(e,"data-lang");this.options.onChange(n),this.state.active=n}}},e.prototype.__onActiveChange=function(){var t=this;this.items.forEach(function(e){return(0,l.C)(e,"data-active",(0,l.C)(e,"data-lang")===t.state.active)}),this.__scrollToActive()},(0,a.Cg)([(0,o.debounce)()],e.prototype,"__onChangeFilter",null),(0,a.Cg)([(0,o.watch)(":afterOpen")],e.prototype,"__scrollToActive",null),(0,a.Cg)([(0,o.watch)(["container:click","container:keydown"])],e.prototype,"onClickItem",null),(0,a.Cg)([(0,o.watch)("state.active"),(0,o.debounce)()],e.prototype,"__onActiveChange",null),(0,a.Cg)([o.component],e)}(c.D)},97195:function(t,e,n){"use strict";n.d(e,{g:function(){return r}});var a=n(31635),i=n(65478),o=n(67510),s=n(76697),r=function(t){function e(e,n,i){var o,r,l=t.call(this,e)||this;return l.state=n,l.options=i,l.__sourceList=new s.F(e,{list:i.sourceList,active:n.sourceLang,onChange:function(t){l.state.sourceLang=t,l.options.onChange((0,a.Cl)({},l.state))}}),null===(o=l.getElm("source-list"))||void 0===o||o.appendChild(l.__sourceList.container),l.__targetList=new s.F(e,{list:i.targetList,active:n.targetLang,onChange:function(t){l.state.targetLang=t,l.options.onChange((0,a.Cl)({},l.state))}}),null===(r=l.getElm("target-list"))||void 0===r||r.appendChild(l.__targetList.container),l}return(0,a.C6)(e,t),e.prototype.className=function(){return"UITranslateSettings"},e.prototype.render=function(){return"<div>\n\t\t\t<div class='&__list &__source-list'></div>\n\t\t\t<div class='&__arrow'>\n\t\t\t\t<a class='&__arrow-swap'>*translate-swap*</a>\n\t\t\t</div>\n\t\t\t<div class='&__list &__target-list'></div>\n\t\t</div>"},e.prototype.__onSwap=function(){var t=this.state.sourceLang;this.state.sourceLang=this.state.targetLang,this.state.targetLang=t,this.__sourceList.state.active=this.state.sourceLang,this.__targetList.state.active=this.state.targetLang,this.options.onChange((0,a.Cl)({},this.state))},(0,a.Cg)([(0,i.watch)("arrow-swap:click")],e.prototype,"__onSwap",null),(0,a.Cg)([i.component],e)}(o.D$)},97527:function(t,e,n){"use strict";var a=n(74922),i=n.n(a),o=n(34575),s=n.n(o),r=n(6441),l=n(12153);r.T.prototype.translate={hotkeys:{translateSelection:["ctrl+shift+o","cmd+shift+o"],translateOptions:["ctrl+shift+p","cmd+shift+p"]},provider:"google",googleProviderOptions:{url:"https://translation.googleapis.com/language/translate/v2",key:""},defaultSourceLang:"",defaultTargetLang:"de"},r.T.prototype.controls.translate={translate:{tooltip:"Translate selected text",icon:"translate",command:"translate",exec:function(t){t.execCommand("translate")},list:["Options"],childExec:function(t,e,n){t.execCommand("translate"+n.control.name)},mods:{stroke:!1}}},l.I.set("translate",s()).set("translate-swap",i())}},function(t){return t(t.s=3407)}])});
10
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var a in n)("object"==typeof exports?exports:t)[a]=n[a]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[954],{3407:function(t,e,n){"use strict";n.r(e),n.d(e,{Translate:function(){return g}});var a=n(31635),i=(n(97527),n(56903)),o=n(97195),r=n(75637),s=n(65478),l=n(70799),c=(n(38837),n(96325)),u=n(50911),h=n(10830),d=n(34013),g=function(t){function e(){var e=t.apply(this,(0,a.fX)([],(0,a.zs)(arguments),!1))||this;return e.buttons=[{name:"translate.translate",group:"insert"}],e.state={sourceLang:e.jodit.o.translate.defaultSourceLang||"en",targetLang:e.jodit.o.translate.defaultTargetLang},e}return(0,a.C6)(e,t),e.prototype.__getProvider=function(){var t=this.jodit.options.translate.provider;if((0,l.K)(t)){if("google"===t)return new i.l(this.j);throw new Error("Unknown provider")}return t(this.jodit)},e.prototype.afterInit=function(t){var e=this,n=(0,c.e)(t.o.language,d.A.defaultOptions.language),i=(0,c.e)(t.o.language,n),s=this.__getProvider();t.registerCommand("translateOptions",{exec:function(){return(0,a.sH)(e,void 0,void 0,function(){var e,n,i,r,l=this;return(0,a.YH)(this,function(a){switch(a.label){case 0:return e=this.state,(n=t.dlg()).setHeader("Translate options"),[4,s.supportedLanguages()];case 1:return i=a.sent(),r=new o.g(n,this.state,{sourceList:i.langs,targetList:i.langs,onChange:function(t){e=t}}),n.setContent(r),n.setFooter([(0,h.$n)(t,"cancel","Cancel").onAction(function(){return n.close()}),(0,h.$n)(t,"ok","Save","primary").onAction(function(){l.state=e,n.close()})]),r.bindDestruct(n),n.setSize(500,400).open(!0),[2]}})})},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:function(){var n=(0,r.a)(t).filter(function(t){return t.text.trim().length>0});if(n.length){var a=e.state.sourceLang&&"auto"!==e.state.sourceLang?e.state.sourceLang:i,o=e.state.targetLang;return Promise.all(n.map(function(e){s.translate(e.text,a,o).then(function(t){e.replace(t.text)}).catch(function(e){t.message.error((0,l.K)(e)?e:e.message)})})).then(function(){t.synchronizeValues()})}t.message.error("Select text for translate")},hotkeys:t.o.translate.hotkeys.translateSelection})},e.prototype.beforeDestruct=function(t){},e.requires=["license"],(0,a.Cg)([s.persistent],e.prototype,"state",void 0),e}(u.k);d.A.plugins.add("translate",g)},17391:function(t,e,n){"use strict";n.d(e,{e:function(){return a}});var a={Afrikaans:"af",Albanian:"sq",Amharic:"am",Arabic:"ar",Armenian:"hy","Assamese*":"as","Aymara*":"ay",Azerbaijani:"az","Bambara*":"bm",Basque:"eu",Belarusian:"be",Bengali:"bn","Bhojpuri*":"bho",Bosnian:"bs",Bulgarian:"bg",Catalan:"ca",Cebuano:"ceb","Chinese (Simplified)":"zh-CN","Chinese (Traditional)":"zh-TW",Corsican:"co",Croatian:"hr",Czech:"cs",Danish:"da","Dhivehi*":"dv","Dogri*":"doi",Dutch:"nl",English:"en",Esperanto:"eo",Estonian:"et","Ewe*":"ee","Filipino (Tagalog)":"fil",Finnish:"fi",French:"fr",Frisian:"fy",Galician:"gl",Georgian:"ka",German:"de",Greek:"el","Guarani*":"gn",Gujarati:"gu","Haitian Creole":"ht",Hausa:"ha",Hawaiian:"haw",Hebrew:"he",Hindi:"hi",Hmong:"hmn",Hungarian:"hu",Icelandic:"is",Igbo:"ig","Ilocano*":"ilo",Indonesian:"id",Irish:"ga",Italian:"it",Japanese:"ja",Kannada:"kn",Kazakh:"kk",Khmer:"km",Kinyarwanda:"rw","Konkani*":"gom",Korean:"ko","Krio*":"kri",Kurdish:"ku","Kurdish (Sorani)*":"ckb",Kyrgyz:"ky",Lao:"lo",Latin:"la",Latvian:"lv","Lingala*":"ln",Lithuanian:"lt","Luganda*":"lg",Luxembourgish:"lb",Macedonian:"mk","Maithili*":"mai",Malagasy:"mg",Malay:"ms",Malayalam:"ml",Maltese:"mt",Maori:"mi",Marathi:"mr","Meiteilon (Manipuri)*":"mni-Mtei",Mizo:"lus",Mongolian:"mn","Myanmar (Burmese)":"my",Nepali:"ne",Norwegian:"no","Nyanja (Chichewa)":"ny","Odia (Oriya)":"or","Oromo*":"om",Pashto:"ps",Persian:"fa",Polish:"pl",Portuguese:"pt",Punjabi:"pa","Quechua*":"qu",Romanian:"ro",Russian:"ru",Samoan:"sm","Sanskrit*":"sa","Scots Gaelic":"gd","Sepedi*":"nso",Serbian:"sr",Sesotho:"st",Shona:"sn",Sindhi:"sd","Sinhala (Sinhalese)":"si",Slovak:"sk",Slovenian:"sl",Somali:"so",Spanish:"es",Sundanese:"su",Swahili:"sw",Swedish:"sv","Tagalog (Filipino)":"tl",Tajik:"tg",Tamil:"ta",Tatar:"tt",Telugu:"te",Thai:"th","Tigrinya*":"ti","Tsonga*":"ts",Turkish:"tr",Turkmen:"tk","Twi (Akan)*":"ak",Ukrainian:"uk",Urdu:"ur",Uyghur:"ug",Uzbek:"uz",Vietnamese:"vi",Welsh:"cy",Xhosa:"xh",Yiddish:"yi",Yoruba:"yo",Zulu:"zu"}},34575:function(t){t.exports='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286H4.545zm1.634-.736L5.5 3.956h-.049l-.679 2.022H6.18z"/> <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zm7.138 9.995c.193.301.402.583.63.846-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6.066 6.066 0 0 1-.415-.492 1.988 1.988 0 0 1-.94.31z"/> </svg>'},56903:function(t,e,n){"use strict";n.d(e,{l:function(){return o}});var a=n(31635),i=(n(82758),n(38837),n(17391)),o=function(){function t(t){this.jodit=t}return t.prototype.__fetch=function(t,e){var n=this;void 0===e&&(e={});var i=this.jodit.o.translate.googleProviderOptions;return this.jodit.fetch(i.url+"?key="+i.key,{method:"POST",data:(0,a.Cl)((0,a.Cl)({},e),{ui:this.jodit.o.language}),contentType:"application/json; charset=utf-8",withCredentials:!1}).then(function(t){return t.json()}).catch(function(t){try{n.jodit.message.error(t.json().message)}catch(t){}})},t.prototype.translate=function(t,e,n){return this.__fetch("translate",{q:t,source:e,target:n,format:"html"}).then(function(t){return{text:t.data.translations[0].translatedText}})},t.prototype.supportedLanguages=function(){return Promise.resolve({langs:i.e})},t}()},74922:function(t){t.exports='<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M13.98 22L6 30l7.98 8v-6H28v-4H13.98v-6zM42 18l-7.98-8v6H20v4h14.02v6L42 18z"/> <path d="M0 0h48v48H0z" fill="none"/> </svg>'},75637:function(t,e,n){"use strict";n.d(e,{a:function(){return i}});var a=n(2748);function i(t){var e=[],n=t.s.expandSelection().sel;if(!n||0===n.rangeCount||n.isCollapsed)return e;t.s.range.commonAncestorContainer.normalize();var i=t.s.range,l=i.commonAncestorContainer,c=i.startContainer,u=i.endContainer,h=i.startOffset,d=i.endOffset;if(c===u){if(a.J.isText(c))return[r(c,h,d)];if(d-h===1)return a.J.isText(p=c.childNodes[h])?[r(p,0,p.nodeValue.length)]:[s(p)];if(0===h&&c.childNodes.length===d)return[s(c)];for(var g=h;d>g;g++){var p;a.J.isText(p=c.childNodes[g])?e.push(r(p,0,p.nodeValue.length)):e.push(s(p))}return e}for(var f=new Set,v=t.ed.createTreeWalker(l,NodeFilter.SHOW_ALL,{acceptNode:function(t){return i.intersectsNode(t)?a.J.closest(t,function(t){return t&&f.has(t)},l)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),m=v.nextNode();m;){if(a.J.isElement(m)&&o(i,m))f.add(m),e.push(s(m));else if(a.J.isText(m)&&o(i,m))e.push(r(m,0,m.nodeValue.length));else if(a.J.isText(m)){var _=0,y=m.nodeValue.length;m===c&&(_=h),m===u&&(y=d),e.push(r(m,_,y))}m=v.nextNode()}return e}var o=function(t,e){var n=document.createRange();try{n.selectNodeContents(e)}catch(t){n.selectNode(e)}return 0>=t.compareBoundaryPoints(Range.START_TO_START,n)&&t.compareBoundaryPoints(Range.END_TO_END,n)>=0};function r(t,e,n){return{text:t.nodeValue.slice(e,n),replace:function(a){t.nodeValue=t.nodeValue.slice(0,e)+a+t.nodeValue.slice(n)}}}function s(t){var e=t;return{text:e.innerHTML,replace:function(t){e.innerHTML=t}}}},76697:function(t,e,n){"use strict";n.d(e,{F:function(){return h}});var a=n(31635),i=n(82758),o=n(65478),r=n(2748),s=n(21537),l=n(29960),c=n(48538),u=n(80256),h=function(t){function e(e,n){var a,i=t.call(this,e,n)||this;i.options=n,i.state={active:""},i.state.active=n.active;var o=new u.t(e,{placeholder:e.i18n("Filter"),icon:"search",onChange:i.__onChangeFilter,clearButton:!0});return null===(a=i.getElm("input"))||void 0===a||a.appendChild(o.container),i.__onActiveChange(),i}return(0,a.C6)(e,t),e.prototype.className=function(){return"UITranslateList"},Object.defineProperty(e.prototype,"items",{get:function(){return this.getElms("item")},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this,n=[];return Object.keys(t.list).sort().forEach(function(a){var i=t.list[a];n.push("<a role='button' tabindex='0' class='&__item' data-lang='".concat(i,"'>\n\t\t\t\t\t\t<span class='&__item-key'>").concat(i,"</span>\n\t\t\t\t\t\t<span class='&__item-title'>").concat(e.j.i18n(a),"</span>\n\t\t\t\t\t</a>"))}),"<div class='&'>\n\t\t\t<div class='&__input'></div>\n\t\t\t<div class='&__list'>".concat(n.join(""),"</div>\n\t\t</div>")},e.prototype.__onChangeFilter=function(t){this.items.forEach(function(e){var n,a,i=null!==(a=null===(n=e.textContent)||void 0===n?void 0:n.toLowerCase())&&void 0!==a?a:"";(0,l.C)(e,"data-hidden","true"!==(0,l.C)(e,"data-active")&&!i.includes(t.toLowerCase()))})},e.prototype.__scrollToActive=function(){var t=this.container.querySelector('[data-active="true"]'),e=this.getElm("list");t&&e&&(0,s.scrollIntoViewIfNeeded)(t,e,this.j.od)},e.prototype.onClickItem=function(t){if("keydown"!==t.type||!("key"in t)||t.key===i.KEY_ENTER){var e=t.target;if(r.J.isHTMLElement(e)&&e.getAttribute("data-lang")){var n=(0,l.C)(e,"data-lang");this.options.onChange(n),this.state.active=n}}},e.prototype.__onActiveChange=function(){var t=this;this.items.forEach(function(e){return(0,l.C)(e,"data-active",(0,l.C)(e,"data-lang")===t.state.active)}),this.__scrollToActive()},(0,a.Cg)([(0,o.debounce)()],e.prototype,"__onChangeFilter",null),(0,a.Cg)([(0,o.watch)(":afterOpen")],e.prototype,"__scrollToActive",null),(0,a.Cg)([(0,o.watch)(["container:click","container:keydown"])],e.prototype,"onClickItem",null),(0,a.Cg)([(0,o.watch)("state.active"),(0,o.debounce)()],e.prototype,"__onActiveChange",null),(0,a.Cg)([o.component],e)}(c.D)},97195:function(t,e,n){"use strict";n.d(e,{g:function(){return s}});var a=n(31635),i=n(65478),o=n(67510),r=n(76697),s=function(t){function e(e,n,i){var o,s,l=t.call(this,e)||this;return l.state=n,l.options=i,l.__sourceList=new r.F(e,{list:i.sourceList,active:n.sourceLang,onChange:function(t){l.state.sourceLang=t,l.options.onChange((0,a.Cl)({},l.state))}}),null===(o=l.getElm("source-list"))||void 0===o||o.appendChild(l.__sourceList.container),l.__targetList=new r.F(e,{list:i.targetList,active:n.targetLang,onChange:function(t){l.state.targetLang=t,l.options.onChange((0,a.Cl)({},l.state))}}),null===(s=l.getElm("target-list"))||void 0===s||s.appendChild(l.__targetList.container),l}return(0,a.C6)(e,t),e.prototype.className=function(){return"UITranslateSettings"},e.prototype.render=function(){return"<div>\n\t\t\t<div class='&__list &__source-list'></div>\n\t\t\t<div class='&__arrow'>\n\t\t\t\t<a class='&__arrow-swap'>*translate-swap*</a>\n\t\t\t</div>\n\t\t\t<div class='&__list &__target-list'></div>\n\t\t</div>"},e.prototype.__onSwap=function(){var t=this.state.sourceLang;this.state.sourceLang=this.state.targetLang,this.state.targetLang=t,this.__sourceList.state.active=this.state.sourceLang,this.__targetList.state.active=this.state.targetLang,this.options.onChange((0,a.Cl)({},this.state))},(0,a.Cg)([(0,i.watch)("arrow-swap:click")],e.prototype,"__onSwap",null),(0,a.Cg)([i.component],e)}(o.D$)},97527:function(t,e,n){"use strict";var a=n(74922),i=n.n(a),o=n(34575),r=n.n(o),s=n(6441),l=n(12153);s.T.prototype.translate={hotkeys:{translateSelection:["ctrl+shift+o","cmd+shift+o"],translateOptions:["ctrl+shift+p","cmd+shift+p"]},provider:"google",googleProviderOptions:{url:"https://translation.googleapis.com/language/translate/v2",key:""},defaultSourceLang:"",defaultTargetLang:"de"},s.T.prototype.controls.translate={translate:{tooltip:"Translate selected text",icon:"translate",command:"translate",exec:function(t){t.execCommand("translate")},list:["Options"],childExec:function(t,e,n){t.execCommand("translate"+n.control.name)},mods:{stroke:!1}}},l.I.set("translate",r()).set("translate-swap",i())}},function(t){return t(t.s=3407)}])});
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valeriy <chupurnov@gmail.com>
4
- * Version: v4.6.21
4
+ * Version: v4.6.22
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valeriy <chupurnov@gmail.com>
4
- * Version: v4.6.21
4
+ * Version: v4.6.22
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit-pro - PRO Version of Jodit Editor
3
3
  * Author: Chupurnov Valeriy <chupurnov@gmail.com>
4
- * Version: v4.6.21
4
+ * Version: v4.6.22
5
5
  * Url: https://xdsoft.net/jodit/pro/
6
6
  * License(s): SEE LICENSE IN LICENSE.md
7
7
  */
@@ -0,0 +1,7 @@
1
+ import type { IJodit } from "jodit/esm/types/index";
2
+ interface ReplacementFragment {
3
+ text: string;
4
+ replace: (newContent: string) => void;
5
+ }
6
+ export declare function getSelectionFragments(jodit: IJodit): ReplacementFragment[];
7
+ export {};
@@ -0,0 +1 @@
1
+ import{Dom as e}from"jodit/esm/core/dom/dom.js";export function getSelectionFragments(t){const n=[],o=t.s.expandSelection().sel;if(!o||0===o.rangeCount||o.isCollapsed)return n;t.s.range.commonAncestorContainer.normalize();const r=t.s.range,{commonAncestorContainer:l,startContainer:s,endContainer:c,startOffset:a,endOffset:d}=r;if(s===c){if(e.isText(s))return[replaceTextNode(s,a,d)];if(d-a===1){const t=s.childNodes[a];return e.isText(t)?[replaceTextNode(t,0,t.nodeValue.length)]:[replaceElementNode(t)]}if(0===a&&s.childNodes.length===d)return[replaceElementNode(s)];for(let t=a;t<d;t++){const o=s.childNodes[t];e.isText(o)?n.push(replaceTextNode(o,0,o.nodeValue.length)):n.push(replaceElementNode(o))}return n}const i=new Set,u=t.ed.createTreeWalker(l,NodeFilter.SHOW_ALL,{acceptNode:t=>r.intersectsNode(t)?e.closest(t,e=>e&&i.has(e),l)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let N=u.nextNode();for(;N;){if(e.isElement(N)&&fullyContains(r,N))i.add(N),n.push(replaceElementNode(N));else if(e.isText(N)&&fullyContains(r,N))n.push(replaceTextNode(N,0,N.nodeValue.length));else if(e.isText(N)){let e=0,t=N.nodeValue.length;N===s&&(e=a),N===c&&(t=d),n.push(replaceTextNode(N,e,t))}N=u.nextNode()}return n}const fullyContains=(e,t)=>{const n=document.createRange();try{n.selectNodeContents(t)}catch(e){n.selectNode(t)}return e.compareBoundaryPoints(Range.START_TO_START,n)<=0&&e.compareBoundaryPoints(Range.END_TO_END,n)>=0};function replaceTextNode(e,t,n){return{text:e.nodeValue.slice(t,n),replace:o=>{e.nodeValue=e.nodeValue.slice(0,t)+o+e.nodeValue.slice(n)}}}function replaceElementNode(e){const t=e;return{text:t.innerHTML,replace:e=>{t.innerHTML=e}}}
@@ -3,4 +3,4 @@
3
3
  * See LICENSE.md in the project root for license information.
4
4
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5
5
  */
6
- var t=this&&this.__decorate||function(t,e,s,r){var o,a=arguments.length,n=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,r);else for(var i=t.length-1;i>=0;i--)(o=t[i])&&(n=(a<3?o(n):a>3?o(e,s,n):o(e,s))||n);return a>3&&n&&Object.defineProperty(e,s,n),n};import"./config.js";import{GoogleTranslateProvider as e}from"./providers/google/google.js";import{UITranslateSettings as s}from"./ui/settings/settings.js";import{persistent as r}from"jodit/esm/core/decorators/index.js";import{isFunction as o}from"jodit/esm/core/helpers/checker/is-function.js";import{isString as a}from"jodit/esm/core/helpers/checker/is-string.js";import{assert as n}from"jodit/esm/core/helpers/utils/assert.js";import{defaultLanguage as i}from"jodit/esm/core/helpers/utils/default-language.js";import{Plugin as l}from"jodit/esm/core/plugin/index.js";import{Button as c}from"jodit/esm/core/ui/button/button/button.js";import{JoditPro as g}from"../../jodit-pro.js";export class Translate extends l{constructor(){super(...arguments),this.buttons=[{name:"translate.translate",group:"insert"}],this.state={sourceLang:this.jodit.o.translate.defaultSourceLang||"en",targetLang:this.jodit.o.translate.defaultTargetLang}}__getProvider(){const{provider:t}=this.jodit.options.translate;if(a(t)){if("google"===t)return new e(this.j);throw new Error("Unknown provider")}return n(o(t),"Provider must be a function"),t(this.jodit)}afterInit(t){const e=i(t.o.language,g.defaultOptions.language),r=i(t.o.language,e),o=this.__getProvider();t.registerCommand("translateOptions",{exec:async()=>{let e=this.state;const r=t.dlg();r.setHeader("Translate options");const a=await o.supportedLanguages(),n=new s(r,this.state,{sourceList:a.langs,targetList:a.langs,onChange(t){e=t}});r.setContent(n),r.setFooter([c(t,"cancel","Cancel").onAction(()=>r.close()),c(t,"ok","Save","primary").onAction(()=>{this.state=e,r.close()})]),n.bindDestruct(r),r.setSize(500,400).open(!0)},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:()=>{const e=t.s.html;if(e)return o.translate(e,this.state.sourceLang&&"auto"!==this.state.sourceLang?this.state.sourceLang:r,this.state.targetLang).then(e=>{t.s.range.deleteContents(),t.s.insertNode(t.createInside.text(e.text))}).catch(e=>{t.message.error(a(e)?e:e.message)});t.message.error("Select text for translate")},hotkeys:t.o.translate.hotkeys.translateSelection})}beforeDestruct(t){}}Translate.requires=["license"],t([r],Translate.prototype,"state",void 0),g.plugins.add("translate",Translate);
6
+ var t=this&&this.__decorate||function(t,e,r,s){var o,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,s);else for(var i=t.length-1;i>=0;i--)(o=t[i])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n};import"./config.js";import{GoogleTranslateProvider as e}from"./providers/google/google.js";import{UITranslateSettings as r}from"./ui/settings/settings.js";import{getSelectionFragments as s}from"./replace-text-fragments.js";import{persistent as o}from"jodit/esm/core/decorators/index.js";import{isFunction as a}from"jodit/esm/core/helpers/checker/is-function.js";import{isString as n}from"jodit/esm/core/helpers/checker/is-string.js";import{assert as i}from"jodit/esm/core/helpers/utils/assert.js";import{defaultLanguage as l}from"jodit/esm/core/helpers/utils/default-language.js";import{Plugin as c}from"jodit/esm/core/plugin/index.js";import{Button as g}from"jodit/esm/core/ui/button/button/button.js";import{JoditPro as u}from"../../jodit-pro.js";export class Translate extends c{constructor(){super(...arguments),this.buttons=[{name:"translate.translate",group:"insert"}],this.state={sourceLang:this.jodit.o.translate.defaultSourceLang||"en",targetLang:this.jodit.o.translate.defaultTargetLang}}__getProvider(){const{provider:t}=this.jodit.options.translate;if(n(t)){if("google"===t)return new e(this.j);throw new Error("Unknown provider")}return i(a(t),"Provider must be a function"),t(this.jodit)}afterInit(t){const e=l(t.o.language,u.defaultOptions.language),o=l(t.o.language,e),a=this.__getProvider();t.registerCommand("translateOptions",{exec:async()=>{let e=this.state;const s=t.dlg();s.setHeader("Translate options");const o=await a.supportedLanguages(),n=new r(s,this.state,{sourceList:o.langs,targetList:o.langs,onChange(t){e=t}});s.setContent(n),s.setFooter([g(t,"cancel","Cancel").onAction(()=>s.close()),g(t,"ok","Save","primary").onAction(()=>{this.state=e,s.close()})]),n.bindDestruct(s),s.setSize(500,400).open(!0)},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:()=>{const e=s(t).filter(t=>t.text.trim().length>0);if(!e.length)return void t.message.error("Select text for translate");const r=this.state.sourceLang&&"auto"!==this.state.sourceLang?this.state.sourceLang:o,i=this.state.targetLang;return Promise.all(e.map(e=>{a.translate(e.text,r,i).then(t=>{e.replace(t.text)}).catch(e=>{t.message.error(n(e)?e:e.message)})})).then(()=>{t.synchronizeValues()})},hotkeys:t.o.translate.hotkeys.translateSelection})}beforeDestruct(t){}}Translate.requires=["license"],t([o],Translate.prototype,"state",void 0),u.plugins.add("translate",Translate);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit-pro",
3
- "version": "4.6.21",
3
+ "version": "4.6.22",
4
4
  "author": "Chupurnov Valeriy <chupurnov@gmail.com>",
5
5
  "homepage": "https://xdsoft.net/jodit/pro/",
6
6
  "bugs": {
@@ -0,0 +1,7 @@
1
+ import type { IJodit } from "jodit/esm/types/index";
2
+ interface ReplacementFragment {
3
+ text: string;
4
+ replace: (newContent: string) => void;
5
+ }
6
+ export declare function getSelectionFragments(jodit: IJodit): ReplacementFragment[];
7
+ export {};