jodit-pro 4.6.21 → 4.6.23
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.
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +5 -4
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/autocomplete/autocomplete.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2015/plugins/backup/backup.css +1 -1
- package/es2015/plugins/backup/backup.js +1 -1
- package/es2015/plugins/backup/backup.min.js +1 -1
- package/es2015/plugins/button-generator/button-generator.css +1 -1
- package/es2015/plugins/button-generator/button-generator.js +1 -1
- package/es2015/plugins/button-generator/button-generator.min.js +1 -1
- package/es2015/plugins/change-case/change-case.js +1 -1
- package/es2015/plugins/change-case/change-case.min.js +1 -1
- package/es2015/plugins/color-picker/color-picker.css +1 -1
- package/es2015/plugins/color-picker/color-picker.js +1 -1
- package/es2015/plugins/color-picker/color-picker.min.js +1 -1
- package/es2015/plugins/emoji/emoji.css +1 -1
- package/es2015/plugins/emoji/emoji.js +1 -1
- package/es2015/plugins/emoji/emoji.min.js +1 -1
- package/es2015/plugins/export-docs/export-docs.js +1 -1
- package/es2015/plugins/export-docs/export-docs.min.js +1 -1
- package/es2015/plugins/finder/finder.css +1 -1
- package/es2015/plugins/finder/finder.js +1 -1
- package/es2015/plugins/finder/finder.min.js +1 -1
- package/es2015/plugins/google-maps/google-maps.css +1 -1
- package/es2015/plugins/google-maps/google-maps.js +1 -1
- package/es2015/plugins/google-maps/google-maps.min.js +1 -1
- package/es2015/plugins/google-search/google-search.js +1 -1
- package/es2015/plugins/google-search/google-search.min.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2015/plugins/keyboard/keyboard.css +1 -1
- package/es2015/plugins/keyboard/keyboard.js +1 -1
- package/es2015/plugins/keyboard/keyboard.min.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2015/plugins/page-break/page-break.js +1 -1
- package/es2015/plugins/page-break/page-break.min.js +1 -1
- package/es2015/plugins/paste-code/paste-code.css +1 -1
- package/es2015/plugins/paste-code/paste-code.js +1 -1
- package/es2015/plugins/paste-code/paste-code.min.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2015/plugins/todo-list/todo-list.css +1 -1
- package/es2015/plugins/todo-list/todo-list.js +1 -1
- package/es2015/plugins/todo-list/todo-list.min.js +1 -1
- package/es2015/plugins/translate/translate.css +1 -1
- package/es2015/plugins/translate/translate.js +154 -27
- package/es2015/plugins/translate/translate.min.js +2 -2
- package/es2015/plugins/tune-block/tune-block.css +1 -1
- package/es2015/plugins/tune-block/tune-block.js +1 -1
- package/es2015/plugins/tune-block/tune-block.min.js +1 -1
- package/es2018/jodit.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +5 -4
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/autocomplete/autocomplete.js +1 -1
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.css +1 -1
- package/es2018/plugins/backup/backup.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.css +1 -1
- package/es2018/plugins/button-generator/button-generator.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/color-picker/color-picker.css +1 -1
- package/es2018/plugins/color-picker/color-picker.js +1 -1
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.css +1 -1
- package/es2018/plugins/emoji/emoji.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.css +1 -1
- package/es2018/plugins/finder/finder.js +1 -1
- package/es2018/plugins/finder/finder.min.js +1 -1
- package/es2018/plugins/google-maps/google-maps.css +1 -1
- package/es2018/plugins/google-maps/google-maps.js +1 -1
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/keyboard/keyboard.css +1 -1
- package/es2018/plugins/keyboard/keyboard.js +1 -1
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.css +1 -1
- package/es2018/plugins/paste-code/paste-code.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/todo-list/todo-list.css +1 -1
- package/es2018/plugins/todo-list/todo-list.js +1 -1
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.css +1 -1
- package/es2018/plugins/translate/translate.js +154 -27
- package/es2018/plugins/translate/translate.min.js +2 -2
- package/es2018/plugins/tune-block/tune-block.css +1 -1
- package/es2018/plugins/tune-block/tune-block.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +5 -4
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021/plugins/backup/backup.css +1 -1
- package/es2021/plugins/backup/backup.js +1 -1
- package/es2021/plugins/backup/backup.min.js +1 -1
- package/es2021/plugins/button-generator/button-generator.css +1 -1
- package/es2021/plugins/button-generator/button-generator.js +1 -1
- package/es2021/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021/plugins/change-case/change-case.js +1 -1
- package/es2021/plugins/change-case/change-case.min.js +1 -1
- package/es2021/plugins/color-picker/color-picker.css +1 -1
- package/es2021/plugins/color-picker/color-picker.js +1 -1
- package/es2021/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021/plugins/emoji/emoji.css +1 -1
- package/es2021/plugins/emoji/emoji.js +1 -1
- package/es2021/plugins/emoji/emoji.min.js +1 -1
- package/es2021/plugins/export-docs/export-docs.js +1 -1
- package/es2021/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021/plugins/finder/finder.css +1 -1
- package/es2021/plugins/finder/finder.js +1 -1
- package/es2021/plugins/finder/finder.min.js +1 -1
- package/es2021/plugins/google-maps/google-maps.css +1 -1
- package/es2021/plugins/google-maps/google-maps.js +1 -1
- package/es2021/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021/plugins/google-search/google-search.js +1 -1
- package/es2021/plugins/google-search/google-search.min.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021/plugins/keyboard/keyboard.css +1 -1
- package/es2021/plugins/keyboard/keyboard.js +1 -1
- package/es2021/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021/plugins/page-break/page-break.js +1 -1
- package/es2021/plugins/page-break/page-break.min.js +1 -1
- package/es2021/plugins/paste-code/paste-code.css +1 -1
- package/es2021/plugins/paste-code/paste-code.js +1 -1
- package/es2021/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021/plugins/todo-list/todo-list.css +1 -1
- package/es2021/plugins/todo-list/todo-list.js +1 -1
- package/es2021/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021/plugins/translate/translate.css +1 -1
- package/es2021/plugins/translate/translate.js +154 -27
- package/es2021/plugins/translate/translate.min.js +2 -2
- package/es2021/plugins/tune-block/tune-block.css +1 -1
- package/es2021/plugins/tune-block/tune-block.js +1 -1
- package/es2021/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +5 -4
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021.en/plugins/backup/backup.css +1 -1
- package/es2021.en/plugins/backup/backup.js +1 -1
- package/es2021.en/plugins/backup/backup.min.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.css +1 -1
- package/es2021.en/plugins/button-generator/button-generator.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021.en/plugins/change-case/change-case.js +1 -1
- package/es2021.en/plugins/change-case/change-case.min.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.css +1 -1
- package/es2021.en/plugins/color-picker/color-picker.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021.en/plugins/emoji/emoji.css +1 -1
- package/es2021.en/plugins/emoji/emoji.js +1 -1
- package/es2021.en/plugins/emoji/emoji.min.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021.en/plugins/finder/finder.css +1 -1
- package/es2021.en/plugins/finder/finder.js +1 -1
- package/es2021.en/plugins/finder/finder.min.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.css +1 -1
- package/es2021.en/plugins/google-maps/google-maps.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021.en/plugins/google-search/google-search.js +1 -1
- package/es2021.en/plugins/google-search/google-search.min.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.css +1 -1
- package/es2021.en/plugins/keyboard/keyboard.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021.en/plugins/page-break/page-break.js +1 -1
- package/es2021.en/plugins/page-break/page-break.min.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.css +1 -1
- package/es2021.en/plugins/paste-code/paste-code.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.css +1 -1
- package/es2021.en/plugins/todo-list/todo-list.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021.en/plugins/translate/translate.css +1 -1
- package/es2021.en/plugins/translate/translate.js +154 -27
- package/es2021.en/plugins/translate/translate.min.js +2 -2
- package/es2021.en/plugins/tune-block/tune-block.css +1 -1
- package/es2021.en/plugins/tune-block/tune-block.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +5 -4
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/autocomplete/autocomplete.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es5/plugins/backup/backup.css +1 -1
- package/es5/plugins/backup/backup.js +1 -1
- package/es5/plugins/backup/backup.min.js +1 -1
- package/es5/plugins/button-generator/button-generator.css +1 -1
- package/es5/plugins/button-generator/button-generator.js +1 -1
- package/es5/plugins/button-generator/button-generator.min.js +1 -1
- package/es5/plugins/change-case/change-case.js +1 -1
- package/es5/plugins/change-case/change-case.min.js +1 -1
- package/es5/plugins/color-picker/color-picker.css +1 -1
- package/es5/plugins/color-picker/color-picker.js +1 -1
- package/es5/plugins/color-picker/color-picker.min.js +1 -1
- package/es5/plugins/emoji/emoji.css +1 -1
- package/es5/plugins/emoji/emoji.js +1 -1
- package/es5/plugins/emoji/emoji.min.js +1 -1
- package/es5/plugins/export-docs/export-docs.js +1 -1
- package/es5/plugins/export-docs/export-docs.min.js +1 -1
- package/es5/plugins/finder/finder.css +1 -1
- package/es5/plugins/finder/finder.js +1 -1
- package/es5/plugins/finder/finder.min.js +1 -1
- package/es5/plugins/google-maps/google-maps.css +1 -1
- package/es5/plugins/google-maps/google-maps.js +1 -1
- package/es5/plugins/google-maps/google-maps.min.js +1 -1
- package/es5/plugins/google-search/google-search.js +1 -1
- package/es5/plugins/google-search/google-search.min.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es5/plugins/keyboard/keyboard.css +1 -1
- package/es5/plugins/keyboard/keyboard.js +1 -1
- package/es5/plugins/keyboard/keyboard.min.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es5/plugins/page-break/page-break.js +1 -1
- package/es5/plugins/page-break/page-break.min.js +1 -1
- package/es5/plugins/paste-code/paste-code.css +1 -1
- package/es5/plugins/paste-code/paste-code.js +1 -1
- package/es5/plugins/paste-code/paste-code.min.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es5/plugins/todo-list/todo-list.css +1 -1
- package/es5/plugins/todo-list/todo-list.js +1 -1
- package/es5/plugins/todo-list/todo-list.min.js +1 -1
- package/es5/plugins/translate/translate.css +1 -1
- package/es5/plugins/translate/translate.js +154 -27
- package/es5/plugins/translate/translate.min.js +2 -2
- package/es5/plugins/tune-block/tune-block.css +1 -1
- package/es5/plugins/tune-block/tune-block.js +1 -1
- package/es5/plugins/tune-block/tune-block.min.js +1 -1
- package/esm/plugins/translate/replace-text-fragments.d.ts +7 -0
- package/esm/plugins/translate/replace-text-fragments.js +1 -0
- package/esm/plugins/translate/translate.js +1 -1
- package/package.json +1 -1
- 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.
|
|
4
|
+
* Version: v4.6.23
|
|
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
|
|
34
|
-
/* harmony import */ var
|
|
35
|
-
/* harmony import */ var
|
|
36
|
-
/* harmony import */ var
|
|
37
|
-
/* harmony import */ var
|
|
38
|
-
/* harmony import */ var
|
|
39
|
-
/* harmony import */ var
|
|
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,7 +55,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
|
|
59
|
+
class Translate extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_9__/* .Plugin */ .k {
|
|
58
60
|
constructor() {
|
|
59
61
|
super(...arguments);
|
|
60
62
|
this.buttons = [
|
|
@@ -70,7 +72,7 @@ class Translate extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__/* .Pl
|
|
|
70
72
|
}
|
|
71
73
|
__getProvider() {
|
|
72
74
|
const { provider } = this.jodit.options.translate;
|
|
73
|
-
if ((0,
|
|
75
|
+
if ((0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__/* .isString */ .K)(provider)) {
|
|
74
76
|
switch (provider) {
|
|
75
77
|
case 'google':
|
|
76
78
|
return new _providers_google_google__WEBPACK_IMPORTED_MODULE_2__/* .GoogleTranslateProvider */ .l(this.j);
|
|
@@ -82,7 +84,7 @@ class Translate extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__/* .Pl
|
|
|
82
84
|
return provider(this.jodit);
|
|
83
85
|
}
|
|
84
86
|
afterInit(jodit) {
|
|
85
|
-
const defaultLanguage = (0,
|
|
87
|
+
const 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);
|
|
86
88
|
const provider = this.__getProvider();
|
|
87
89
|
jodit
|
|
88
90
|
.registerCommand('translateOptions', {
|
|
@@ -100,8 +102,8 @@ class Translate extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__/* .Pl
|
|
|
100
102
|
});
|
|
101
103
|
dlg.setContent(settings);
|
|
102
104
|
dlg.setFooter([
|
|
103
|
-
(0,
|
|
104
|
-
(0,
|
|
105
|
+
(0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_10__/* .Button */ .$n)(jodit, 'cancel', 'Cancel').onAction(() => dlg.close()),
|
|
106
|
+
(0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_10__/* .Button */ .$n)(jodit, 'ok', 'Save', 'primary').onAction(() => {
|
|
105
107
|
this.state = newState;
|
|
106
108
|
dlg.close();
|
|
107
109
|
})
|
|
@@ -113,23 +115,27 @@ class Translate extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__/* .Pl
|
|
|
113
115
|
})
|
|
114
116
|
.registerCommand('translate', {
|
|
115
117
|
exec: () => {
|
|
116
|
-
const selection = jodit.
|
|
117
|
-
if (!selection) {
|
|
118
|
+
const selection = (0,_replace_text_fragments__WEBPACK_IMPORTED_MODULE_4__/* .getSelectionFragments */ .a)(jodit).filter((fragment) => fragment.text.trim().length > 0);
|
|
119
|
+
if (!selection.length) {
|
|
118
120
|
jodit.message.error('Select text for translate');
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
|
-
|
|
122
|
-
.translate(selection, !this.state.sourceLang ||
|
|
123
|
+
const source = !this.state.sourceLang ||
|
|
123
124
|
this.state.sourceLang === 'auto'
|
|
124
125
|
? language
|
|
125
|
-
: this.state.sourceLang
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
: this.state.sourceLang;
|
|
127
|
+
const target = this.state.targetLang;
|
|
128
|
+
return Promise.all(selection.map((fragment) => {
|
|
129
|
+
provider
|
|
130
|
+
.translate(fragment.text, source, target)
|
|
131
|
+
.then((response) => {
|
|
132
|
+
fragment.replace(response.text);
|
|
133
|
+
})
|
|
134
|
+
.catch((error) => {
|
|
135
|
+
jodit.message.error((0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_6__/* .isString */ .K)(error) ? error : error.message);
|
|
136
|
+
});
|
|
137
|
+
})).then(() => {
|
|
138
|
+
jodit.synchronizeValues();
|
|
133
139
|
});
|
|
134
140
|
},
|
|
135
141
|
hotkeys: jodit.o.translate.hotkeys.translateSelection
|
|
@@ -139,9 +145,9 @@ class Translate extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_8__/* .Pl
|
|
|
139
145
|
}
|
|
140
146
|
Translate.requires = ['license'];
|
|
141
147
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
|
|
142
|
-
|
|
148
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_5__.persistent
|
|
143
149
|
], Translate.prototype, "state", void 0);
|
|
144
|
-
|
|
150
|
+
jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_11__/* .JoditPro */ .A.plugins.add('translate', Translate);
|
|
145
151
|
|
|
146
152
|
|
|
147
153
|
/***/ }),
|
|
@@ -376,6 +382,127 @@ class GoogleTranslateProvider {
|
|
|
376
382
|
|
|
377
383
|
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>"
|
|
378
384
|
|
|
385
|
+
/***/ }),
|
|
386
|
+
|
|
387
|
+
/***/ 75637:
|
|
388
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
389
|
+
|
|
390
|
+
"use strict";
|
|
391
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
392
|
+
/* harmony export */ a: function() { return /* binding */ getSelectionFragments; }
|
|
393
|
+
/* harmony export */ });
|
|
394
|
+
/* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2748);
|
|
395
|
+
|
|
396
|
+
function getSelectionFragments(jodit) {
|
|
397
|
+
const result = [];
|
|
398
|
+
const selection = jodit.s.expandSelection().sel;
|
|
399
|
+
if (!selection || selection.rangeCount === 0 || selection.isCollapsed) {
|
|
400
|
+
return result;
|
|
401
|
+
}
|
|
402
|
+
jodit.s.range.commonAncestorContainer.normalize();
|
|
403
|
+
const range = jodit.s.range;
|
|
404
|
+
const { commonAncestorContainer, startContainer, endContainer, startOffset, endOffset } = range;
|
|
405
|
+
if (startContainer === endContainer) {
|
|
406
|
+
if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(startContainer)) {
|
|
407
|
+
return [replaceTextNode(startContainer, startOffset, endOffset)];
|
|
408
|
+
}
|
|
409
|
+
// One child selected exactly
|
|
410
|
+
if (endOffset - startOffset === 1) {
|
|
411
|
+
const childNode = startContainer.childNodes[startOffset];
|
|
412
|
+
if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(childNode)) {
|
|
413
|
+
return [
|
|
414
|
+
replaceTextNode(childNode, 0, childNode.nodeValue.length)
|
|
415
|
+
];
|
|
416
|
+
}
|
|
417
|
+
return [replaceElementNode(childNode)];
|
|
418
|
+
}
|
|
419
|
+
// Whole container contents selected
|
|
420
|
+
if (startOffset === 0 &&
|
|
421
|
+
startContainer.childNodes.length === endOffset) {
|
|
422
|
+
return [replaceElementNode(startContainer)];
|
|
423
|
+
}
|
|
424
|
+
// Range spans multiple children of the same container
|
|
425
|
+
for (let i = startOffset; i < endOffset; i++) {
|
|
426
|
+
const childNode = startContainer.childNodes[i];
|
|
427
|
+
if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(childNode)) {
|
|
428
|
+
result.push(replaceTextNode(childNode, 0, childNode.nodeValue.length));
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
result.push(replaceElementNode(childNode));
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return result;
|
|
435
|
+
}
|
|
436
|
+
const allContainedEls = new Set();
|
|
437
|
+
const walker = jodit.ed.createTreeWalker(commonAncestorContainer, NodeFilter.SHOW_ALL, {
|
|
438
|
+
acceptNode: (n) => {
|
|
439
|
+
if (!range.intersectsNode(n))
|
|
440
|
+
return NodeFilter.FILTER_REJECT;
|
|
441
|
+
if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.closest(n, (el) => el && allContainedEls.has(el), commonAncestorContainer)) {
|
|
442
|
+
return NodeFilter.FILTER_REJECT;
|
|
443
|
+
}
|
|
444
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
let nextNode = walker.nextNode();
|
|
448
|
+
while (nextNode) {
|
|
449
|
+
if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isElement(nextNode) && fullyContains(range, nextNode)) {
|
|
450
|
+
allContainedEls.add(nextNode);
|
|
451
|
+
result.push(replaceElementNode(nextNode));
|
|
452
|
+
}
|
|
453
|
+
else if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(nextNode) && fullyContains(range, nextNode)) {
|
|
454
|
+
result.push(replaceTextNode(nextNode, 0, nextNode.nodeValue.length));
|
|
455
|
+
}
|
|
456
|
+
else if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .J.isText(nextNode)) {
|
|
457
|
+
let sOffset = 0;
|
|
458
|
+
let eOffset = nextNode.nodeValue.length;
|
|
459
|
+
if (nextNode === startContainer) {
|
|
460
|
+
sOffset = startOffset;
|
|
461
|
+
}
|
|
462
|
+
if (nextNode === endContainer) {
|
|
463
|
+
eOffset = endOffset;
|
|
464
|
+
}
|
|
465
|
+
result.push(replaceTextNode(nextNode, sOffset, eOffset));
|
|
466
|
+
}
|
|
467
|
+
nextNode = walker.nextNode();
|
|
468
|
+
}
|
|
469
|
+
return result;
|
|
470
|
+
}
|
|
471
|
+
const fullyContains = (r, node) => {
|
|
472
|
+
const nr = document.createRange();
|
|
473
|
+
// For containment, we want the node’s *contents*
|
|
474
|
+
try {
|
|
475
|
+
nr.selectNodeContents(node);
|
|
476
|
+
}
|
|
477
|
+
catch {
|
|
478
|
+
nr.selectNode(node);
|
|
479
|
+
}
|
|
480
|
+
return (r.compareBoundaryPoints(Range.START_TO_START, nr) <= 0 &&
|
|
481
|
+
r.compareBoundaryPoints(Range.END_TO_END, nr) >= 0);
|
|
482
|
+
};
|
|
483
|
+
function replaceTextNode(node, start, end) {
|
|
484
|
+
const text = node.nodeValue.slice(start, end);
|
|
485
|
+
return {
|
|
486
|
+
text,
|
|
487
|
+
replace: (newText) => {
|
|
488
|
+
node.nodeValue =
|
|
489
|
+
node.nodeValue.slice(0, start) +
|
|
490
|
+
newText +
|
|
491
|
+
node.nodeValue.slice(end);
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
function replaceElementNode(node) {
|
|
496
|
+
const el = node;
|
|
497
|
+
return {
|
|
498
|
+
text: el.innerHTML,
|
|
499
|
+
replace: (newHTML) => {
|
|
500
|
+
el.innerHTML = newHTML;
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
|
|
379
506
|
/***/ }),
|
|
380
507
|
|
|
381
508
|
/***/ 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.
|
|
4
|
+
* Version: v4.6.23
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var s in a)("object"==typeof exports?exports:t)[s]=a[s]}})(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[954],{3407(t,e,a){"use strict";a.r(e),a.d(e,{Translate(){return u}});var s=a(31635),n=(a(97527),a(56903)),i=a(97195),o=a(65478),r=a(70799),l=(a(38837),a(96325)),c=a(50911),h=a(10830),g=a(34013);class u extends c.k{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((0,r.K)(t)){if("google"===t)return new n.l(this.j);throw Error("Unknown provider")}return t(this.jodit)}afterInit(t){const e=(0,l.e)(t.o.language,g.A.defaultOptions.language),a=(0,l.e)(t.o.language,e),s=this.__getProvider();t.registerCommand("translateOptions",{exec:async()=>{let e=this.state;const a=t.dlg();a.setHeader("Translate options");const n=await s.supportedLanguages(),o=new i.g(a,this.state,{sourceList:n.langs,targetList:n.langs,onChange(t){e=t}});a.setContent(o),a.setFooter([(0,h.$n)(t,"cancel","Cancel").onAction(()=>a.close()),(0,h.$n)(t,"ok","Save","primary").onAction(()=>{this.state=e,a.close()})]),o.bindDestruct(a),a.setSize(500,400).open(!0)},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:()=>{const e=t.s.html;if(e)return s.translate(e,this.state.sourceLang&&"auto"!==this.state.sourceLang?this.state.sourceLang:a,this.state.targetLang).then(e=>{t.s.range.deleteContents(),t.s.insertNode(t.createInside.text(e.text))}).catch(e=>{t.message.error((0,r.K)(e)?e:e.message)});t.message.error("Select text for translate")},hotkeys:t.o.translate.hotkeys.translateSelection})}beforeDestruct(t){}}u.requires=["license"],(0,s.Cg)([o.persistent],u.prototype,"state",void 0),g.A.plugins.add("translate",u)},17391(t,e,a){"use strict";a.d(e,{e(){return s}});const s={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(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(t,e,a){"use strict";a.d(e,{l(){return n}}),a(82758),a(38837);var s=a(17391);class n{constructor(t){this.jodit=t}__fetch(t,e={}){const a=this.jodit.o.translate.googleProviderOptions;return this.jodit.fetch(a.url+"?key="+a.key,{method:"POST",data:{...e,ui:this.jodit.o.language},contentType:"application/json; charset=utf-8",withCredentials:!1}).then(t=>t.json()).catch(t=>{try{this.jodit.message.error(t.json().message)}catch(t){}})}translate(t,e,a){return this.__fetch("translate",{q:t,source:e,target:a,format:"html"}).then(t=>({text:t.data.translations[0].translatedText}))}supportedLanguages(){return Promise.resolve({langs:s.e})}}},74922(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(t,e,a){"use strict";a.d(e,{F(){return g}});var s=a(31635),n=a(82758),i=a(65478),o=a(2748),r=a(21537),l=a(29960),c=a(48538),h=a(80256);let g=class t extends c.D{className(){return"UITranslateList"}get items(){return this.getElms("item")}render(t){const e=[];return Object.keys(t.list).sort().forEach(a=>{const s=t.list[a];e.push(`<a role='button' tabindex='0' class='&__item' data-lang='${s}'>\n\t\t\t\t\t\t<span class='&__item-key'>${s}</span>\n\t\t\t\t\t\t<span class='&__item-title'>${this.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'>${e.join("")}</div>\n\t\t</div>`}constructor(t,e){super(t,e),this.options=e,this.state={active:""},this.state.active=e.active;const a=new h.t(t,{placeholder:t.i18n("Filter"),icon:"search",onChange:this.__onChangeFilter,clearButton:!0});this.getElm("input")?.appendChild(a.container),this.__onActiveChange()}__onChangeFilter(t){this.items.forEach(e=>{const a=e.textContent?.toLowerCase()??"";(0,l.C)(e,"data-hidden","true"!==(0,l.C)(e,"data-active")&&!a.includes(t.toLowerCase()))})}__scrollToActive(){const t=this.container.querySelector('[data-active="true"]'),e=this.getElm("list");t&&e&&(0,r.scrollIntoViewIfNeeded)(t,e,this.j.od)}onClickItem(t){if("keydown"===t.type&&"key"in t&&t.key!==n.KEY_ENTER)return;const e=t.target;if(o.J.isHTMLElement(e)&&e.getAttribute("data-lang")){const t=(0,l.C)(e,"data-lang");this.options.onChange(t),this.state.active=t}}__onActiveChange(){this.items.forEach(t=>(0,l.C)(t,"data-active",(0,l.C)(t,"data-lang")===this.state.active)),this.__scrollToActive()}};(0,s.Cg)([(0,i.debounce)()],g.prototype,"__onChangeFilter",null),(0,s.Cg)([(0,i.watch)(":afterOpen")],g.prototype,"__scrollToActive",null),(0,s.Cg)([(0,i.watch)(["container:click","container:keydown"])],g.prototype,"onClickItem",null),(0,s.Cg)([(0,i.watch)("state.active"),(0,i.debounce)()],g.prototype,"__onActiveChange",null),g=(0,s.Cg)([i.component],g)},97195(t,e,a){"use strict";a.d(e,{g(){return r}});var s=a(31635),n=a(65478),i=a(67510),o=a(76697);let r=class t extends i.D${className(){return"UITranslateSettings"}render(){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>"}constructor(t,e,a){super(t),this.state=e,this.options=a,this.__sourceList=new o.F(t,{list:a.sourceList,active:e.sourceLang,onChange:t=>{this.state.sourceLang=t,this.options.onChange({...this.state})}}),this.getElm("source-list")?.appendChild(this.__sourceList.container),this.__targetList=new o.F(t,{list:a.targetList,active:e.targetLang,onChange:t=>{this.state.targetLang=t,this.options.onChange({...this.state})}}),this.getElm("target-list")?.appendChild(this.__targetList.container)}__onSwap(){const 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({...this.state})}};(0,s.Cg)([(0,n.watch)("arrow-swap:click")],r.prototype,"__onSwap",null),r=(0,s.Cg)([n.component],r)},97527(t,e,a){"use strict";var s=a(74922),n=a.n(s),i=a(34575),o=a.n(i),r=a(6441),l=a(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(t){t.execCommand("translate")},list:["Options"],childExec(t,e,{control:a}){t.execCommand("translate"+a.name)},mods:{stroke:!1}}},l.I.set("translate",o()).set("translate-swap",n())}},t=>t(t.s=3407)])});
|
|
10
|
+
((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var n in a)("object"==typeof exports?exports:t)[n]=a[n]}})(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[954],{3407(t,e,a){"use strict";a.r(e),a.d(e,{Translate(){return d}});var n=a(31635),s=(a(97527),a(56903)),i=a(97195),o=a(75637),r=a(65478),l=a(70799),c=(a(38837),a(96325)),h=a(50911),u=a(10830),g=a(34013);class d extends h.k{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((0,l.K)(t)){if("google"===t)return new s.l(this.j);throw Error("Unknown provider")}return t(this.jodit)}afterInit(t){const e=(0,c.e)(t.o.language,g.A.defaultOptions.language),a=(0,c.e)(t.o.language,e),n=this.__getProvider();t.registerCommand("translateOptions",{exec:async()=>{let e=this.state;const a=t.dlg();a.setHeader("Translate options");const s=await n.supportedLanguages(),o=new i.g(a,this.state,{sourceList:s.langs,targetList:s.langs,onChange(t){e=t}});a.setContent(o),a.setFooter([(0,u.$n)(t,"cancel","Cancel").onAction(()=>a.close()),(0,u.$n)(t,"ok","Save","primary").onAction(()=>{this.state=e,a.close()})]),o.bindDestruct(a),a.setSize(500,400).open(!0)},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:()=>{const e=(0,o.a)(t).filter(t=>t.text.trim().length>0);if(!e.length)return void t.message.error("Select text for translate");const s=this.state.sourceLang&&"auto"!==this.state.sourceLang?this.state.sourceLang:a,i=this.state.targetLang;return Promise.all(e.map(e=>{n.translate(e.text,s,i).then(t=>{e.replace(t.text)}).catch(e=>{t.message.error((0,l.K)(e)?e:e.message)})})).then(()=>{t.synchronizeValues()})},hotkeys:t.o.translate.hotkeys.translateSelection})}beforeDestruct(t){}}d.requires=["license"],(0,n.Cg)([r.persistent],d.prototype,"state",void 0),g.A.plugins.add("translate",d)},17391(t,e,a){"use strict";a.d(e,{e(){return n}});const n={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(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(t,e,a){"use strict";a.d(e,{l(){return s}}),a(82758),a(38837);var n=a(17391);class s{constructor(t){this.jodit=t}__fetch(t,e={}){const a=this.jodit.o.translate.googleProviderOptions;return this.jodit.fetch(a.url+"?key="+a.key,{method:"POST",data:{...e,ui:this.jodit.o.language},contentType:"application/json; charset=utf-8",withCredentials:!1}).then(t=>t.json()).catch(t=>{try{this.jodit.message.error(t.json().message)}catch(t){}})}translate(t,e,a){return this.__fetch("translate",{q:t,source:e,target:a,format:"html"}).then(t=>({text:t.data.translations[0].translatedText}))}supportedLanguages(){return Promise.resolve({langs:n.e})}}},74922(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(t,e,a){"use strict";a.d(e,{a(){return s}});var n=a(2748);function s(t){const e=[],a=t.s.expandSelection().sel;if(!a||0===a.rangeCount||a.isCollapsed)return e;t.s.range.commonAncestorContainer.normalize();const s=t.s.range,{commonAncestorContainer:l,startContainer:c,endContainer:h,startOffset:u,endOffset:g}=s;if(c===h){if(n.J.isText(c))return[o(c,u,g)];if(g-u===1){const t=c.childNodes[u];return n.J.isText(t)?[o(t,0,t.nodeValue.length)]:[r(t)]}if(0===u&&c.childNodes.length===g)return[r(c)];for(let t=u;g>t;t++){const a=c.childNodes[t];n.J.isText(a)?e.push(o(a,0,a.nodeValue.length)):e.push(r(a))}return e}const d=new Set,p=t.ed.createTreeWalker(l,NodeFilter.SHOW_ALL,{acceptNode(t){return s.intersectsNode(t)?n.J.closest(t,t=>t&&d.has(t),l)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let m=p.nextNode();for(;m;){if(n.J.isElement(m)&&i(s,m))d.add(m),e.push(r(m));else if(n.J.isText(m)&&i(s,m))e.push(o(m,0,m.nodeValue.length));else if(n.J.isText(m)){let t=0,a=m.nodeValue.length;m===c&&(t=u),m===h&&(a=g),e.push(o(m,t,a))}m=p.nextNode()}return e}const i=(t,e)=>{const a=document.createRange();try{a.selectNodeContents(e)}catch{a.selectNode(e)}return 0>=t.compareBoundaryPoints(Range.START_TO_START,a)&&t.compareBoundaryPoints(Range.END_TO_END,a)>=0};function o(t,e,a){return{text:t.nodeValue.slice(e,a),replace(n){t.nodeValue=t.nodeValue.slice(0,e)+n+t.nodeValue.slice(a)}}}function r(t){const e=t;return{text:e.innerHTML,replace(t){e.innerHTML=t}}}},76697(t,e,a){"use strict";a.d(e,{F(){return u}});var n=a(31635),s=a(82758),i=a(65478),o=a(2748),r=a(21537),l=a(29960),c=a(48538),h=a(80256);let u=class t extends c.D{className(){return"UITranslateList"}get items(){return this.getElms("item")}render(t){const e=[];return Object.keys(t.list).sort().forEach(a=>{const n=t.list[a];e.push(`<a role='button' tabindex='0' class='&__item' data-lang='${n}'>\n\t\t\t\t\t\t<span class='&__item-key'>${n}</span>\n\t\t\t\t\t\t<span class='&__item-title'>${this.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'>${e.join("")}</div>\n\t\t</div>`}constructor(t,e){super(t,e),this.options=e,this.state={active:""},this.state.active=e.active;const a=new h.t(t,{placeholder:t.i18n("Filter"),icon:"search",onChange:this.__onChangeFilter,clearButton:!0});this.getElm("input")?.appendChild(a.container),this.__onActiveChange()}__onChangeFilter(t){this.items.forEach(e=>{const a=e.textContent?.toLowerCase()??"";(0,l.C)(e,"data-hidden","true"!==(0,l.C)(e,"data-active")&&!a.includes(t.toLowerCase()))})}__scrollToActive(){const t=this.container.querySelector('[data-active="true"]'),e=this.getElm("list");t&&e&&(0,r.scrollIntoViewIfNeeded)(t,e,this.j.od)}onClickItem(t){if("keydown"===t.type&&"key"in t&&t.key!==s.KEY_ENTER)return;const e=t.target;if(o.J.isHTMLElement(e)&&e.getAttribute("data-lang")){const t=(0,l.C)(e,"data-lang");this.options.onChange(t),this.state.active=t}}__onActiveChange(){this.items.forEach(t=>(0,l.C)(t,"data-active",(0,l.C)(t,"data-lang")===this.state.active)),this.__scrollToActive()}};(0,n.Cg)([(0,i.debounce)()],u.prototype,"__onChangeFilter",null),(0,n.Cg)([(0,i.watch)(":afterOpen")],u.prototype,"__scrollToActive",null),(0,n.Cg)([(0,i.watch)(["container:click","container:keydown"])],u.prototype,"onClickItem",null),(0,n.Cg)([(0,i.watch)("state.active"),(0,i.debounce)()],u.prototype,"__onActiveChange",null),u=(0,n.Cg)([i.component],u)},97195(t,e,a){"use strict";a.d(e,{g(){return r}});var n=a(31635),s=a(65478),i=a(67510),o=a(76697);let r=class t extends i.D${className(){return"UITranslateSettings"}render(){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>"}constructor(t,e,a){super(t),this.state=e,this.options=a,this.__sourceList=new o.F(t,{list:a.sourceList,active:e.sourceLang,onChange:t=>{this.state.sourceLang=t,this.options.onChange({...this.state})}}),this.getElm("source-list")?.appendChild(this.__sourceList.container),this.__targetList=new o.F(t,{list:a.targetList,active:e.targetLang,onChange:t=>{this.state.targetLang=t,this.options.onChange({...this.state})}}),this.getElm("target-list")?.appendChild(this.__targetList.container)}__onSwap(){const 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({...this.state})}};(0,n.Cg)([(0,s.watch)("arrow-swap:click")],r.prototype,"__onSwap",null),r=(0,n.Cg)([s.component],r)},97527(t,e,a){"use strict";var n=a(74922),s=a.n(n),i=a(34575),o=a.n(i),r=a(6441),l=a(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(t){t.execCommand("translate")},list:["Options"],childExec(t,e,{control:a}){t.execCommand("translate"+a.name)},mods:{stroke:!1}}},l.I.set("translate",o()).set("translate-swap",s())}},t=>t(t.s=3407)])});
|