jodit-pro 4.0.6 → 4.0.18
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 +20 -19
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +634 -530
- package/es2015/jodit.min.css +1 -1
- 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 +2 -1
- package/es2015/plugins/finder/finder.js +4 -3
- package/es2015/plugins/finder/finder.min.css +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 +2 -2
- package/es2015/plugins/paste-code/paste-code.min.js +2 -2
- 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 +1 -1
- package/es2015/plugins/translate/translate.min.js +1 -1
- 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 +20 -19
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +634 -530
- package/es2018/jodit.min.css +1 -1
- 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 +2 -1
- package/es2018/plugins/finder/finder.js +4 -3
- package/es2018/plugins/finder/finder.min.css +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 +2 -2
- package/es2018/plugins/paste-code/paste-code.min.js +2 -2
- 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 +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- 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 +20 -19
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +633 -529
- package/es2021/jodit.min.css +1 -1
- 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 +2 -1
- package/es2021/plugins/finder/finder.js +4 -3
- package/es2021/plugins/finder/finder.min.css +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 +2 -2
- package/es2021/plugins/paste-code/paste-code.min.js +2 -2
- 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 +1 -1
- package/es2021/plugins/translate/translate.min.js +1 -1
- 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 +20 -19
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +334 -314
- package/es2021.en/jodit.min.css +1 -1
- 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 +2 -1
- package/es2021.en/plugins/finder/finder.js +4 -3
- package/es2021.en/plugins/finder/finder.min.css +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 +2 -2
- package/es2021.en/plugins/paste-code/paste-code.min.js +2 -2
- 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 +1 -1
- package/es2021.en/plugins/translate/translate.min.js +1 -1
- 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 +25 -19
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +659 -555
- package/es5/jodit.min.css +3 -3
- 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 +2 -1
- package/es5/plugins/finder/finder.js +4 -3
- package/es5/plugins/finder/finder.min.css +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 +2 -2
- package/es5/plugins/paste-code/paste-code.min.js +2 -2
- 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 +1 -1
- package/es5/plugins/translate/translate.min.js +1 -1
- 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/license/license.js +1 -1
- package/esm/plugins/paste-code/paste-code.js +1 -1
- package/package.json +1 -1
|
@@ -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.0.
|
|
4
|
+
* Version: v4.0.18
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
@@ -186,7 +186,7 @@ var pasteCode = /** @class */ (function (_super) {
|
|
|
186
186
|
}
|
|
187
187
|
else {
|
|
188
188
|
var current = jodit.s.current(), block = jodit_modules__WEBPACK_IMPORTED_MODULE_5__.Dom.up(current, jodit_modules__WEBPACK_IMPORTED_MODULE_5__.Dom.isBlock, jodit.editor);
|
|
189
|
-
block
|
|
189
|
+
block && !jodit_modules__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(block)
|
|
190
190
|
? jodit_modules__WEBPACK_IMPORTED_MODULE_5__.Dom.after(block, newPre)
|
|
191
191
|
: jodit.s.insertNode(newPre);
|
|
192
192
|
}
|
|
@@ -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.0.
|
|
4
|
+
* Version: v4.0.18
|
|
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(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[535],{75118:function(e){e.exports='<svg viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M2.5244141,23.5h18.9511719c0.4140625,0,0.75-0.3359375,0.75-0.75V4.9208984 c0-0.1992188-0.0795898-0.390625-0.2207031-0.53125L18.3198242,0.71875C18.1791992,0.5786133,17.9887695,0.5,17.7905273,0.5 H2.5244141c-0.4140625,0-0.75,0.3359375-0.75,0.75v21.5C1.7744141,23.1640625,2.1103516,23.5,2.5244141,23.5z M20.7128296,5.2197266 h-2.6986694V2.531189L20.7128296,5.2197266z M3.2744141,2h13.2397461v3.9697266c0,0.4140625,0.3359375,0.75,0.75,0.75h3.4614258V22 H3.2744141V2z" fill="#1D1D1D"/> <path d="M8.75,10.25h1.75c0.4140625,0,0.75-0.3359375,0.75-0.75s-0.3359375-0.75-0.75-0.75H8 c-0.4140625,0-0.75,0.3359375-0.75,0.75v2.75H6c-0.4140625,0-0.75,0.3359375-0.75,0.75S5.5859375,13.75,6,13.75h1.25v2.75 c0,0.4140625,0.3359375,0.75,0.75,0.75h2.5c0.4140625,0,0.75-0.3359375,0.75-0.75s-0.3359375-0.75-0.75-0.75H8.75V10.25z" fill="#1D1D1D"/> <path d="M18.5,12.25h-1.25V9.5c0-0.4140625-0.3359375-0.75-0.75-0.75H14c-0.4140625,0-0.75,0.3359375-0.75,0.75 s0.3359375,0.75,0.75,0.75h1.75v5.5H14c-0.4140625,0-0.75,0.3359375-0.75,0.75s0.3359375,0.75,0.75,0.75h2.5 c0.4140625,0,0.75-0.3359375,0.75-0.75v-2.75h1.25c0.4140625,0,0.75-0.3359375,0.75-0.75S18.9140625,12.25,18.5,12.25z" fill="#1D1D1D"/></svg>'},66757:function(e,t,n){"use strict";var a=n(77628),o=n(83221),i=n(75118);a.D.prototype.controls.pasteCode={icon:n.n(i)(),tooltip:"Paste code",command:"pasteCode"},a.D.prototype.pasteCode={globalHighlightLib:!1,canonicalLanguageCode:function(e){switch(e){case"ts":return"typescript";case"js":return"javascript";case"markup":return"html"}return e},highlightLib:{highlight:function(e,t){return"undefined"!=typeof Prism?Prism.highlight(e,Prism.languages[t]||Prism.languages.plain,t):e},isLangLoaded:function(e){return"undefined"!=typeof Prism&&Boolean(Prism.languages[e])},js:["https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js"],langUrl:function(e){return"https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/components/prism-".concat(e,".min.js")},css:["https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism.min.css"]},defaultLanguage:"html",insertTemplate:function(e,t,n){return'<pre class="language-'.concat(t,'">').concat((0,o.$)(n),"</pre>")},languages:[{value:"html",text:"HTML/XML"},{value:"plaintext",text:"Plain"},{value:"bash",text:"Bash"},{value:"javascript",text:"JavaScript"},{value:"css",text:"CSS"},{value:"php",text:"PHP"},{value:"ruby",text:"Ruby"},{value:"python",text:"Python"},{value:"java",text:"Java"},{value:"c",text:"C"},{value:"csharp",text:"C#"},{value:"cpp",text:"C++"}],dialog:{width:700,height:600}}},29782:function(e,t,n){"use strict";n.r(t),n.d(t,{pasteCode:function(){return d}});var a=n(97582),o=n(7324),i=n(75004),s=n(50526),r=n(95582),l=n(53852),c=n(8079),u=n(83221),h=n(46232),d=(n(11612),n(66757),function(e){function t(){var t=e.apply(this,(0,a.ev)([],(0,a.CR)(arguments),!1))||this;return t.buttons=[{name:"pasteCode",group:"clipboard"}],t.__highlightLibJSIsLoaded=!1,t.__loadLanguage=new Map,t}return(0,a.ZT)(t,e),t.prototype.afterInit=function(e){var t=this;e.registerCommand("pasteCode",(function(){return t.__openCodeEditDialog()}))},t.prototype.__openCodeEditDialog=function(e,t,n){var a=this,o=this.j,i=this.__createForm(),s=(0,r.refs)(i),l=s.code,u=s.language;e&&(u.value=e),t&&(l.value=t),o.async.requestIdleCallback((function(){l.focus()})),o.s.save(),this.__createDialog((function(){if(!i.validate())return!1;o.s.restore();var e=o.createInside.fromHTML(o.o.pasteCode.insertTemplate(o,u.value,l.value));if(n)c.Dom.replace(n,e,o.createInside,!1,!0);else{var t=o.s.current(),s=c.Dom.up(t,c.Dom.isBlock,o.editor);s?c.Dom.after(s,e):o.s.insertNode(e)}a.__imdOnChange()}),(function(){o.s.restore()})).setContent(i.container).open(!0)},t.prototype.beforeDestruct=function(e){},t.prototype.__createForm=function(){var e=this.jodit;return new i.x4(e,[new i.Cj(e,{name:"language",label:"Language",value:e.o.pasteCode.defaultLanguage,options:e.o.pasteCode.languages,required:!0}),new i.GJ(e,{label:"Code view",resizable:!1,name:"code",required:!0,className:"jodit-paste-code__textarea"})],{className:"jodit-paste-code"})},t.prototype.__createDialog=function(e,t){var n=new c.Dialog({language:this.j.o.language});return n.setHeader("Insert/Edit Code Sample").setSize(this.j.o.pasteCode.dialog.width,this.j.o.pasteCode.dialog.height).setFooter([(0,i.zx)(n,"","Cancel","default").onAction((function(){n.close(),t()})),(0,i.zx)(n,"save","Save","primary").onAction((function(){n.close(),e()}))]),n},t.prototype.__onChange=function(){this.__imdOnChange()},t.prototype.__imdOnChange=function(){var e=this;(0,r.$$)("pre",this.j.editor).forEach((function(t){(0,r.attr)(t,"contenteditable")||((0,r.attr)(t,"contenteditable",!1),e.__highlightCode(t))}))},t.prototype.__highlightCode=function(e){return(0,a.mG)(this,void 0,Promise,(function(){var t,n,o,i,s,l,u,d,g,f;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return n=(t=this.j.o.pasteCode).globalHighlightLib,i=(o=t.highlightLib).css,s=o.js,l=o.langUrl,u=o.highlight,d=o.isLangLoaded,this.__highlightLibJSIsLoaded||n||(this.__highlightLibJSIsLoaded=p(this.async,Promise.all([(0,r.loadNextStyle)(this.jodit,i).catch((function(){return null})),(0,r.loadNext)(this.jodit,s).catch((function(){return null}))]))),(0,h.j)(this.__highlightLibJSIsLoaded)?[3,2]:[4,this.__highlightLibJSIsLoaded];case 1:a.sent(),a.label=2;case 2:return g=this.__parseLanguage(e),d(g)||n?[3,4]:(this.__loadLanguage.has(g)||this.__loadLanguage.set(g,p(this.async,(0,r.appendScriptAsync)(this.jodit,l(g)).catch((function(){return null})))),[4,this.__loadLanguage.get(g)]);case 3:a.sent(),a.label=4;case 4:return f=e,e.firstElementChild===e.lastElementChild&&c.Dom.isTag(e.firstElementChild,"code")&&(f=e.firstElementChild),f.innerHTML=u(f.innerText,g),[2]}}))}))},t.prototype.onPreEdit=function(e){var t=c.Dom.isNode(e)&&c.Dom.isTag(e,"pre")?e:c.Dom.closest(e.target,"pre",this.j.editor);if(t){var n=this.__parseLanguage(t);this.__openCodeEditDialog(n,t.innerText,t)}},t.prototype.__parseLanguage=function(e){var t=null,n=function(e){return e.classList.forEach((function(e){if(/language-/.test(e)){var n=/language-(.*)/.exec(e);n&&n[1]&&(t=n[1])}}))};return n(e),null==t&&e.firstElementChild===e.lastElementChild&&c.Dom.isTag(e.firstElementChild,"code")&&n(e.firstElementChild),this.jodit.o.pasteCode.canonicalLanguageCode(t||"html")},t.prototype.onAfterGetValueFromEditor=function(e){var t=this,n=function(e,n,a,o,i,s){return"".concat(n.trim()).concat(o).concat((0,u.$)((0,r.stripTags)(i,t.j.ed,new Set(["br"])))).concat(s)};e.value=e.value.replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>\s*<code[^>]*>)(.*?)(<\/code>\s*<\/pre>)/gis,n).replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>)(.*?)(<\/pre>)/gis,n)},t.requires=["license"],(0,a.gn)([s.autobind],t.prototype,"__openCodeEditDialog",null),(0,a.gn)([(0,s.watch)("?:change"),(0,s.debounce)()],t.prototype,"__onChange",null),(0,a.gn)([(0,s.watch)(["?:dblclick","?:editPreInPasteCode"])],t.prototype,"onPreEdit",null),(0,a.gn)([(0,s.watch)("?:afterGetValueFromEditor")],t.prototype,"onAfterGetValueFromEditor",null),(0,a.gn)([s.component],t)}(o.S));function p(e,t){return e.promise((function(e,n){t.then(e).catch(n)}))}l.y.plugins.add("paste-code",d)}},function(e){return e(e.s=29782)}])}));
|
|
10
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[535],{75118:function(e){e.exports='<svg viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M2.5244141,23.5h18.9511719c0.4140625,0,0.75-0.3359375,0.75-0.75V4.9208984 c0-0.1992188-0.0795898-0.390625-0.2207031-0.53125L18.3198242,0.71875C18.1791992,0.5786133,17.9887695,0.5,17.7905273,0.5 H2.5244141c-0.4140625,0-0.75,0.3359375-0.75,0.75v21.5C1.7744141,23.1640625,2.1103516,23.5,2.5244141,23.5z M20.7128296,5.2197266 h-2.6986694V2.531189L20.7128296,5.2197266z M3.2744141,2h13.2397461v3.9697266c0,0.4140625,0.3359375,0.75,0.75,0.75h3.4614258V22 H3.2744141V2z" fill="#1D1D1D"/> <path d="M8.75,10.25h1.75c0.4140625,0,0.75-0.3359375,0.75-0.75s-0.3359375-0.75-0.75-0.75H8 c-0.4140625,0-0.75,0.3359375-0.75,0.75v2.75H6c-0.4140625,0-0.75,0.3359375-0.75,0.75S5.5859375,13.75,6,13.75h1.25v2.75 c0,0.4140625,0.3359375,0.75,0.75,0.75h2.5c0.4140625,0,0.75-0.3359375,0.75-0.75s-0.3359375-0.75-0.75-0.75H8.75V10.25z" fill="#1D1D1D"/> <path d="M18.5,12.25h-1.25V9.5c0-0.4140625-0.3359375-0.75-0.75-0.75H14c-0.4140625,0-0.75,0.3359375-0.75,0.75 s0.3359375,0.75,0.75,0.75h1.75v5.5H14c-0.4140625,0-0.75,0.3359375-0.75,0.75s0.3359375,0.75,0.75,0.75h2.5 c0.4140625,0,0.75-0.3359375,0.75-0.75v-2.75h1.25c0.4140625,0,0.75-0.3359375,0.75-0.75S18.9140625,12.25,18.5,12.25z" fill="#1D1D1D"/></svg>'},66757:function(e,t,n){"use strict";var a=n(77628),o=n(83221),i=n(75118);a.D.prototype.controls.pasteCode={icon:n.n(i)(),tooltip:"Paste code",command:"pasteCode"},a.D.prototype.pasteCode={globalHighlightLib:!1,canonicalLanguageCode:function(e){switch(e){case"ts":return"typescript";case"js":return"javascript";case"markup":return"html"}return e},highlightLib:{highlight:function(e,t){return"undefined"!=typeof Prism?Prism.highlight(e,Prism.languages[t]||Prism.languages.plain,t):e},isLangLoaded:function(e){return"undefined"!=typeof Prism&&Boolean(Prism.languages[e])},js:["https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js"],langUrl:function(e){return"https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/components/prism-".concat(e,".min.js")},css:["https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism.min.css"]},defaultLanguage:"html",insertTemplate:function(e,t,n){return'<pre class="language-'.concat(t,'">').concat((0,o.$)(n),"</pre>")},languages:[{value:"html",text:"HTML/XML"},{value:"plaintext",text:"Plain"},{value:"bash",text:"Bash"},{value:"javascript",text:"JavaScript"},{value:"css",text:"CSS"},{value:"php",text:"PHP"},{value:"ruby",text:"Ruby"},{value:"python",text:"Python"},{value:"java",text:"Java"},{value:"c",text:"C"},{value:"csharp",text:"C#"},{value:"cpp",text:"C++"}],dialog:{width:700,height:600}}},29782:function(e,t,n){"use strict";n.r(t),n.d(t,{pasteCode:function(){return d}});var a=n(97582),o=n(7324),i=n(75004),s=n(50526),r=n(95582),l=n(53852),c=n(8079),u=n(83221),h=n(46232),d=(n(11612),n(66757),function(e){function t(){var t=e.apply(this,(0,a.ev)([],(0,a.CR)(arguments),!1))||this;return t.buttons=[{name:"pasteCode",group:"clipboard"}],t.__highlightLibJSIsLoaded=!1,t.__loadLanguage=new Map,t}return(0,a.ZT)(t,e),t.prototype.afterInit=function(e){var t=this;e.registerCommand("pasteCode",(function(){return t.__openCodeEditDialog()}))},t.prototype.__openCodeEditDialog=function(e,t,n){var a=this,o=this.j,i=this.__createForm(),s=(0,r.refs)(i),l=s.code,u=s.language;e&&(u.value=e),t&&(l.value=t),o.async.requestIdleCallback((function(){l.focus()})),o.s.save(),this.__createDialog((function(){if(!i.validate())return!1;o.s.restore();var e=o.createInside.fromHTML(o.o.pasteCode.insertTemplate(o,u.value,l.value));if(n)c.Dom.replace(n,e,o.createInside,!1,!0);else{var t=o.s.current(),s=c.Dom.up(t,c.Dom.isBlock,o.editor);s&&!c.Dom.isCell(s)?c.Dom.after(s,e):o.s.insertNode(e)}a.__imdOnChange()}),(function(){o.s.restore()})).setContent(i.container).open(!0)},t.prototype.beforeDestruct=function(e){},t.prototype.__createForm=function(){var e=this.jodit;return new i.x4(e,[new i.Cj(e,{name:"language",label:"Language",value:e.o.pasteCode.defaultLanguage,options:e.o.pasteCode.languages,required:!0}),new i.GJ(e,{label:"Code view",resizable:!1,name:"code",required:!0,className:"jodit-paste-code__textarea"})],{className:"jodit-paste-code"})},t.prototype.__createDialog=function(e,t){var n=new c.Dialog({language:this.j.o.language});return n.setHeader("Insert/Edit Code Sample").setSize(this.j.o.pasteCode.dialog.width,this.j.o.pasteCode.dialog.height).setFooter([(0,i.zx)(n,"","Cancel","default").onAction((function(){n.close(),t()})),(0,i.zx)(n,"save","Save","primary").onAction((function(){n.close(),e()}))]),n},t.prototype.__onChange=function(){this.__imdOnChange()},t.prototype.__imdOnChange=function(){var e=this;(0,r.$$)("pre",this.j.editor).forEach((function(t){(0,r.attr)(t,"contenteditable")||((0,r.attr)(t,"contenteditable",!1),e.__highlightCode(t))}))},t.prototype.__highlightCode=function(e){return(0,a.mG)(this,void 0,Promise,(function(){var t,n,o,i,s,l,u,d,g,f;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return n=(t=this.j.o.pasteCode).globalHighlightLib,i=(o=t.highlightLib).css,s=o.js,l=o.langUrl,u=o.highlight,d=o.isLangLoaded,this.__highlightLibJSIsLoaded||n||(this.__highlightLibJSIsLoaded=p(this.async,Promise.all([(0,r.loadNextStyle)(this.jodit,i).catch((function(){return null})),(0,r.loadNext)(this.jodit,s).catch((function(){return null}))]))),(0,h.j)(this.__highlightLibJSIsLoaded)?[3,2]:[4,this.__highlightLibJSIsLoaded];case 1:a.sent(),a.label=2;case 2:return g=this.__parseLanguage(e),d(g)||n?[3,4]:(this.__loadLanguage.has(g)||this.__loadLanguage.set(g,p(this.async,(0,r.appendScriptAsync)(this.jodit,l(g)).catch((function(){return null})))),[4,this.__loadLanguage.get(g)]);case 3:a.sent(),a.label=4;case 4:return f=e,e.firstElementChild===e.lastElementChild&&c.Dom.isTag(e.firstElementChild,"code")&&(f=e.firstElementChild),f.innerHTML=u(f.innerText,g),[2]}}))}))},t.prototype.onPreEdit=function(e){var t=c.Dom.isNode(e)&&c.Dom.isTag(e,"pre")?e:c.Dom.closest(e.target,"pre",this.j.editor);if(t){var n=this.__parseLanguage(t);this.__openCodeEditDialog(n,t.innerText,t)}},t.prototype.__parseLanguage=function(e){var t=null,n=function(e){return e.classList.forEach((function(e){if(/language-/.test(e)){var n=/language-(.*)/.exec(e);n&&n[1]&&(t=n[1])}}))};return n(e),null==t&&e.firstElementChild===e.lastElementChild&&c.Dom.isTag(e.firstElementChild,"code")&&n(e.firstElementChild),this.jodit.o.pasteCode.canonicalLanguageCode(t||"html")},t.prototype.onAfterGetValueFromEditor=function(e){var t=this,n=function(e,n,a,o,i,s){return"".concat(n.trim()).concat(o).concat((0,u.$)((0,r.stripTags)(i,t.j.ed,new Set(["br"])))).concat(s)};e.value=e.value.replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>\s*<code[^>]*>)(.*?)(<\/code>\s*<\/pre>)/gis,n).replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>)(.*?)(<\/pre>)/gis,n)},t.requires=["license"],(0,a.gn)([s.autobind],t.prototype,"__openCodeEditDialog",null),(0,a.gn)([(0,s.watch)("?:change"),(0,s.debounce)()],t.prototype,"__onChange",null),(0,a.gn)([(0,s.watch)(["?:dblclick","?:editPreInPasteCode"])],t.prototype,"onPreEdit",null),(0,a.gn)([(0,s.watch)("?:afterGetValueFromEditor")],t.prototype,"onAfterGetValueFromEditor",null),(0,a.gn)([s.component],t)}(o.S));function p(e,t){return e.promise((function(e,n){t.then(e).catch(n)}))}l.y.plugins.add("paste-code",d)}},function(e){return e(e.s=29782)}])}));
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
5
|
*/
|
|
6
|
-
import{Plugin as e}from"jodit/esm/core/plugin/plugin.js";import{Dom as
|
|
6
|
+
import{Plugin as e}from"jodit/esm/core/plugin/plugin.js";import{Dom as t}from"jodit/esm/core/dom/dom.js";import{isBoolean as o}from"jodit/esm/core/helpers/checker/is-boolean.js";import{isString as s}from"jodit/esm/core/helpers/checker/is-string.js";import{IS_TEST as i}from"jodit/esm/core/constants.js";import{JoditPro as r}from"jodit-pro/esm/jodit-pro.js";import{validateLicense as n}from"./helpers/helpers";export class license extends e{static make(e){return new license(e)}afterInit(e){this.j.e.on("checkReserve",(async()=>{const e=this.j.o.license,t=location.host;if(!s(e))return"";let o=n(e,t);return!o&&e[12]>"A"&&!i&&(o=await this.validateLicenseRemote(e,t)),o?"normal":""}))}beforeDestruct(e){}async validateLicenseRemote(e,s){const i="validateJoditLicenseRemote",r=this.j.storage.get(i);if(r&&n(r,s))return!0;const c=document.createElement("script");return c.src=`https://xdsoft.net/jodit/pro/api/licenses/validate/?code=${encodeURIComponent(e)}&host=${encodeURIComponent(s)}`,document.body.appendChild(c),this.j.async.promise((e=>{window.onJoditResolveKeyCode=r=>{try{if(o(r))return e(r);n(r,s)?(this.j.storage.set(i,r),e(!0)):e(!1)}finally{t.safeRemove(c)}},this.j.async.setTimeout((()=>{e(!1),t.safeRemove(c)}),3e3)}))}}r.plugins.add("license",license);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
5
|
*/
|
|
6
|
-
var e=this&&this.__decorate||function(e,t,o,i){var s,a=arguments.length,r=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,i);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(r=(a<3?s(r):a>3?s(t,o,r):s(t,o))||r);return a>3&&r&&Object.defineProperty(t,o,r),r};import{Plugin as t}from"jodit/esm/core/plugin/index.js";import{UIForm as o,UITextArea as i,UISelect as s,Button as a}from"jodit/esm/core/ui/index.js";import{autobind as r,component as n,watch as l,debounce as d}from"jodit/esm/core/decorators/index.js";import{$$ as c,appendScriptAsync as h,attr as g,loadNext as p,loadNextStyle as m,refs as u,stripTags as _}from"jodit/esm/core/helpers/index.js";import{JoditPro as f}from"jodit-pro/esm/jodit-pro.js";import{Dialog as j,Dom as C}from"jodit/esm/modules/index.js";import{htmlspecialchars as L}from"jodit/esm/core/helpers/html/htmlspecialchars.js";import{isBoolean as b}from"jodit/esm/core/helpers/checker/is-boolean.js";import{IS_PROD as E}from"jodit/esm/core/constants.js";import"./config";let v=class pasteCode extends t{constructor(){super(...arguments),this.buttons=[{name:"pasteCode",group:"clipboard"}],this.__highlightLibJSIsLoaded=!1,this.__loadLanguage=new Map}afterInit(e){e.registerCommand("pasteCode",(()=>this.__openCodeEditDialog()))}__openCodeEditDialog(e,t,o){const i=this.j,s=this.__createForm(),{code:a,language:r}=u(s);e&&(r.value=e),t&&(a.value=t),i.async.requestIdleCallback((()=>{a.focus()})),i.s.save(),this.__createDialog((()=>{if(!s.validate())return!1;{i.s.restore();const e=i.createInside.fromHTML(i.o.pasteCode.insertTemplate(i,r.value,a.value));if(o)C.replace(o,e,i.createInside,!1,!0);else{const t=i.s.current(),o=C.up(t,C.isBlock,i.editor);o?C.after(o,e):i.s.insertNode(e)}this.__imdOnChange()}}),(()=>{i.s.restore()})).setContent(s.container).open(!0)}beforeDestruct(e){}__createForm(){const{jodit:e}=this;return new o(e,[new s(e,{name:"language",label:"Language",value:e.o.pasteCode.defaultLanguage,options:e.o.pasteCode.languages,required:!0}),new i(e,{label:"Code view",resizable:!1,name:"code",required:!0,className:"jodit-paste-code__textarea"})],{className:"jodit-paste-code"})}__createDialog(e,t){const o=new j({language:this.j.o.language});return o.setHeader("Insert/Edit Code Sample").setSize(this.j.o.pasteCode.dialog.width,this.j.o.pasteCode.dialog.height).setFooter([a(o,"","Cancel","default").onAction((()=>{o.close(),t()})),a(o,"save","Save","primary").onAction((()=>{o.close(),e()}))]),o}__onChange(){this.__imdOnChange()}__imdOnChange(){c("pre",this.j.editor).forEach((e=>{g(e,"contenteditable")||(g(e,"contenteditable",!1),this.__highlightCode(e))}))}async __highlightCode(e){const{globalHighlightLib:t,highlightLib:{css:o,js:i,langUrl:s,highlight:a,isLangLoaded:r}}=this.j.o.pasteCode;this.__highlightLibJSIsLoaded||t||(this.__highlightLibJSIsLoaded=waitingPromise(this.async,Promise.all([m(this.jodit,o).catch((()=>null)),p(this.jodit,i).catch((()=>null))]))),b(this.__highlightLibJSIsLoaded)||await this.__highlightLibJSIsLoaded;const n=this.__parseLanguage(e);r(n)||t||(this.__loadLanguage.has(n)||(E||console.log("Load language",n,"for paste-code"),this.__loadLanguage.set(n,waitingPromise(this.async,h(this.jodit,s(n)).catch((()=>null))))),await this.__loadLanguage.get(n));let l=e;e.firstElementChild===e.lastElementChild&&C.isTag(e.firstElementChild,"code")&&(l=e.firstElementChild),l.innerHTML=a(l.innerText,n)}onPreEdit(e){const t=C.isNode(e)&&C.isTag(e,"pre")?e:C.closest(e.target,"pre",this.j.editor);if(t){const e=this.__parseLanguage(t);this.__openCodeEditDialog(e,t.innerText,t)}}__parseLanguage(e){let t=null;const getLang=e=>e.classList.forEach((e=>{if(/language-/.test(e)){const o=/language-(.*)/.exec(e);o&&o[1]&&(t=o[1])}}));return getLang(e),null==t&&e.firstElementChild===e.lastElementChild&&C.isTag(e.firstElementChild,"code")&&getLang(e.firstElementChild),this.jodit.o.pasteCode.canonicalLanguageCode(t||"html")}onAfterGetValueFromEditor(e){const strip=(e,t,o,i,s,a)=>`${t.trim()}${i}${L(_(s,this.j.ed,new Set(["br"])))}${a}`;e.value=e.value.replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>\s*<code[^>]*>)(.*?)(<\/code>\s*<\/pre>)/gis,strip).replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>)(.*?)(<\/pre>)/gis,strip)}};v.requires=["license"],e([r],v.prototype,"__openCodeEditDialog",null),e([l("?:change"),d()],v.prototype,"__onChange",null),e([l(["?:dblclick","?:editPreInPasteCode"])],v.prototype,"onPreEdit",null),e([l("?:afterGetValueFromEditor")],v.prototype,"onAfterGetValueFromEditor",null),v=e([n],v);export{v as pasteCode};function waitingPromise(e,t){return e.promise(((e,o)=>{t.then(e).catch(o)}))}f.plugins.add("paste-code",v);
|
|
6
|
+
var e=this&&this.__decorate||function(e,t,o,i){var s,a=arguments.length,r=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,i);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(r=(a<3?s(r):a>3?s(t,o,r):s(t,o))||r);return a>3&&r&&Object.defineProperty(t,o,r),r};import{Plugin as t}from"jodit/esm/core/plugin/index.js";import{UIForm as o,UITextArea as i,UISelect as s,Button as a}from"jodit/esm/core/ui/index.js";import{autobind as r,component as n,watch as l,debounce as d}from"jodit/esm/core/decorators/index.js";import{$$ as c,appendScriptAsync as h,attr as g,loadNext as p,loadNextStyle as m,refs as u,stripTags as _}from"jodit/esm/core/helpers/index.js";import{JoditPro as f}from"jodit-pro/esm/jodit-pro.js";import{Dialog as j,Dom as C}from"jodit/esm/modules/index.js";import{htmlspecialchars as L}from"jodit/esm/core/helpers/html/htmlspecialchars.js";import{isBoolean as b}from"jodit/esm/core/helpers/checker/is-boolean.js";import{IS_PROD as E}from"jodit/esm/core/constants.js";import"./config";let v=class pasteCode extends t{constructor(){super(...arguments),this.buttons=[{name:"pasteCode",group:"clipboard"}],this.__highlightLibJSIsLoaded=!1,this.__loadLanguage=new Map}afterInit(e){e.registerCommand("pasteCode",(()=>this.__openCodeEditDialog()))}__openCodeEditDialog(e,t,o){const i=this.j,s=this.__createForm(),{code:a,language:r}=u(s);e&&(r.value=e),t&&(a.value=t),i.async.requestIdleCallback((()=>{a.focus()})),i.s.save(),this.__createDialog((()=>{if(!s.validate())return!1;{i.s.restore();const e=i.createInside.fromHTML(i.o.pasteCode.insertTemplate(i,r.value,a.value));if(o)C.replace(o,e,i.createInside,!1,!0);else{const t=i.s.current(),o=C.up(t,C.isBlock,i.editor);o&&!C.isCell(o)?C.after(o,e):i.s.insertNode(e)}this.__imdOnChange()}}),(()=>{i.s.restore()})).setContent(s.container).open(!0)}beforeDestruct(e){}__createForm(){const{jodit:e}=this;return new o(e,[new s(e,{name:"language",label:"Language",value:e.o.pasteCode.defaultLanguage,options:e.o.pasteCode.languages,required:!0}),new i(e,{label:"Code view",resizable:!1,name:"code",required:!0,className:"jodit-paste-code__textarea"})],{className:"jodit-paste-code"})}__createDialog(e,t){const o=new j({language:this.j.o.language});return o.setHeader("Insert/Edit Code Sample").setSize(this.j.o.pasteCode.dialog.width,this.j.o.pasteCode.dialog.height).setFooter([a(o,"","Cancel","default").onAction((()=>{o.close(),t()})),a(o,"save","Save","primary").onAction((()=>{o.close(),e()}))]),o}__onChange(){this.__imdOnChange()}__imdOnChange(){c("pre",this.j.editor).forEach((e=>{g(e,"contenteditable")||(g(e,"contenteditable",!1),this.__highlightCode(e))}))}async __highlightCode(e){const{globalHighlightLib:t,highlightLib:{css:o,js:i,langUrl:s,highlight:a,isLangLoaded:r}}=this.j.o.pasteCode;this.__highlightLibJSIsLoaded||t||(this.__highlightLibJSIsLoaded=waitingPromise(this.async,Promise.all([m(this.jodit,o).catch((()=>null)),p(this.jodit,i).catch((()=>null))]))),b(this.__highlightLibJSIsLoaded)||await this.__highlightLibJSIsLoaded;const n=this.__parseLanguage(e);r(n)||t||(this.__loadLanguage.has(n)||(E||console.log("Load language",n,"for paste-code"),this.__loadLanguage.set(n,waitingPromise(this.async,h(this.jodit,s(n)).catch((()=>null))))),await this.__loadLanguage.get(n));let l=e;e.firstElementChild===e.lastElementChild&&C.isTag(e.firstElementChild,"code")&&(l=e.firstElementChild),l.innerHTML=a(l.innerText,n)}onPreEdit(e){const t=C.isNode(e)&&C.isTag(e,"pre")?e:C.closest(e.target,"pre",this.j.editor);if(t){const e=this.__parseLanguage(t);this.__openCodeEditDialog(e,t.innerText,t)}}__parseLanguage(e){let t=null;const getLang=e=>e.classList.forEach((e=>{if(/language-/.test(e)){const o=/language-(.*)/.exec(e);o&&o[1]&&(t=o[1])}}));return getLang(e),null==t&&e.firstElementChild===e.lastElementChild&&C.isTag(e.firstElementChild,"code")&&getLang(e.firstElementChild),this.jodit.o.pasteCode.canonicalLanguageCode(t||"html")}onAfterGetValueFromEditor(e){const strip=(e,t,o,i,s,a)=>`${t.trim()}${i}${L(_(s,this.j.ed,new Set(["br"])))}${a}`;e.value=e.value.replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>\s*<code[^>]*>)(.*?)(<\/code>\s*<\/pre>)/gis,strip).replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>)(.*?)(<\/pre>)/gis,strip)}};v.requires=["license"],e([r],v.prototype,"__openCodeEditDialog",null),e([l("?:change"),d()],v.prototype,"__onChange",null),e([l(["?:dblclick","?:editPreInPasteCode"])],v.prototype,"onPreEdit",null),e([l("?:afterGetValueFromEditor")],v.prototype,"onAfterGetValueFromEditor",null),v=e([n],v);export{v as pasteCode};function waitingPromise(e,t){return e.promise(((e,o)=>{t.then(e).catch(o)}))}f.plugins.add("paste-code",v);
|