jodit-pro 4.11.26 → 4.11.28
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/CHANGELOG.md +115 -1
- package/es2015/jodit.css +32 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +6 -6
- package/es2015/jodit.js +39 -9
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +3 -3
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +105 -3
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +4 -4
- 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/style/style.css +1 -1
- package/es2015/plugins/style/style.js +58 -7
- package/es2015/plugins/style/style.min.js +2 -2
- package/es2015/plugins/templates/templates.css +1 -1
- package/es2015/plugins/templates/templates.js +1 -1
- package/es2015/plugins/templates/templates.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.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +6 -6
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +23 -23
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.min.js +1 -1
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/style/style.min.js +2 -2
- package/es2018/plugins/templates/templates.min.js +1 -1
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021/jodit.css +32 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +6 -6
- package/es2021/jodit.js +39 -8
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +3 -3
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +105 -3
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +5 -5
- 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/style/style.css +1 -1
- package/es2021/plugins/style/style.js +56 -5
- package/es2021/plugins/style/style.min.js +2 -2
- package/es2021/plugins/templates/templates.css +1 -1
- package/es2021/plugins/templates/templates.js +1 -1
- package/es2021/plugins/templates/templates.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 +32 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +6 -6
- package/es2021.en/jodit.js +39 -8
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +3 -3
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +105 -3
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +26 -26
- 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/style/style.css +1 -1
- package/es2021.en/plugins/style/style.js +56 -5
- package/es2021.en/plugins/style/style.min.js +2 -2
- package/es2021.en/plugins/templates/templates.css +1 -1
- package/es2021.en/plugins/templates/templates.js +1 -1
- package/es2021.en/plugins/templates/templates.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 +37 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +43 -9
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +169 -3
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.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/style/style.css +1 -1
- package/es5/plugins/style/style.js +114 -25
- package/es5/plugins/style/style.min.js +2 -2
- package/es5/plugins/templates/templates.css +1 -1
- package/es5/plugins/templates/templates.js +1 -1
- package/es5/plugins/templates/templates.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/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +2 -0
- package/esm/plugins/ai-assistant-pro/ai-assistant-pro.d.ts +3 -0
- package/esm/plugins/ai-assistant-pro/ai-assistant-pro.js +2 -2
- package/esm/plugins/ai-assistant-pro/config.js +1 -1
- package/esm/plugins/ai-assistant-pro/interface/options.d.ts +40 -0
- package/esm/plugins/ai-assistant-pro/providers/jodit-ai-adapter.js +1 -1
- package/esm/plugins/autocomplete/autocomplete.js +1 -1
- package/esm/plugins/autocomplete/config.d.ts +2 -1
- package/esm/plugins/autocomplete/config.js +1 -1
- package/esm/plugins/autocomplete/interface.d.ts +1 -0
- package/esm/plugins/autocomplete/ui/autocomplete.d.ts +3 -1
- package/esm/plugins/autocomplete/ui/autocomplete.js +1 -1
- package/esm/plugins/autocomplete/ui/item.d.ts +2 -0
- package/esm/plugins/autocomplete/ui/item.js +1 -1
- package/esm/plugins/style/helpers/apply-style.js +1 -1
- package/esm/plugins/style/helpers/detect-active-style.js +1 -1
- package/esm/plugins/style/interface.d.ts +2 -1
- package/esm/plugins/style/ui/style-popup.js +1 -1
- package/package.json +1 -1
- package/types/config.d.ts +2 -0
- package/types/plugins/ai-assistant-pro/ai-assistant-pro.d.ts +3 -0
- package/types/plugins/ai-assistant-pro/interface/options.d.ts +40 -0
- package/types/plugins/autocomplete/config.d.ts +2 -1
- package/types/plugins/autocomplete/interface.d.ts +1 -0
- package/types/plugins/autocomplete/ui/autocomplete.d.ts +3 -1
- package/types/plugins/autocomplete/ui/item.d.ts +2 -0
- package/types/plugins/style/interface.d.ts +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit-pro - PRO Version of Jodit Editor
|
|
3
3
|
* Author: Chupurnov Valerii <chupurnov@gmail.com>
|
|
4
|
-
* Version: v4.11.
|
|
4
|
+
* Version: v4.11.28
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
@@ -200,6 +200,12 @@ function addExtraClasses(editor, def) {
|
|
|
200
200
|
}
|
|
201
201
|
function buildCommitStyleOptions(def) {
|
|
202
202
|
var _def_classes;
|
|
203
|
+
if (def.attributes) {
|
|
204
|
+
return {
|
|
205
|
+
element: def.element,
|
|
206
|
+
attributes: def.attributes
|
|
207
|
+
};
|
|
208
|
+
}
|
|
203
209
|
var firstClass = (_def_classes = def.classes) === null || _def_classes === void 0 ? void 0 : _def_classes.filter(Boolean)[0];
|
|
204
210
|
if (firstClass) {
|
|
205
211
|
return {
|
|
@@ -217,13 +223,17 @@ function applyStyle(editor, def, definitions) {
|
|
|
217
223
|
var active = (0,_detect_active_style__WEBPACK_IMPORTED_MODULE_0__.detectActiveStyle)(editor, definitions);
|
|
218
224
|
if (active) {
|
|
219
225
|
editor.s.commitStyle(buildCommitStyleOptions(active));
|
|
220
|
-
|
|
226
|
+
if (!active.attributes) {
|
|
227
|
+
cleanupExtraClasses(editor, active);
|
|
228
|
+
}
|
|
221
229
|
if (active === def) {
|
|
222
230
|
return;
|
|
223
231
|
}
|
|
224
232
|
}
|
|
225
233
|
editor.s.commitStyle(buildCommitStyleOptions(def));
|
|
226
|
-
|
|
234
|
+
if (!def.attributes) {
|
|
235
|
+
addExtraClasses(editor, def);
|
|
236
|
+
}
|
|
227
237
|
}
|
|
228
238
|
|
|
229
239
|
|
|
@@ -295,19 +305,92 @@ function classifyDefinitions(definitions) {
|
|
|
295
305
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
296
306
|
/* harmony export */ detectActiveStyle: function() { return /* binding */ detectActiveStyle; }
|
|
297
307
|
/* harmony export */ });
|
|
298
|
-
/* harmony import */ var
|
|
299
|
-
/* harmony import */ var
|
|
308
|
+
/* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43284);
|
|
309
|
+
/* harmony import */ var _swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61200);
|
|
310
|
+
/* harmony import */ var jodit_esm_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(82758);
|
|
311
|
+
/* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2748);
|
|
312
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29960);
|
|
313
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41180);
|
|
300
314
|
/*!
|
|
301
315
|
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
302
316
|
* See LICENSE.md in the project root for license information.
|
|
303
317
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
304
318
|
*/
|
|
305
319
|
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
function attributesMatch(el, attrs) {
|
|
325
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
326
|
+
try {
|
|
327
|
+
for(var _iterator = Object.entries(attrs)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
328
|
+
var _step_value = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_0__._)(_step.value, 2), key = _step_value[0], value = _step_value[1];
|
|
329
|
+
if (value == null) {
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
if (key === 'class') {
|
|
333
|
+
if (typeof value === 'string' && !el.classList.contains(value)) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
} else if (key === 'style') {
|
|
337
|
+
if ((typeof value === "undefined" ? "undefined" : (0,_swc_helpers_type_of__WEBPACK_IMPORTED_MODULE_1__._)(value)) === 'object' && value != null) {
|
|
338
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
339
|
+
try {
|
|
340
|
+
for(var _iterator1 = Object.entries(value)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
341
|
+
var _step_value1 = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_0__._)(_step1.value, 2), prop = _step_value1[0], styleValue = _step_value1[1];
|
|
342
|
+
if (styleValue == null) {
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
if ((0,jodit_esm_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(el, prop, true) !== String(styleValue)) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
} catch (err) {
|
|
350
|
+
_didIteratorError1 = true;
|
|
351
|
+
_iteratorError1 = err;
|
|
352
|
+
} finally{
|
|
353
|
+
try {
|
|
354
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
355
|
+
_iterator1.return();
|
|
356
|
+
}
|
|
357
|
+
} finally{
|
|
358
|
+
if (_didIteratorError1) {
|
|
359
|
+
throw _iteratorError1;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
} else {
|
|
365
|
+
if ((0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(el, key) !== String(value)) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
} catch (err) {
|
|
371
|
+
_didIteratorError = true;
|
|
372
|
+
_iteratorError = err;
|
|
373
|
+
} finally{
|
|
374
|
+
try {
|
|
375
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
376
|
+
_iterator.return();
|
|
377
|
+
}
|
|
378
|
+
} finally{
|
|
379
|
+
if (_didIteratorError) {
|
|
380
|
+
throw _iteratorError;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
306
386
|
function elementMatchesDefinition(el, def) {
|
|
307
387
|
var _def_classes;
|
|
308
388
|
if (el.nodeName.toLowerCase() !== def.element) {
|
|
309
389
|
return false;
|
|
310
390
|
}
|
|
391
|
+
if (def.attributes) {
|
|
392
|
+
return attributesMatch(el, def.attributes);
|
|
393
|
+
}
|
|
311
394
|
var classes = (_def_classes = def.classes) === null || _def_classes === void 0 ? void 0 : _def_classes.filter(Boolean);
|
|
312
395
|
if (!(classes === null || classes === void 0 ? void 0 : classes.length)) {
|
|
313
396
|
return true;
|
|
@@ -325,15 +408,15 @@ function detectActiveStyle(editor, definitions) {
|
|
|
325
408
|
try {
|
|
326
409
|
for(var _iterator = definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
327
410
|
var def = _step.value;
|
|
328
|
-
if (
|
|
329
|
-
var block =
|
|
411
|
+
if (jodit_esm_core_constants__WEBPACK_IMPORTED_MODULE_2__.IS_BLOCK.test(def.element)) {
|
|
412
|
+
var block = jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(current, jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isBlock, editor.editor);
|
|
330
413
|
if (block && elementMatchesDefinition(block, def)) {
|
|
331
414
|
return def;
|
|
332
415
|
}
|
|
333
416
|
} else {
|
|
334
|
-
var node =
|
|
417
|
+
var node = jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isElement(current) ? current : current.parentNode;
|
|
335
418
|
while(node && node !== editor.editor){
|
|
336
|
-
if (
|
|
419
|
+
if (jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isElement(node) && elementMatchesDefinition(node, def)) {
|
|
337
420
|
return def;
|
|
338
421
|
}
|
|
339
422
|
node = node.parentNode;
|
|
@@ -435,6 +518,7 @@ jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_8__.JoditPro.plugins.add('style', s
|
|
|
435
518
|
/* harmony import */ var _helpers_apply_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31105);
|
|
436
519
|
/* harmony import */ var _helpers_classify_definitions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8060);
|
|
437
520
|
/* harmony import */ var _helpers_detect_active_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69341);
|
|
521
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29960);
|
|
438
522
|
/*!
|
|
439
523
|
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
440
524
|
* See LICENSE.md in the project root for license information.
|
|
@@ -442,6 +526,7 @@ jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_8__.JoditPro.plugins.add('style', s
|
|
|
442
526
|
*/
|
|
443
527
|
|
|
444
528
|
|
|
529
|
+
|
|
445
530
|
var CLASS_NAME = 'jodit-style-popup';
|
|
446
531
|
function buildStylePopup(editor, definitions, close) {
|
|
447
532
|
var groups = (0,_helpers_classify_definitions__WEBPACK_IMPORTED_MODULE_1__.classifyDefinitions)(definitions);
|
|
@@ -459,31 +544,35 @@ function buildStylePopup(editor, definitions, close) {
|
|
|
459
544
|
try {
|
|
460
545
|
var _loop = function() {
|
|
461
546
|
var def = _step1.value;
|
|
462
|
-
var _ref;
|
|
463
|
-
var _def_classes;
|
|
464
547
|
var card = editor.c.element('button');
|
|
465
548
|
card.type = 'button';
|
|
466
549
|
var isActive = active === def;
|
|
467
550
|
card.className = "".concat(CLASS_NAME, "__card") + (isActive ? " ".concat(CLASS_NAME, "__card_active_true") : '');
|
|
468
551
|
var preview = editor.c.div("".concat(CLASS_NAME, "__card-preview"));
|
|
469
552
|
var previewEl = editor.c.element(def.element);
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
} catch (err) {
|
|
477
|
-
_didIteratorError = true;
|
|
478
|
-
_iteratorError = err;
|
|
479
|
-
} finally{
|
|
553
|
+
if (def.attributes) {
|
|
554
|
+
(0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(previewEl, def.attributes);
|
|
555
|
+
} else {
|
|
556
|
+
var _ref;
|
|
557
|
+
var _def_classes;
|
|
558
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
480
559
|
try {
|
|
481
|
-
|
|
482
|
-
|
|
560
|
+
for(var _iterator = ((_ref = (_def_classes = def.classes) === null || _def_classes === void 0 ? void 0 : _def_classes.filter(Boolean)) !== null && _ref !== void 0 ? _ref : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
561
|
+
var cls = _step.value;
|
|
562
|
+
previewEl.classList.add(cls);
|
|
483
563
|
}
|
|
564
|
+
} catch (err) {
|
|
565
|
+
_didIteratorError = true;
|
|
566
|
+
_iteratorError = err;
|
|
484
567
|
} finally{
|
|
485
|
-
|
|
486
|
-
|
|
568
|
+
try {
|
|
569
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
570
|
+
_iterator.return();
|
|
571
|
+
}
|
|
572
|
+
} finally{
|
|
573
|
+
if (_didIteratorError) {
|
|
574
|
+
throw _iteratorError;
|
|
575
|
+
}
|
|
487
576
|
}
|
|
488
577
|
}
|
|
489
578
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit-pro - PRO Version of Jodit Editor
|
|
3
3
|
* Author: Chupurnov Valerii <chupurnov@gmail.com>
|
|
4
|
-
* Version: v4.11.
|
|
4
|
+
* Version: v4.11.28
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
8
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var
|
|
8
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[850],{78955:function(t){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="1.5"> <rect x="2" y="3.5" width="9" height="9" rx="1.5" fill="none"/> <rect x="2" y="14.5" width="9" height="9" rx="1.5" fill="none"/> <rect x="13" y="14.5" width="9" height="9" rx="1.5" fill="none"/> <rect x="13" y="3.5" width="9" height="9" rx="1.5" fill="currentColor" transform="rotate(45 17.5 8)"/> </svg>'},28609:function(t,e,r){"use strict";var n=r(69341),i=r(5440),o=r(78955),l=r.n(o),s=r(6441);s.Config.prototype.customStyles={definitions:[]},s.Config.prototype.controls.style={tooltip:"Styles",icon:l(),isDisabled:function(t){return!t.o.customStyles.definitions.length},isActive:function(t){var e=t.o.customStyles.definitions;return!!e.length&&null!=(0,n.detectActiveStyle)(t,e)},update:function(t,e){var r,i=t.o.customStyles.definitions;if(i.length){var o=(0,n.detectActiveStyle)(t,i),l=(null==(r=e.control)?void 0:r.component)==="select";(t.o.textIcons||l)&&(o?e.state.text=o.name:e.state.text=l?t.i18n("Styles"):"")}},exec:function(){return!1},popup:function(t,e,r){var n=t.o.customStyles.definitions;if(!n.length)return!1;t.s.current()||t.s.focus(),t.s.save();var o=(0,i.buildStylePopup)(t,n,function(){t.s.restore(),r()});return t.e.one("beforePopupClose",function(){t.s.restore()}),o}}},31105:function(t,e,r){"use strict";r.d(e,{applyStyle:function(){return u}});var n=r(69341),i=r(82758),o=r(2748);function l(t,e){var r=t.s.current();if(!r)return null;if(i.IS_BLOCK.test(e.element))return o.Dom.closest(r,o.Dom.isBlock,t.editor);for(var n=o.Dom.isElement(r)?r:r.parentNode;n&&n!==t.editor;){if(o.Dom.isElement(n)&&n.nodeName.toLowerCase()===e.element)return n;n=n.parentNode}return null}function s(t,e){var r=!0,n=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(r=(o=l.next()).done);r=!0){var s=o.value;t.classList.remove(s)}}catch(t){n=!0,i=t}finally{try{r||null==l.return||l.return()}finally{if(n)throw i}}""===t.className&&t.removeAttribute("class")}function a(t){if(t.attributes)return{element:t.element,attributes:t.attributes};var e,r=null==(e=t.classes)?void 0:e.filter(Boolean)[0];return r?{element:t.element,attributes:{class:r}}:{element:t.element}}function u(t,e,r){var u=(0,n.detectActiveStyle)(t,r);(!u||(t.s.commitStyle(a(u)),u.attributes||function(t,e){var r,n=null==(r=e.classes)?void 0:r.filter(Boolean);if(n&&!(n.length<=1)){var a=t.s.current();if(a)if(i.IS_BLOCK.test(e.element)){var u=o.Dom.closest(a,o.Dom.isBlock,t.editor);u&&s(u,n.slice(1))}else{var c=l(t,e);c&&(s(c,n.slice(1)),"span"!==c.nodeName.toLowerCase()||c.attributes.length||o.Dom.unwrap(c))}}}(t,u),u!==e))&&(t.s.commitStyle(a(e)),e.attributes||function(t,e){var r,n=null==(r=e.classes)?void 0:r.filter(Boolean);if(n&&!(n.length<=1)){var i=l(t,e);if(i)for(var o=1;o<n.length;o++)i.classList.add(n[o])}}(t,e))}},8060:function(t,e,r){"use strict";r.d(e,{classifyDefinitions:function(){return i}});var n=r(82758);function i(t){var e=[],r=[],i=!0,o=!1,l=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done);i=!0){var u=s.value;n.IS_BLOCK.test(u.element)?e.push(u):r.push(u)}}catch(t){o=!0,l=t}finally{try{i||null==a.return||a.return()}finally{if(o)throw l}}var c=[];return e.length&&c.push({title:"Block styles",definitions:e}),r.length&&c.push({title:"Text styles",definitions:r}),c}},69341:function(t,e,r){"use strict";r.d(e,{detectActiveStyle:function(){return c}});var n=r(43284),i=r(61200),o=r(82758),l=r(2748),s=r(29960),a=r(41180);function u(t,e){if(t.nodeName.toLowerCase()!==e.element)return!1;if(e.attributes)return function(t,e){var r=!0,o=!1,l=void 0;try{for(var u,c=Object.entries(e)[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var f=(0,n._)(u.value,2),v=f[0],d=f[1];if(null!=d){if("class"===v){if("string"==typeof d&&!t.classList.contains(d))return!1}else if("style"===v){if((void 0===d?"undefined":(0,i._)(d))==="object"&&null!=d){var y=!0,p=!1,m=void 0;try{for(var h,b=Object.entries(d)[Symbol.iterator]();!(y=(h=b.next()).done);y=!0){var S=(0,n._)(h.value,2),x=S[0],g=S[1];if(null!=g&&(0,a.css)(t,x,!0)!==String(g))return!1}}catch(t){p=!0,m=t}finally{try{y||null==b.return||b.return()}finally{if(p)throw m}}}}else if((0,s.attr)(t,v)!==String(d))return!1}}}catch(t){o=!0,l=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw l}}return!0}(t,e.attributes);var r,o=null==(r=e.classes)?void 0:r.filter(Boolean);return null==o||!o.length||o.every(function(e){return t.classList.contains(e)})}function c(t,e){var r=t.s.current();if(!r)return null;var n=!0,i=!1,s=void 0;try{for(var a,c=e[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var f=a.value;if(o.IS_BLOCK.test(f.element)){var v=l.Dom.closest(r,l.Dom.isBlock,t.editor);if(v&&u(v,f))return f}else for(var d=l.Dom.isElement(r)?r:r.parentNode;d&&d!==t.editor;){if(l.Dom.isElement(d)&&u(d,f))return f;d=d.parentNode}}}catch(t){i=!0,s=t}finally{try{n||null==c.return||c.return()}finally{if(i)throw s}}return null}},75554:function(t,e,r){"use strict";r.r(e),r.d(e,{style:function(){return f}});var n=r(80294),i=r(20616),o=r(67709),l=r(82749),s=r(18766),a=r(23078);r(28609);var u=r(50911),c=r(2692),f=function(t){function e(){var t;return(0,i._)(this,e),t=(0,n._)(this,e,arguments),(0,l._)(t,"buttons",[{name:"style",group:"font"}]),t}return(0,s._)(e,t),(0,o._)(e,[{key:"afterInit",value:function(t){}},{key:"beforeDestruct",value:function(t){}}]),e}((0,a._)(u.Plugin));(0,l._)(f,"requires",["license"]),c.JoditPro.plugins.add("style",f)},5440:function(t,e,r){"use strict";r.d(e,{buildStylePopup:function(){return a}});var n=r(31105),i=r(8060),o=r(69341),l=r(29960),s="jodit-style-popup";function a(t,e,r){var a=(0,i.classifyDefinitions)(e),u=(0,o.detectActiveStyle)(t,e),c=t.c.div(s),f=!0,v=!1,d=void 0;try{for(var y,p=a[Symbol.iterator]();!(f=(y=p.next()).done);f=!0){var m=y.value,h=t.c.div("".concat(s,"__group-title"));h.textContent=t.i18n(m.title),c.appendChild(h);var b=t.c.div("".concat(s,"__grid")),S=!0,x=!1,g=void 0;try{for(var _,w=m.definitions[Symbol.iterator]();!(S=(_=w.next()).done);S=!0)!function(){var i=_.value,o=t.c.element("button");o.type="button";var a=u===i;o.className="".concat(s,"__card")+(a?" ".concat(s,"__card_active_true"):"");var c=t.c.div("".concat(s,"__card-preview")),f=t.c.element(i.element);if(i.attributes)(0,l.attr)(f,i.attributes);else{var v=!0,d=!1,y=void 0;try{for(var p,m,h,S=(null!=(p=null==(m=i.classes)?void 0:m.filter(Boolean))?p:[])[Symbol.iterator]();!(v=(h=S.next()).done);v=!0){var x=h.value;f.classList.add(x)}}catch(t){d=!0,y=t}finally{try{v||null==S.return||S.return()}finally{if(d)throw y}}}f.textContent=i.name,c.appendChild(f),o.appendChild(c);var g=t.c.div("".concat(s,"__card-label"));g.textContent=i.name,o.appendChild(g),t.e.on(o,"click",function(){t.s.focus(),(0,n.applyStyle)(t,i,e),t.synchronizeValues(),r()}),b.appendChild(o)}()}catch(t){x=!0,g=t}finally{try{S||null==w.return||w.return()}finally{if(x)throw g}}c.appendChild(b)}}catch(t){v=!0,d=t}finally{try{f||null==p.return||p.return()}finally{if(v)throw d}}return c}}},function(t){return t(t.s=75554)}])});
|
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IAIAssistantProOptions } from "./plugins/ai-assistant-pro/interface/index";
|
|
2
|
+
import type { AutoCompleteDisplayMode } from "./plugins/autocomplete/interface";
|
|
2
3
|
import type { IAutoCompleteItem } from "./plugins/autocomplete/interface";
|
|
3
4
|
import type { AutoCompleteSource } from "./plugins/autocomplete/interface";
|
|
4
5
|
import type { ISnapshotStorage } from "./plugins/backup/interface";
|
|
@@ -39,6 +40,7 @@ interface Config {
|
|
|
39
40
|
}
|
|
40
41
|
interface Config {
|
|
41
42
|
autocomplete: {
|
|
43
|
+
displayMode: AutoCompleteDisplayMode;
|
|
42
44
|
maxItems: number;
|
|
43
45
|
isMatchedQuery: (query: string, value: string) => boolean;
|
|
44
46
|
itemRenderer: <T = any>(item: IAutoCompleteItem<T>) => string | HTMLElement;
|
|
@@ -18,6 +18,9 @@ export declare class aiAssistantPro extends Plugin {
|
|
|
18
18
|
* Get or create dialog
|
|
19
19
|
*/
|
|
20
20
|
private get dialog();
|
|
21
|
+
private textAutocompleteSource;
|
|
22
|
+
private textAutocompleteCache;
|
|
23
|
+
private setupTextAutocomplete;
|
|
21
24
|
protected afterInit(): void;
|
|
22
25
|
private __initedPromise;
|
|
23
26
|
private __loadData;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var b=Object.defineProperty;var _=(M,t)=>b(M,"name",{value:t,configurable:!0});var f,h=function(M,t,e,a){var s=arguments.length,i=s<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,e):a,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(M,t,e,a);else for(var o=M.length-1;o>=0;o--)(n=M[o])&&(i=(s<3?n(i):s>3?n(t,e,i):n(t,e))||i);return s>3&&i&&Object.defineProperty(t,e,i),i};import"./config.js";import{APIClient as R}from"./helpers/api-client.js";import{PermissionManager as E}from"./helpers/permission-manager.js";import{StateManager as O}from"./helpers/state-manager.js";import{createStorageProvider as k,WebStorageConversationStorage as W}from"./helpers/storage/index.js";import{ToolRegistry as z}from"./helpers/tool-registry.js";import{UIMainPanel as F}from"./ui/main-panel/index.js";import{applyTheme as L,areAllToolCallsExecuted as H,createNewConversation as y,createUserMessage as j,deleteConversationWithCleanup as q,executeToolCall as Q,findMessagesWithPendingToolCalls as $,findParentMessageId as V,getCurrentSelectionContext as A,handleBackToList as N,handleConversationSearch as U,handleConversationSelect as B,handleToolApproval as G,handleToolDenial as J,invertMode as X,isTerminalToolCallStatus as Y,loadInitialData as Z,processArtifacts as K,processFinalResponse as tt,processStreamingResponse as et,resizeInPanelView as T,updateToolCallInMessage as st}from"./core/index.js";import*as at from"./langs/index.js";import{IS_PROD as it}from"jodit/esm/core/constants.js";import{cache as u,cached as p,component as nt,debounce as ot,watch as d}from"jodit/esm/core/decorators/index.js";import{extendLang as rt}from"jodit/esm/core/global.js";import{isAbortError as w,isString as lt}from"jodit/esm/core/helpers/index.js";import{Plugin as ht}from"jodit/esm/core/plugin/index.js";import{JoditPro as ct}from"../../jodit-pro.js";import{UIFlightPosition as D}from"../../traits/flight-position/flight-position.js";import{UIResize as S}from"../../traits/resize/resize.js";let l=(f=class extends ht{constructor(){super(...arguments),this.buttons=[{name:"aiAssistantPro",group:"insert"},{name:"aiCommandsPro",group:"insert"}],this.textAutocompleteSource=null,this.textAutocompleteCache=new Map,this.__initedPromise=null,this.__openedMode=null}get state(){return this.stateManager.state}get toolRegistry(){return new z(this.j)}get permissionManager(){return new E(this.j,this.toolRegistry)}get apiClient(){return new R(this.j,this.toolRegistry)}get storage(){const{storage:t,storageKey:e,maxConversations:a}=this.j.o.aiAssistantPro;if(typeof t=="string"){const s=k(t,e);return new W(s,a)}return t}get stateManager(){return new O(this.j)}get mainPanel(){return new F(this.j,this.stateManager.state,this.j.o.aiAssistantPro,t=>{const e=this.stateManager.getCurrentConversation();e&&this.stateManager.setCurrentConversation({...e,...t})})}get dialog(){const t=this.j.dlg({resizable:this.j.o.aiAssistantPro.resizable,eventEmmiter:this.j.e});return t.e.on(t,"afterClose",()=>{this.j.e.fire("closeAIAssistantPro.ai-assistant-pro")}),t}setupTextAutocomplete(){const{textAutocompleteEnabled:t,textAutocompleteApiRequest:e,textAutocompleteMinQueryLength:a,textAutocompleteMaxSuggestions:s,textAutocompleteDebounceMs:i,textAutocompleteCacheTTL:n,textAutocompleteCacheMaxSize:o}=this.j.o.aiAssistantPro;if(!t||!e)return;this.j.o.autocomplete={...this.j.o.autocomplete,displayMode:"inline"};const r=this.textAutocompleteCache;let c=null;this.textAutocompleteSource=v=>{if(v.length<a)return[];const P=`${v}:${s}`;if(n>0){const g=r.get(P);if(g&&Date.now()-g.ts<n)return g.data.map(m=>({value:m,title:m}))}c&&clearTimeout(c);const I=new AbortController;return new Promise(g=>{c=setTimeout(async()=>{try{const m=await e(v,s,I.signal);if(Array.isArray(m)){const x=m.slice(0,s);if(n>0){if(r.size>=o){const C=r.keys().next().value;C!=null&&r.delete(C)}r.set(P,{ts:Date.now(),data:x})}g(x.map(C=>({value:C,title:C})));return}g([])}catch{g([])}},i)})},this.j.e.fire("registerAutocompleteSource",this.textAutocompleteSource)}afterInit(){rt(at),this.setupEventListeners(),this.setupTextAutocomplete(),this.j.async.promise(t=>{const{initiallyOpened:e,persistOpenState:a}=this.j.o.aiAssistantPro;let s=e;if(a){this.storage.getGlobalSettings().then(i=>{if(i?.isOpen!=null&&(s=i.isOpen),s)return this.openAssistant()}).catch(()=>null).finally(()=>t(void 0));return}t(void 0)}).catch(()=>null)}__loadData(){return this.__initedPromise?this.__initedPromise:this.isDestructed?Promise.reject():(this.__initedPromise=this.j.async.promise(t=>{this.loadInitialData().then(t)}).catch(()=>null),this.__initedPromise)}async loadInitialData(){this.mainPanel.setMod("ready",!0),await Z(this.j,this.storage,this.stateManager),await this.restorePendingToolCalls()}async restorePendingToolCalls(){const t=this.stateManager.getCurrentConversation();if(!t)return;const e=$(t);if(e.length!==0)for(const a of e)await this.handleToolCalls(a.id)}setupEventListeners(){this.j.e.on("selectConversation.ai-assistant-pro",async t=>{try{await this.__loadData(),await B(t,this.storage,this.stateManager)}catch(e){it||console.log(e)}}),this.j.e.on("newConversation.ai-assistant-pro",async()=>{await this.__loadData();const t=y(this.j,this.state.defaultModel,this.state.defaultTemperature);this.stateManager.setCurrentConversation(t)}),this.j.e.on("deleteConversation.ai-assistant-pro",async t=>{await this.__loadData(),await this.deleteConversation(t)}),this.j.e.on("renameConversation.ai-assistant-pro",async(t,e)=>{await this.__loadData(),await this.renameConversation(t,e)}),this.j.e.on("backToList.ai-assistant-pro",async()=>{await this.__loadData(),await N(this.storage,this.stateManager)}),this.j.e.on("removeContext.ai-assistant-pro",async t=>{await this.__loadData(),this.stateManager.removeSelectionContext(t)}),this.j.e.on("approveToolCall.ai-assistant-pro",async(t,e)=>{try{await this.__loadData();const a=await G(t,e,this.stateManager,this.permissionManager,this.storage);if(a){const s=this.stateManager.getCurrentConversation();if(!s)return;const i=s.messages.find(n=>{var o;return(o=n.toolCalls)===null||o===void 0?void 0:o.some(r=>r.id===a.id)});if(!i)return;await this.executeToolCall(i.id,a)}}catch(a){if(w(a))return;this.stateManager.setError(a instanceof Error?a.message:String(a))}}),this.j.e.on("denyToolCall.ai-assistant-pro",async t=>{await this.__loadData(),await J(this.j,t,this.stateManager,this.storage)}),this.j.e.on("abortRequest.ai-assistant-pro",async()=>{await this.__loadData(),this.apiClient.abort(),this.stateManager.setLoading(!1)})}__applyTheme(){L(this.j,this.stateManager.state.theme,this.stateManager.state.displayMode,this.mainPanel.container,this.dialog)}async openAssistant(){if(this.stateManager.isOpen()){this.stateManager.close(),await this.__closeInContainer();return}await this.__loadData(),!this.isDestructed&&(this.stateManager.open(),await this.__openInContainer(),this.j.o.aiAssistantPro.includeSelectionByDefault&&!this.j.s.isCollapsed()&&this.addCurrentSelectionToContext())}async __openInContainer(){const{resizable:t,allowClose:e,flightPanelHeight:a}=this.j.o.aiAssistantPro,{displayMode:s="right",panelWidth:i,panelHeight:n}=this.stateManager.state;switch(this.__applyTheme(),this.mainPanel.setMod("displayMode",s),this.mainPanel.setMod("allowClose",e),this.mainPanel.setParentView(s==="dialog"||s==="flight"?this.dialog:this.j),this.__openedMode=s,s){case"dialog":{this.dialog.setSize(i,n).open().setContent(this.mainPanel.container);break}case"flight":{D.install(this.mainPanel,this.j.container,{panelHeight:a,containerClassName:this.getFullElName("flight-container")});break}default:{t&&(S.remove(this.mainPanel),S.install(this.mainPanel,X(s),{handleClassName:this.getFullElName("ai-assistent-resize-handle"),onResize:_(({newSize:o})=>{const r=s==="left"||s==="right"?o:i,c=s==="top"||s==="bottom"?o:n;return this.stateManager.state.panelWidth=r,this.stateManager.state.panelHeight=c,!0},"onResize")})),this.j.currentPlace.slots[s].appendChild(this.mainPanel.container),T(this.j,s,i,n);break}}}__onResizeInPanelView(){const{displayMode:t,panelWidth:e,panelHeight:a}=this.stateManager.state;T(this.j,t,e,a)}async __closeInContainer(){const{displayMode:t}=await this.stateManager.state;switch(this.__openedMode!==t&&this.__openedMode==="dialog"&&this.dialog.close(),this.__openedMode!==t&&this.__openedMode==="flight"&&this.__closeFlightMode(),t){case"dialog":{this.dialog.close();break}case"flight":{this.__closeFlightMode();break}default:{this.mainPanel.container.remove();break}}}__closeFlightMode(){D.remove(this.mainPanel)}__onSavedStateChange(){var t;const e=this.stateManager.state;return this.storage.saveGlobalSettings({displayMode:e.displayMode,panelWidth:e.panelWidth,panelHeight:e.panelHeight,theme:e.theme,defaultModel:e.defaultModel,defaultTemperature:e.defaultTemperature,currentConversationId:(t=e.currentConversation)===null||t===void 0?void 0:t.id,...this.j.o.aiAssistantPro.persistOpenState?{isOpen:e.isOpen}:{}})}async closeAssistant(){this.stateManager.isOpen()&&(await this.__loadData(),this.stateManager.close(),this.__closeInContainer())}async addCurrentSelectionToContext(){await this.__loadData();const t=A(this.j);t&&this.stateManager.addSelectionContext(t)}async executeQuickCommand(t){const{quickCommandsSilentMode:e,quickCommandsDisplayMode:a}=this.j.o.aiAssistantPro,s=this.j.o.aiAssistant;let i;if(s&&s[t]&<(s[t])&&(i=s[t]),!i){this.j.e.fire("error",`Command not found: ${t}`);return}const n=this.j.s.isCollapsed()?this.j.value:this.j.s.html;if(!n)return;const o=s?.aiCommonPrefixPrompt||"",r=s?.aiCommonSuffixPrompt||"",c=`${o}${i}${r}
|
|
2
2
|
|
|
3
|
-
${n}`.trim();e?await this.__executeQuickCommandSilent(
|
|
3
|
+
${n}`.trim();e?await this.__executeQuickCommandSilent(c,n):await this.__executeQuickCommandWithPanel(c,a)}async __executeQuickCommandSilent(t,e){await this.__loadData(),this.j.progressbar.show().progress(100);try{const a=j(t),s=y(this.j,this.state.defaultModel,this.state.defaultTemperature,[a]),i=await this.apiClient.sendRequest(s.id,s.messages,null,[],s.options);if(i.mode==="final"){const n=i.response.content;n&&this.j.s.insertHTML(n)}}catch(a){w(a)||this.j.e.fire("error",a)}finally{this.j.progressbar.hide()}}async __executeQuickCommandWithPanel(t,e){await this.__loadData();const a=this.stateManager.state.displayMode;this.stateManager.state.displayMode=e;const s=A(this.j);s&&this.stateManager.addSelectionContext(s),this.stateManager.isOpen()||await this.openAssistant(),await this.sendMessage(t),this.stateManager.state.displayMode=a}async sendMessage(t){await this.__loadData();let e=this.stateManager.getCurrentConversation();const a=this.stateManager.getEditingMessageId();if(a&&e){const i=e.messages.findIndex(n=>n.id===a);if(i!==-1){const n=e.messages.slice(0,i),o={...e,messages:n,updatedAt:Date.now()};this.stateManager.setCurrentConversation(o),await this.storage.save(o),this.stateManager.clearEditingMessage(),e=o}}e||(e=y(this.j,this.state.defaultModel,this.state.defaultTemperature),this.stateManager.setCurrentConversation(e));let s=null;t.trim()&&(s=j(t),e.title||(e={...e,title:t}),e={...e,updated:Date.now(),messages:[...e.messages,s]}),this.stateManager.setCurrentConversation({...e}),s&&this.j.e.fire("messageSent.ai-assistant-pro",s),this.stateManager.setLoading(!0),this.stateManager.clearError();try{await this.sendRequestToAI(0),this.stateManager.clearSelectionContexts()}catch(i){if(w(i))return;this.stateManager.setError(i instanceof Error?i.message:String(i))}finally{this.stateManager.setLoading(!1)}}async sendRequestToAI(t=0){const e=this.j.o.aiAssistantPro.maxRecursionToolCallDepth;if(t>=e)throw Error(`Max recursion depth ${e} reached for tool calls`);let a=this.stateManager.getCurrentConversation();if(!a)return;const s=V(a),[i]=await Promise.all([this.apiClient.sendRequest(a.id,a.messages,s,this.stateManager.getSelectionContexts(),a.options),this.storage.save(a)]);let n,o;if(i.mode==="stream"){const r=await et(this.stateManager,i,a);n=r.aiMessage,o=r.index,a=r.conversation}else{const r=tt(i,a);n=r.aiMessage,o=r.index,a=r.conversation}a=await K(this.j,n,a,o),this.j.e.fire("messageReceived.ai-assistant-pro",n),this.stateManager.setCurrentConversation({...a}),await this.storage.save(a),await this.handleToolCalls(n.id,t)}async deleteConversation(t){await this.__loadData(),await q(this.j,t,this.storage,this.stateManager,this.permissionManager)}async renameConversation(t,e){var a;const s=await this.storage.get(t);if(!s)return;const i={...s,title:e,updated:Date.now()};await this.storage.save(i),((a=this.state.currentConversation)===null||a===void 0?void 0:a.id)===t&&this.stateManager.setCurrentConversation(i);const n=await this.storage.list();this.stateManager.setConversations(n)}async searchConversations(t){await this.__loadData(),await U(t,this.storage,this.stateManager)}async handleToolCalls(t,e=0){const a=this.stateManager.getCurrentConversation();if(!a)return;const s=a.messages.find(c=>c.id===t);if(!s)return;const i=s.toolCalls;if(!i||i.length===0)return;const n=i.filter(c=>!Y(c.status));if(n.length===0)return;const{approved:o,needsPermission:r}=this.permissionManager.filterToolCalls(n,a.permissions);this.stateManager.setPendingToolCalls(r);for(const c of o)await this.executeToolCall(t,c,e)}async executeToolCall(t,e,a=0){let s=this.stateManager.getCurrentConversation();if(!s)return;const i=await Q(this.j,e,this.toolRegistry),n=s.messages.findIndex(c=>c.id===t);if(n===-1)return;const o=s.messages[n],r=s.messages.slice();r[n]=st(o,i),s={...s,messages:r,updated:Date.now()},this.stateManager.setCurrentConversation(s),H(s)&&await this.sendRequestToAI(a+1)}async copyMessage(t){const e=this.stateManager.getCurrentConversation();if(!e)return;const a=e.messages.find(s=>s.id===t);if(a)try{await navigator.clipboard.writeText(a.content),this.j.message.success("Message copied to clipboard")}catch{this.j.e.fire("error",new Error("Failed to copy message"))}}async restartFromMessage(t){const e=this.stateManager.getCurrentConversation();if(!e)return;const a=e.messages.findIndex(o=>o.id===t);if(a===-1)return;const s=e.messages[a];if(s.role!=="user")return;await this.__loadData();const i=e.messages.slice(0,a),n={...e,messages:i,updatedAt:Date.now()};this.stateManager.setCurrentConversation(n),await this.storage.save(n),await this.sendMessage(s.content)}async editMessage(t){const e=this.stateManager.getCurrentConversation();if(!e)return;const a=e.messages.find(s=>s.id===t);!a||a.role!=="user"||(this.stateManager.setEditingMessageId(t),this.mainPanel.inputArea.setValue(a.content),this.mainPanel.inputArea.focus())}cancelEditMessage(){this.stateManager.isEditingMessage()&&(this.stateManager.clearEditingMessage(),this.mainPanel.inputArea.setValue(""))}async deleteMessage(t){await this.__loadData();const e=this.stateManager.getCurrentConversation();if(!e||e.messages.findIndex(n=>n.id===t)===-1)return;const s=e.messages.filter(n=>n.id!==t),i={...e,messages:s,updatedAt:Date.now()};this.stateManager.setCurrentConversation(i),await this.storage.save(i)}beforeDestruct(){var t,e,a,s,i,n,o,r;this.textAutocompleteSource&&(this.j.e.fire("unregisterAutocompleteSource",this.textAutocompleteSource),this.textAutocompleteSource=null),this.textAutocompleteCache.clear(),this.__closeFlightMode(),(t=p(this,"toolRegistry"))===null||t===void 0||t.destruct(),(e=p(this,"permissionManager"))===null||e===void 0||e.destruct(),(a=p(this,"apiClient"))===null||a===void 0||a.destruct(),(s=p(this,"stateManager"))===null||s===void 0||s.destruct(),(i=p(this,"mainPanel"))===null||i===void 0||i.destruct(),(n=p(this,"dialog"))===null||n===void 0||n.destruct(),(r=(o=p(this,"storage"))===null||o===void 0?void 0:o.close)===null||r===void 0||r.call(o)}},_(f,"aiAssistantPro"),f);l.requires=["license","autocomplete"],h([u],l.prototype,"toolRegistry",null),h([u],l.prototype,"permissionManager",null),h([u],l.prototype,"apiClient",null),h([u],l.prototype,"storage",null),h([u],l.prototype,"stateManager",null),h([u],l.prototype,"mainPanel",null),h([u],l.prototype,"dialog",null),h([d("state.theme")],l.prototype,"__applyTheme",null),h([d(":openAIAssistantPro.ai-assistant-pro")],l.prototype,"openAssistant",null),h([d([":resize","state.panelWidth","state.panelHeight"])],l.prototype,"__onResizeInPanelView",null),h([d(["state.isOpen","state.displayMode","state.panelWidth","state.panelHeight","state.theme","state.defaultModel","state.defaultTemperature","state.currentConversation"]),ot()],l.prototype,"__onSavedStateChange",null),h([d(":closeAIAssistantPro.ai-assistant-pro")],l.prototype,"closeAssistant",null),h([d(":addContextToAIAssistant.ai-assistant-pro")],l.prototype,"addCurrentSelectionToContext",null),h([d(":executeQuickCommand.ai-assistant-pro")],l.prototype,"executeQuickCommand",null),h([d(":sendMessage.ai-assistant-pro")],l.prototype,"sendMessage",null),h([d(":searchConversations.ai-assistant-pro")],l.prototype,"searchConversations",null),h([d(":copyMessage.ai-assistant-pro")],l.prototype,"copyMessage",null),h([d(":restartFromMessage.ai-assistant-pro")],l.prototype,"restartFromMessage",null),h([d(":editMessage.ai-assistant-pro")],l.prototype,"editMessage",null),h([d(":cancelEditMessage.ai-assistant-pro")],l.prototype,"cancelEditMessage",null),h([d(":deleteMessage.ai-assistant-pro")],l.prototype,"deleteMessage",null),l=h([nt],l);ct.plugins.add("aiAssistantPro",l);export{l as aiAssistantPro};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=Object.defineProperty;var r=(e,t)=>d(e,"name",{value:t,configurable:!0});var n;import{base64ToFile as p}from"../ai-assistant-pro/helpers/base64tofile.js";import m from"./icons/add-context.svg.js";import c from"./icons/ai-assistant.svg.js";import f from"./icons/ai-commands.svg.js";import g from"./icons/chevron-right.svg.js";import h from"./icons/send.svg.js";import A from"./icons/shield.svg.js";import x from"./icons/tool-bolt.svg.js";import{getAIProviderOptions as C,registerAIProvider as y}from"./providers/index.js";import{getToolNames as w}from"./tools/index.js";import{Config as s}from"jodit/esm/config.js";import{Icon as I}from"jodit/esm/core/ui/icon.js";import{aiAssitentCommands as T}from"jodit/esm/plugins/ai-assistant/config.js";import{marked as b}from"marked";I.set("ai-assistant-pro",c).set("ai-commands-pro",f).set("ai-add-context",m).set("send",h).set("tool-bolt",x).set("chevron-right",g).set("shield",A),s.prototype.aiAssistantPro={displayMode:"right",panelWidth:400,panelHeight:500,flightPanelHeight:250,dialogFullSize:!1,resizable:!0,apiMode:"incremental",apiRequest:null,maxRetries:3,requestTimeout:6e4*5,retryDelay:1e3,maxRecursionToolCallDepth:1e3,enabledTools:w(),customTools:[],toolPermissions:{},autoApproveTools:["readDocument","readBlocks","readSelection","insertHTML"],alwaysDenyTools:[],defaultPermissionScope:"conversation",storage:"indexedDB",maxConversations:50,storageKey:"jodit-ai-assistant-pro",showConversationList:!0,enableMarkdown:!0,enableCodeHighlight:!0,maxMessageHeight:400,placeholderText:"Ask AI assistant...",sendShortcut:"Ctrl+Enter",showTimestamps:!0,formatTimestamp:r((e,t)=>{const o=new Date(e),i=new Date().getTime()-o.getTime();return i<6e4?t("Just now"):i<36e5?t("%dm ago",Math.floor(i/6e4)):i<864e5?t("%dh ago",Math.floor(i/36e5)):o.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},"formatTimestamp"),formatMessageContent:r((e,t)=>b.parse(e,{breaks:!0,gfm:!0}),"formatMessageContent"),showAvatars:!0,showTypingIndicator:!0,includeSelectionByDefault:!0,maxContextRanges:5,showContextPreview:!0,sendOnEnter:!0,instructions:void 0,includeEditorMetadata:!1,autoOpen:!0,rememberLastConversation:!0,autoFocusInput:!0,closeAfterInsert:!1,enableSoundNotifications:!1,debug:!1,textAutocompleteEnabled:!1,textAutocompleteApiRequest:null,textAutocompleteMinQueryLength:3,textAutocompleteMaxSuggestions:3,textAutocompleteDebounceMs:500,textAutocompleteCacheTTL:3e4,textAutocompleteCacheMaxSize:50,quickCommandsSilentMode:!1,quickCommandsDisplayMode:"flight",showCopyMessageAction:!0,showRestartMessageAction:!0,showEditMessageAction:!0,showDeleteMessageAction:!0,dialogSettings:{},allowEditDialogSettings:!1,allowEditDisplayMode:!0,allowEditPanelWidth:!0,initiallyOpened:!1,allowClose:!0,persistOpenState:!0,theme:"parent",allowEditTheme:!0,async uploadBase64Artifact(e,t){if(e.type==="image"&&e.data&&e.data.kind==="base64")try{const o=p(e.data.base64,e.id,e.mimeType),a=await t.uploader.upload([o]);return{...e,data:{kind:"url",url:a.baseurl+a.files[0]},metadata:{...e.metadata,filename:a.files[0]}}}catch(o){t.e.fire("error",o)}return e},getAIProviderOptions(e,t){return C(e,t)},registerAIProvider(e,t){y(e,t)}},s.prototype.controls.aiAssistantPro={icon:"ai-assistant-pro",tooltip:"AI Assistant",hotkeys:["ctrl+shift+a","cmd+shift+a"],exec(e){e.e.fire("openAIAssistantPro.ai-assistant-pro")},isDisabled(e){return!e.o.aiAssistantPro.apiRequest},getLabel(e){return e.o.aiAssistantPro.apiRequest?"AI Assistant":"AI Assistant (not configured)"}},s.prototype.controls.aiAddContext={icon:"ai-add-context",tooltip:"Add to AI Context",exec(e){e.e.fire("addContextToAIAssistant")},isDisabled(e){return e.o.aiAssistantPro.apiRequest?e.s.isCollapsed():!0}},s.prototype.controls.aiCommandsPro={icon:"ai-commands-pro",tooltip:"AI Commands",isDisabled(e){return!e.o.aiAssistantPro.apiRequest},list:T,exec(e,t,{control:o}){e.e.fire("executeQuickCommand.ai-assistant-pro",o.name)}};const l=((n=s.prototype.tuneBlock)===null||n===void 0?void 0:n.popup)||{},u={},M=["p","h1","h2","h3","h4","h5","h6","div","section","article","pre","blockquote","ul","ol","li","table","tr","td","th","img","figure"];M.forEach(e=>{const t=l[e]||["tune.up","tune.remove","tune.down"];u[e]=[...t,"|","aiAddContext"]}),s.prototype.tuneBlock&&(s.prototype.tuneBlock.popup={...l,...u});
|