jodit-pro 4.12.32 → 4.12.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +8 -8
- package/es2015/jodit.js +38 -2
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +596 -44
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +33 -33
- package/es2015/plugins/autocomplete/autocomplete.css +1 -1
- 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 +1 -1
- package/es2015/plugins/style/style.min.js +1 -1
- 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.js +2 -2
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +38 -38
- 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 +1 -1
- 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 +1 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +8 -8
- package/es2021/jodit.js +38 -2
- package/es2021/jodit.min.js +3 -3
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +569 -42
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +9 -9
- package/es2021/plugins/autocomplete/autocomplete.css +1 -1
- 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 +1 -1
- package/es2021/plugins/style/style.min.js +1 -1
- 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 +1 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +25 -25
- package/es2021.en/jodit.js +38 -2
- package/es2021.en/jodit.min.js +3 -3
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +569 -42
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +9 -9
- package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
- 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 +1 -1
- package/es2021.en/plugins/style/style.min.js +1 -1
- 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 +2 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +38 -2
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +734 -44
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +2 -2
- package/es5/plugins/autocomplete/autocomplete.css +1 -1
- 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 +1 -1
- package/es5/plugins/style/style.min.js +1 -1
- 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/plugins/ai-assistant-pro/config.js +1 -1
- package/esm/plugins/ai-assistant-pro/icons/microphone.svg.js +1 -0
- package/esm/plugins/ai-assistant-pro/interface/options.d.ts +35 -0
- package/esm/plugins/ai-assistant-pro/providers/jodit-ai-adapter.js +1 -1
- package/esm/plugins/ai-assistant-pro/ui/input-area/input-area.d.ts +20 -0
- package/esm/plugins/ai-assistant-pro/ui/input-area/input-area.js +2 -2
- package/esm/plugins/ai-assistant-pro/voice/microphone-streamer.d.ts +26 -0
- package/esm/plugins/ai-assistant-pro/voice/microphone-streamer.js +1 -0
- package/esm/plugins/ai-assistant-pro/voice/voice-engine.d.ts +36 -0
- package/esm/plugins/ai-assistant-pro/voice/voice-engine.js +0 -0
- package/esm/plugins/ai-assistant-pro/voice/voice-input-button.d.ts +85 -0
- package/esm/plugins/ai-assistant-pro/voice/voice-input-button.js +1 -0
- package/esm/plugins/ai-assistant-pro/voice/voice-transcriber.d.ts +55 -0
- package/esm/plugins/ai-assistant-pro/voice/voice-transcriber.js +1 -0
- package/package.json +1 -1
- package/types/plugins/ai-assistant-pro/interface/options.d.ts +35 -0
- package/types/plugins/ai-assistant-pro/ui/input-area/input-area.d.ts +20 -0
- package/types/plugins/ai-assistant-pro/voice/microphone-streamer.d.ts +26 -0
- package/types/plugins/ai-assistant-pro/voice/voice-engine.d.ts +36 -0
- package/types/plugins/ai-assistant-pro/voice/voice-input-button.d.ts +85 -0
- package/types/plugins/ai-assistant-pro/voice/voice-transcriber.d.ts +55 -0
|
@@ -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.12.
|
|
4
|
+
* Version: v4.12.34
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
@@ -46,6 +46,13 @@ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
|
|
|
46
46
|
|
|
47
47
|
/***/ }),
|
|
48
48
|
|
|
49
|
+
/***/ 99293:
|
|
50
|
+
/***/ (function(module) {
|
|
51
|
+
|
|
52
|
+
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <rect x=\"9\" y=\"2\" width=\"6\" height=\"12\" rx=\"3\"></rect> <path d=\"M5 10v1a7 7 0 0 0 14 0v-1\" fill=\"none\"></path> <line x1=\"12\" y1=\"18\" x2=\"12\" y2=\"22\"></line> <line x1=\"8\" y1=\"22\" x2=\"16\" y2=\"22\"></line> </svg>"
|
|
53
|
+
|
|
54
|
+
/***/ }),
|
|
55
|
+
|
|
49
56
|
/***/ 99219:
|
|
50
57
|
/***/ (function(module) {
|
|
51
58
|
|
|
@@ -1193,18 +1200,20 @@ jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_19__.JoditPro.plugins.add('aiAssist
|
|
|
1193
1200
|
/* harmony import */ var _icons_ai_commands_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_ai_commands_svg__WEBPACK_IMPORTED_MODULE_6__);
|
|
1194
1201
|
/* harmony import */ var _icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(83207);
|
|
1195
1202
|
/* harmony import */ var _icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_7__);
|
|
1196
|
-
/* harmony import */ var
|
|
1197
|
-
/* harmony import */ var
|
|
1198
|
-
/* harmony import */ var
|
|
1199
|
-
/* harmony import */ var
|
|
1200
|
-
/* harmony import */ var
|
|
1201
|
-
/* harmony import */ var
|
|
1202
|
-
/* harmony import */ var
|
|
1203
|
-
/* harmony import */ var
|
|
1204
|
-
/* harmony import */ var
|
|
1205
|
-
/* harmony import */ var
|
|
1206
|
-
/* harmony import */ var
|
|
1207
|
-
/* harmony import */ var
|
|
1203
|
+
/* harmony import */ var _icons_microphone_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99293);
|
|
1204
|
+
/* harmony import */ var _icons_microphone_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_microphone_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
1205
|
+
/* harmony import */ var _icons_send_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99219);
|
|
1206
|
+
/* harmony import */ var _icons_send_svg__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_icons_send_svg__WEBPACK_IMPORTED_MODULE_9__);
|
|
1207
|
+
/* harmony import */ var _icons_shield_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(63674);
|
|
1208
|
+
/* harmony import */ var _icons_shield_svg__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_icons_shield_svg__WEBPACK_IMPORTED_MODULE_10__);
|
|
1209
|
+
/* harmony import */ var _icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4133);
|
|
1210
|
+
/* harmony import */ var _icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_11__);
|
|
1211
|
+
/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(94454);
|
|
1212
|
+
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(53835);
|
|
1213
|
+
/* harmony import */ var jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(6441);
|
|
1214
|
+
/* harmony import */ var jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(12153);
|
|
1215
|
+
/* harmony import */ var jodit_esm_plugins_ai_assistant_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(31974);
|
|
1216
|
+
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(72573);
|
|
1208
1217
|
/*!
|
|
1209
1218
|
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
1210
1219
|
* See LICENSE.md in the project root for license information.
|
|
@@ -1227,10 +1236,11 @@ var _Config_prototype_tuneBlock;
|
|
|
1227
1236
|
|
|
1228
1237
|
|
|
1229
1238
|
|
|
1239
|
+
|
|
1230
1240
|
// Register icons
|
|
1231
|
-
|
|
1241
|
+
jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_15__.Icon.set('ai-assistant-pro', (_icons_ai_assistant_svg__WEBPACK_IMPORTED_MODULE_5___default())).set('ai-commands-pro', (_icons_ai_commands_svg__WEBPACK_IMPORTED_MODULE_6___default())).set('ai-add-context', (_icons_add_context_svg__WEBPACK_IMPORTED_MODULE_4___default())).set('send', (_icons_send_svg__WEBPACK_IMPORTED_MODULE_9___default())).set('microphone', (_icons_microphone_svg__WEBPACK_IMPORTED_MODULE_8___default())).set('tool-bolt', (_icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_11___default())).set('chevron-right', (_icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_7___default())).set('shield', (_icons_shield_svg__WEBPACK_IMPORTED_MODULE_10___default()));
|
|
1232
1242
|
// Default configuration
|
|
1233
|
-
|
|
1243
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.aiAssistantPro = {
|
|
1234
1244
|
// ===== Display Settings =====
|
|
1235
1245
|
displayMode: 'right',
|
|
1236
1246
|
panelWidth: 400,
|
|
@@ -1246,7 +1256,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1246
1256
|
retryDelay: 1000,
|
|
1247
1257
|
maxRecursionToolCallDepth: 1000,
|
|
1248
1258
|
// ===== Tools Configuration =====
|
|
1249
|
-
enabledTools: (0,
|
|
1259
|
+
enabledTools: (0,_tools__WEBPACK_IMPORTED_MODULE_13__.getToolNames)(),
|
|
1250
1260
|
customTools: [],
|
|
1251
1261
|
toolPermissions: {},
|
|
1252
1262
|
// ===== Permission Settings =====
|
|
@@ -1286,7 +1296,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1286
1296
|
},
|
|
1287
1297
|
formatMessageContent: (content, role)=>{
|
|
1288
1298
|
// For user and assistant messages, use markdown
|
|
1289
|
-
return
|
|
1299
|
+
return marked__WEBPACK_IMPORTED_MODULE_17__.marked.parse(content, {
|
|
1290
1300
|
breaks: true,
|
|
1291
1301
|
gfm: true
|
|
1292
1302
|
});
|
|
@@ -1305,6 +1315,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1305
1315
|
autoOpen: true,
|
|
1306
1316
|
rememberLastConversation: true,
|
|
1307
1317
|
autoFocusInput: true,
|
|
1318
|
+
voiceInputEnabled: false,
|
|
1308
1319
|
closeAfterInsert: false,
|
|
1309
1320
|
enableSoundNotifications: false,
|
|
1310
1321
|
debug: false,
|
|
@@ -1361,15 +1372,15 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1361
1372
|
})();
|
|
1362
1373
|
},
|
|
1363
1374
|
getAIProviderOptions (name, config) {
|
|
1364
|
-
return (0,
|
|
1375
|
+
return (0,_providers__WEBPACK_IMPORTED_MODULE_12__.getAIProviderOptions)(name, config);
|
|
1365
1376
|
},
|
|
1366
1377
|
registerAIProvider (name, factory) {
|
|
1367
|
-
(0,
|
|
1378
|
+
(0,_providers__WEBPACK_IMPORTED_MODULE_12__.registerAIProvider)(name, factory);
|
|
1368
1379
|
}
|
|
1369
1380
|
};
|
|
1370
1381
|
/**
|
|
1371
1382
|
* Main AI Assistant Pro control for toolbar
|
|
1372
|
-
*/
|
|
1383
|
+
*/ jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.aiAssistantPro = {
|
|
1373
1384
|
icon: 'ai-assistant-pro',
|
|
1374
1385
|
tooltip: 'AI Assistant',
|
|
1375
1386
|
/**
|
|
@@ -1404,7 +1415,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1404
1415
|
};
|
|
1405
1416
|
/**
|
|
1406
1417
|
* Add Context control for context menu (adds selection to AI context)
|
|
1407
|
-
*/
|
|
1418
|
+
*/ jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.aiAddContext = {
|
|
1408
1419
|
icon: 'ai-add-context',
|
|
1409
1420
|
tooltip: 'Add to AI Context',
|
|
1410
1421
|
/**
|
|
@@ -1426,7 +1437,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1426
1437
|
};
|
|
1427
1438
|
/**
|
|
1428
1439
|
* AI Commands control - quick AI commands dropdown
|
|
1429
|
-
*/
|
|
1440
|
+
*/ jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.aiCommandsPro = {
|
|
1430
1441
|
icon: 'ai-commands-pro',
|
|
1431
1442
|
tooltip: 'AI Commands',
|
|
1432
1443
|
/**
|
|
@@ -1436,7 +1447,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1436
1447
|
},
|
|
1437
1448
|
/**
|
|
1438
1449
|
* Default list of commands (can be overridden via quickCommands config)
|
|
1439
|
-
*/ list:
|
|
1450
|
+
*/ list: jodit_esm_plugins_ai_assistant_config__WEBPACK_IMPORTED_MODULE_16__.aiAssitentCommands,
|
|
1440
1451
|
/**
|
|
1441
1452
|
* Execute handler - fires event with command name
|
|
1442
1453
|
*/ exec (editor, event, { control }) {
|
|
@@ -1445,7 +1456,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_13__.Config.prototype.aiAssistantPro =
|
|
|
1445
1456
|
};
|
|
1446
1457
|
/**
|
|
1447
1458
|
* Extend tune-block popup to include "Add to AI Context" option
|
|
1448
|
-
*/ const originalTuneBlockPopup = ((_Config_prototype_tuneBlock =
|
|
1459
|
+
*/ const originalTuneBlockPopup = ((_Config_prototype_tuneBlock = jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.tuneBlock) === null || _Config_prototype_tuneBlock === void 0 ? void 0 : _Config_prototype_tuneBlock.popup) || {};
|
|
1449
1460
|
// Add AI context option to all block types
|
|
1450
1461
|
const tuneBlockExtension = {};
|
|
1451
1462
|
// Common block types
|
|
@@ -1486,8 +1497,8 @@ blockTypes.forEach((tag)=>{
|
|
|
1486
1497
|
];
|
|
1487
1498
|
});
|
|
1488
1499
|
// Merge with existing tune-block configuration
|
|
1489
|
-
if (
|
|
1490
|
-
|
|
1500
|
+
if (jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.tuneBlock) {
|
|
1501
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.tuneBlock.popup = (0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, originalTuneBlockPopup, tuneBlockExtension);
|
|
1491
1502
|
}
|
|
1492
1503
|
|
|
1493
1504
|
|
|
@@ -3919,9 +3930,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3919
3930
|
const url = config.url.replace(/\/+$/, '');
|
|
3920
3931
|
const provider = (_config_provider = config.provider) !== null && _config_provider !== void 0 ? _config_provider : 'openai';
|
|
3921
3932
|
const stream = config.stream !== false;
|
|
3933
|
+
// Voice dictation goes over a WebSocket to the transcription proxy; derive its
|
|
3934
|
+
// wss URL from the same host (http→ws, https→wss).
|
|
3935
|
+
const transcribeUrl = `${url.replace(/^http/, 'ws')}/v1/ai/transcribe`;
|
|
3922
3936
|
return {
|
|
3923
3937
|
apiMode: 'incremental',
|
|
3924
3938
|
maxRetries: 0,
|
|
3939
|
+
// Enable voice dictation; the transcription model is chosen server-side
|
|
3940
|
+
// (like the text model). Override per-editor with the `voiceInput*` options.
|
|
3941
|
+
voiceInputEnabled: true,
|
|
3942
|
+
voiceInputUrl: transcribeUrl,
|
|
3943
|
+
voiceInputApiKey: config.apiKey,
|
|
3925
3944
|
textAutocompleteEnabled: true,
|
|
3926
3945
|
textAutocompleteApiRequest: (query, maxSuggestions, signal)=>(0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_1__._)(function*() {
|
|
3927
3946
|
var _data_result;
|
|
@@ -5773,11 +5792,12 @@ UIConversationList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
5773
5792
|
/* harmony export */ });
|
|
5774
5793
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
5775
5794
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
5776
|
-
/* harmony import */ var
|
|
5777
|
-
/* harmony import */ var
|
|
5778
|
-
/* harmony import */ var
|
|
5779
|
-
/* harmony import */ var
|
|
5780
|
-
/* harmony import */ var
|
|
5795
|
+
/* harmony import */ var _voice_voice_input_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66330);
|
|
5796
|
+
/* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65478);
|
|
5797
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38837);
|
|
5798
|
+
/* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67510);
|
|
5799
|
+
/* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62843);
|
|
5800
|
+
/* harmony import */ var jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85120);
|
|
5781
5801
|
/*!
|
|
5782
5802
|
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
5783
5803
|
* See LICENSE.md in the project root for license information.
|
|
@@ -5789,15 +5809,17 @@ UIConversationList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
5789
5809
|
|
|
5790
5810
|
|
|
5791
5811
|
|
|
5792
|
-
|
|
5812
|
+
|
|
5813
|
+
class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_5__.UIElement {
|
|
5793
5814
|
className() {
|
|
5794
5815
|
return 'UIInputArea';
|
|
5795
5816
|
}
|
|
5796
5817
|
setParentView(view) {
|
|
5797
|
-
var _this_textarea, _this_sendButton, _this_stopButton;
|
|
5818
|
+
var _this_textarea, _this_sendButton, _this_stopButton, _this_voiceButton;
|
|
5798
5819
|
(_this_textarea = this.textarea) === null || _this_textarea === void 0 ? void 0 : _this_textarea.setParentView(view);
|
|
5799
5820
|
(_this_sendButton = this.sendButton) === null || _this_sendButton === void 0 ? void 0 : _this_sendButton.setParentView(view);
|
|
5800
5821
|
(_this_stopButton = this.stopButton) === null || _this_stopButton === void 0 ? void 0 : _this_stopButton.setParentView(view);
|
|
5822
|
+
(_this_voiceButton = this.voiceButton) === null || _this_voiceButton === void 0 ? void 0 : _this_voiceButton.setParentView(view);
|
|
5801
5823
|
return super.setParentView(view);
|
|
5802
5824
|
}
|
|
5803
5825
|
render() {
|
|
@@ -5824,19 +5846,31 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5824
5846
|
this.contextBadges = this.getElm('context-badges');
|
|
5825
5847
|
this.createControls();
|
|
5826
5848
|
this.attachHandlers();
|
|
5849
|
+
this.autosize();
|
|
5850
|
+
}
|
|
5851
|
+
/** Grow the textarea to fit its content up to a max height, then scroll. */ autosize() {
|
|
5852
|
+
var _this_textarea;
|
|
5853
|
+
const input = (_this_textarea = this.textarea) === null || _this_textarea === void 0 ? void 0 : _this_textarea.nativeInput;
|
|
5854
|
+
if (!input) {
|
|
5855
|
+
return;
|
|
5856
|
+
}
|
|
5857
|
+
const maxHeight = 160;
|
|
5858
|
+
input.style.height = 'auto';
|
|
5859
|
+
input.style.height = `${Math.min(input.scrollHeight, maxHeight)}px`;
|
|
5860
|
+
input.style.overflowY = input.scrollHeight > maxHeight ? 'auto' : 'hidden';
|
|
5827
5861
|
}
|
|
5828
5862
|
createControls() {
|
|
5829
5863
|
const textareaWrapper = this.getElm('textarea-wrapper');
|
|
5830
5864
|
const buttonsWrapper = this.getElm('buttons');
|
|
5831
5865
|
// Textarea
|
|
5832
|
-
this.textarea = new
|
|
5866
|
+
this.textarea = new jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_7__.UITextArea(this.j, {
|
|
5833
5867
|
name: 'message',
|
|
5834
5868
|
placeholder: this.options.placeholderText,
|
|
5835
5869
|
resizable: false
|
|
5836
5870
|
});
|
|
5837
5871
|
textareaWrapper.appendChild(this.textarea.container);
|
|
5838
5872
|
// Send button
|
|
5839
|
-
this.sendButton = new
|
|
5873
|
+
this.sendButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.UIButton(this.j, {
|
|
5840
5874
|
name: 'send-message',
|
|
5841
5875
|
icon: {
|
|
5842
5876
|
name: 'send'
|
|
@@ -5845,7 +5879,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5845
5879
|
size: 'middle'
|
|
5846
5880
|
});
|
|
5847
5881
|
// Stop button
|
|
5848
|
-
this.stopButton = new
|
|
5882
|
+
this.stopButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.UIButton(this.j, {
|
|
5849
5883
|
name: 'abort-message',
|
|
5850
5884
|
icon: {
|
|
5851
5885
|
name: 'cancel'
|
|
@@ -5854,12 +5888,63 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5854
5888
|
size: 'middle'
|
|
5855
5889
|
});
|
|
5856
5890
|
this.stopButton.container.style.display = 'none';
|
|
5891
|
+
// Microphone (voice dictation) button — only when configured.
|
|
5892
|
+
if (this.options.voiceInputEnabled) {
|
|
5893
|
+
this.voiceButton = new _voice_voice_input_button__WEBPACK_IMPORTED_MODULE_2__.VoiceInputButton(this.j, {
|
|
5894
|
+
url: this.options.voiceInputUrl,
|
|
5895
|
+
apiKey: this.options.voiceInputApiKey,
|
|
5896
|
+
defaultModel: this.options.voiceInputDefaultModel,
|
|
5897
|
+
language: this.options.voiceInputLanguage,
|
|
5898
|
+
silenceTimeoutMs: this.options.voiceInputSilenceTimeoutMs,
|
|
5899
|
+
autoSendSilenceMs: this.options.voiceInputAutoSendSilenceMs,
|
|
5900
|
+
api: this.options.voiceInputApi
|
|
5901
|
+
}, {
|
|
5902
|
+
getValue: ()=>{
|
|
5903
|
+
var _ref;
|
|
5904
|
+
var _this_textarea;
|
|
5905
|
+
return (_ref = (_this_textarea = this.textarea) === null || _this_textarea === void 0 ? void 0 : _this_textarea.nativeInput.value) !== null && _ref !== void 0 ? _ref : '';
|
|
5906
|
+
},
|
|
5907
|
+
setValue: (value, caret)=>{
|
|
5908
|
+
if (!this.textarea) {
|
|
5909
|
+
return;
|
|
5910
|
+
}
|
|
5911
|
+
this.textarea.value = value;
|
|
5912
|
+
if (caret !== undefined) {
|
|
5913
|
+
const input = this.textarea.nativeInput;
|
|
5914
|
+
input.selectionStart = caret;
|
|
5915
|
+
input.selectionEnd = caret;
|
|
5916
|
+
}
|
|
5917
|
+
this.autosize();
|
|
5918
|
+
},
|
|
5919
|
+
getSelection: ()=>{
|
|
5920
|
+
var _input_selectionStart, _input_selectionEnd;
|
|
5921
|
+
var _this_textarea;
|
|
5922
|
+
const input = (_this_textarea = this.textarea) === null || _this_textarea === void 0 ? void 0 : _this_textarea.nativeInput;
|
|
5923
|
+
if (!input) {
|
|
5924
|
+
return {
|
|
5925
|
+
start: 0,
|
|
5926
|
+
end: 0
|
|
5927
|
+
};
|
|
5928
|
+
}
|
|
5929
|
+
const len = input.value.length;
|
|
5930
|
+
return {
|
|
5931
|
+
start: (_input_selectionStart = input.selectionStart) !== null && _input_selectionStart !== void 0 ? _input_selectionStart : len,
|
|
5932
|
+
end: (_input_selectionEnd = input.selectionEnd) !== null && _input_selectionEnd !== void 0 ? _input_selectionEnd : len
|
|
5933
|
+
};
|
|
5934
|
+
},
|
|
5935
|
+
focus: ()=>this.focus(),
|
|
5936
|
+
send: ()=>this.onSend()
|
|
5937
|
+
});
|
|
5938
|
+
buttonsWrapper.appendChild(this.voiceButton.container);
|
|
5939
|
+
}
|
|
5857
5940
|
buttonsWrapper.appendChild(this.sendButton.container);
|
|
5858
5941
|
buttonsWrapper.appendChild(this.stopButton.container);
|
|
5859
5942
|
}
|
|
5860
5943
|
attachHandlers() {
|
|
5861
5944
|
this.j.e.on(this.sendButton, 'click', this.onSend);
|
|
5862
5945
|
this.j.e.on(this.stopButton, 'click', this.onStop);
|
|
5946
|
+
// Auto-grow the textarea as the user types.
|
|
5947
|
+
this.j.e.on(this.textarea.nativeInput, 'input', ()=>this.autosize());
|
|
5863
5948
|
// Handle keyboard shortcuts
|
|
5864
5949
|
this.j.e.on(this.textarea.nativeInput, 'keydown', (e)=>{
|
|
5865
5950
|
const { sendShortcut, sendOnEnter } = this.options;
|
|
@@ -5901,6 +5986,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5901
5986
|
this.j.e.fire('sendMessage.ai-assistant-pro', message);
|
|
5902
5987
|
if (!this.textarea) return;
|
|
5903
5988
|
this.textarea.value = '';
|
|
5989
|
+
this.autosize();
|
|
5904
5990
|
this.textarea.nativeInput.focus();
|
|
5905
5991
|
}
|
|
5906
5992
|
onStop() {
|
|
@@ -5940,7 +6026,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5940
6026
|
setLoading(loading) {
|
|
5941
6027
|
this.isLoading = loading;
|
|
5942
6028
|
const { sendButton, stopButton, textarea } = this;
|
|
5943
|
-
(0,
|
|
6029
|
+
(0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(sendButton && stopButton && textarea, 'Buttons must be initialized');
|
|
5944
6030
|
textarea.setMod('disabled', loading);
|
|
5945
6031
|
sendButton.setMod('disabled', loading);
|
|
5946
6032
|
this.setMod('loading', loading);
|
|
@@ -5959,6 +6045,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5959
6045
|
setValue(value) {
|
|
5960
6046
|
if (this.textarea) {
|
|
5961
6047
|
this.textarea.value = value;
|
|
6048
|
+
this.autosize();
|
|
5962
6049
|
}
|
|
5963
6050
|
}
|
|
5964
6051
|
getValue() {
|
|
@@ -5966,30 +6053,31 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5966
6053
|
return ((_this_textarea = this.textarea) === null || _this_textarea === void 0 ? void 0 : _this_textarea.value.trim()) || '';
|
|
5967
6054
|
}
|
|
5968
6055
|
destruct() {
|
|
5969
|
-
var _this_textarea, _this_sendButton, _this_stopButton;
|
|
6056
|
+
var _this_textarea, _this_sendButton, _this_stopButton, _this_voiceButton;
|
|
5970
6057
|
(_this_textarea = this.textarea) === null || _this_textarea === void 0 ? void 0 : _this_textarea.destruct();
|
|
5971
6058
|
(_this_sendButton = this.sendButton) === null || _this_sendButton === void 0 ? void 0 : _this_sendButton.destruct();
|
|
5972
6059
|
(_this_stopButton = this.stopButton) === null || _this_stopButton === void 0 ? void 0 : _this_stopButton.destruct();
|
|
6060
|
+
(_this_voiceButton = this.voiceButton) === null || _this_voiceButton === void 0 ? void 0 : _this_voiceButton.destruct();
|
|
5973
6061
|
super.destruct();
|
|
5974
6062
|
}
|
|
5975
6063
|
constructor(view, options){
|
|
5976
|
-
super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "options", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "textarea", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sendButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "stopButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "contextBadges", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "contexts", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isLoading", void 0), this.options = options, this.textarea = null, this.sendButton = null, this.stopButton = null, this.contexts = [], this.isLoading = false;
|
|
6064
|
+
super(view), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "options", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "textarea", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sendButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "stopButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "voiceButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "contextBadges", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "contexts", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isLoading", void 0), this.options = options, this.textarea = null, this.sendButton = null, this.stopButton = null, this.voiceButton = null, this.contexts = [], this.isLoading = false;
|
|
5977
6065
|
}
|
|
5978
6066
|
}
|
|
5979
6067
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5980
|
-
(0,
|
|
6068
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)('input-row:click')
|
|
5981
6069
|
], UIInputArea.prototype, "onInputRowClick", null);
|
|
5982
6070
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5983
|
-
(0,
|
|
6071
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.hook)('ready')
|
|
5984
6072
|
], UIInputArea.prototype, "afterRender", null);
|
|
5985
6073
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5986
|
-
|
|
6074
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
5987
6075
|
], UIInputArea.prototype, "onSend", null);
|
|
5988
6076
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5989
|
-
|
|
6077
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
5990
6078
|
], UIInputArea.prototype, "onStop", null);
|
|
5991
6079
|
UIInputArea = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5992
|
-
|
|
6080
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.component
|
|
5993
6081
|
], UIInputArea);
|
|
5994
6082
|
|
|
5995
6083
|
|
|
@@ -7879,6 +7967,470 @@ UIWelcomeScreen = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__dec
|
|
|
7879
7967
|
], UIWelcomeScreen);
|
|
7880
7968
|
|
|
7881
7969
|
|
|
7970
|
+
/***/ }),
|
|
7971
|
+
|
|
7972
|
+
/***/ 88710:
|
|
7973
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7974
|
+
|
|
7975
|
+
"use strict";
|
|
7976
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7977
|
+
/* harmony export */ MicrophoneStreamer: function() { return /* binding */ MicrophoneStreamer; }
|
|
7978
|
+
/* harmony export */ });
|
|
7979
|
+
/* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77688);
|
|
7980
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82749);
|
|
7981
|
+
|
|
7982
|
+
|
|
7983
|
+
/*!
|
|
7984
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
7985
|
+
* See LICENSE.md in the project root for license information.
|
|
7986
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
7987
|
+
*/ /**
|
|
7988
|
+
* Captures the microphone and emits mono PCM16 @ 24 kHz audio frames — the format
|
|
7989
|
+
* the transcription proxy forwards to the realtime provider. Downsamples from the
|
|
7990
|
+
* browser's native sample rate. Uses only global browser APIs (`getUserMedia`,
|
|
7991
|
+
* `AudioContext`) so it can be stubbed in tests.
|
|
7992
|
+
*
|
|
7993
|
+
* @module plugins/ai-assistant-pro/voice
|
|
7994
|
+
*/ const TARGET_SAMPLE_RATE = 24000;
|
|
7995
|
+
function floatTo16BitPCM(input) {
|
|
7996
|
+
const output = new Int16Array(input.length);
|
|
7997
|
+
for(let i = 0; i < input.length; i++){
|
|
7998
|
+
const sample = Math.max(-1, Math.min(1, input[i]));
|
|
7999
|
+
output[i] = sample < 0 ? sample * 0x8000 : sample * 0x7fff;
|
|
8000
|
+
}
|
|
8001
|
+
return output;
|
|
8002
|
+
}
|
|
8003
|
+
function downsample(input, inputRate, outputRate) {
|
|
8004
|
+
if (outputRate >= inputRate) {
|
|
8005
|
+
return input;
|
|
8006
|
+
}
|
|
8007
|
+
const ratio = inputRate / outputRate;
|
|
8008
|
+
const newLength = Math.round(input.length / ratio);
|
|
8009
|
+
const result = new Float32Array(newLength);
|
|
8010
|
+
for(let i = 0; i < newLength; i++){
|
|
8011
|
+
result[i] = input[Math.min(Math.round(i * ratio), input.length - 1)];
|
|
8012
|
+
}
|
|
8013
|
+
return result;
|
|
8014
|
+
}
|
|
8015
|
+
class MicrophoneStreamer {
|
|
8016
|
+
/**
|
|
8017
|
+
* Request the microphone and start streaming audio frames. Rejects if access
|
|
8018
|
+
* is denied or the audio graph cannot start.
|
|
8019
|
+
*/ start() {
|
|
8020
|
+
return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function*() {
|
|
8021
|
+
this.running = true;
|
|
8022
|
+
this.stream = yield navigator.mediaDevices.getUserMedia({
|
|
8023
|
+
audio: {
|
|
8024
|
+
channelCount: 1,
|
|
8025
|
+
echoCancellation: true,
|
|
8026
|
+
noiseSuppression: true
|
|
8027
|
+
}
|
|
8028
|
+
});
|
|
8029
|
+
if (!this.running) {
|
|
8030
|
+
this.stopTracks();
|
|
8031
|
+
return;
|
|
8032
|
+
}
|
|
8033
|
+
const ctx = new AudioContext();
|
|
8034
|
+
// Browsers often start the context suspended (autoplay policy); without
|
|
8035
|
+
// resuming, onaudioprocess never fires and no audio is sent.
|
|
8036
|
+
if (ctx.state === 'suspended') {
|
|
8037
|
+
yield ctx.resume();
|
|
8038
|
+
}
|
|
8039
|
+
if (!this.running) {
|
|
8040
|
+
void ctx.close();
|
|
8041
|
+
return;
|
|
8042
|
+
}
|
|
8043
|
+
const source = ctx.createMediaStreamSource(this.stream);
|
|
8044
|
+
const processor = ctx.createScriptProcessor(4096, 1, 1);
|
|
8045
|
+
const zeroGain = ctx.createGain();
|
|
8046
|
+
zeroGain.gain.value = 0; // keep the graph running without playback
|
|
8047
|
+
processor.onaudioprocess = (e)=>{
|
|
8048
|
+
if (!this.running) {
|
|
8049
|
+
return;
|
|
8050
|
+
}
|
|
8051
|
+
const input = e.inputBuffer.getChannelData(0);
|
|
8052
|
+
const pcm = floatTo16BitPCM(downsample(input, e.inputBuffer.sampleRate, TARGET_SAMPLE_RATE));
|
|
8053
|
+
// Send the typed-array view directly — its bytes are the PCM16 frame.
|
|
8054
|
+
this.onFrame(pcm);
|
|
8055
|
+
};
|
|
8056
|
+
source.connect(processor);
|
|
8057
|
+
processor.connect(zeroGain);
|
|
8058
|
+
zeroGain.connect(ctx.destination);
|
|
8059
|
+
this.audioCtx = ctx;
|
|
8060
|
+
this.source = source;
|
|
8061
|
+
this.processor = processor;
|
|
8062
|
+
this.zeroGain = zeroGain;
|
|
8063
|
+
}).call(this);
|
|
8064
|
+
}
|
|
8065
|
+
/** Stop streaming and release the microphone and audio graph. */ stop() {
|
|
8066
|
+
var _this_zeroGain, _this_source;
|
|
8067
|
+
this.running = false;
|
|
8068
|
+
if (this.processor) {
|
|
8069
|
+
this.processor.onaudioprocess = null;
|
|
8070
|
+
this.processor.disconnect();
|
|
8071
|
+
this.processor = null;
|
|
8072
|
+
}
|
|
8073
|
+
(_this_zeroGain = this.zeroGain) === null || _this_zeroGain === void 0 ? void 0 : _this_zeroGain.disconnect();
|
|
8074
|
+
(_this_source = this.source) === null || _this_source === void 0 ? void 0 : _this_source.disconnect();
|
|
8075
|
+
this.zeroGain = null;
|
|
8076
|
+
this.source = null;
|
|
8077
|
+
if (this.audioCtx) {
|
|
8078
|
+
void this.audioCtx.close();
|
|
8079
|
+
this.audioCtx = null;
|
|
8080
|
+
}
|
|
8081
|
+
this.stopTracks();
|
|
8082
|
+
}
|
|
8083
|
+
stopTracks() {
|
|
8084
|
+
var _this_stream;
|
|
8085
|
+
(_this_stream = this.stream) === null || _this_stream === void 0 ? void 0 : _this_stream.getTracks().forEach((track)=>track.stop());
|
|
8086
|
+
this.stream = null;
|
|
8087
|
+
}
|
|
8088
|
+
/**
|
|
8089
|
+
* @param onFrame - receives each binary PCM16 audio frame to send upstream.
|
|
8090
|
+
*/ constructor(onFrame){
|
|
8091
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "onFrame", void 0);
|
|
8092
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "stream", void 0);
|
|
8093
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "audioCtx", void 0);
|
|
8094
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "processor", void 0);
|
|
8095
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "source", void 0);
|
|
8096
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "zeroGain", void 0);
|
|
8097
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__._)(this, "running", void 0);
|
|
8098
|
+
this.onFrame = onFrame;
|
|
8099
|
+
this.stream = null;
|
|
8100
|
+
this.audioCtx = null;
|
|
8101
|
+
this.processor = null;
|
|
8102
|
+
this.source = null;
|
|
8103
|
+
this.zeroGain = null;
|
|
8104
|
+
this.running = false;
|
|
8105
|
+
}
|
|
8106
|
+
}
|
|
8107
|
+
|
|
8108
|
+
|
|
8109
|
+
/***/ }),
|
|
8110
|
+
|
|
8111
|
+
/***/ 66330:
|
|
8112
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8113
|
+
|
|
8114
|
+
"use strict";
|
|
8115
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8116
|
+
/* harmony export */ VoiceInputButton: function() { return /* binding */ VoiceInputButton; }
|
|
8117
|
+
/* harmony export */ });
|
|
8118
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
8119
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56075);
|
|
8120
|
+
/* harmony import */ var _voice_transcriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20466);
|
|
8121
|
+
/* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62843);
|
|
8122
|
+
/*!
|
|
8123
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
8124
|
+
* See LICENSE.md in the project root for license information.
|
|
8125
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
8126
|
+
*/
|
|
8127
|
+
|
|
8128
|
+
|
|
8129
|
+
|
|
8130
|
+
const ACTIVE_CLASS = 'jodit-ai-voice-active';
|
|
8131
|
+
/**
|
|
8132
|
+
* The microphone button for the assistant input area. Toggles a
|
|
8133
|
+
* `VoiceTranscriber` session and writes interim/final transcripts into the prompt
|
|
8134
|
+
* (interim text is previewed; final phrases are appended).
|
|
8135
|
+
*/ class VoiceInputButton {
|
|
8136
|
+
get container() {
|
|
8137
|
+
return this.button.container;
|
|
8138
|
+
}
|
|
8139
|
+
setParentView(view) {
|
|
8140
|
+
this.button.setParentView(view);
|
|
8141
|
+
}
|
|
8142
|
+
start() {
|
|
8143
|
+
const callbacks = {
|
|
8144
|
+
onInterim: (text)=>{
|
|
8145
|
+
// New speech — cancel any pending hands-free send.
|
|
8146
|
+
this.clearAutoSend();
|
|
8147
|
+
this.insertPhrase(text);
|
|
8148
|
+
},
|
|
8149
|
+
onFinal: (text)=>{
|
|
8150
|
+
this.insertPhrase(text);
|
|
8151
|
+
this.phraseActive = false;
|
|
8152
|
+
this.scheduleAutoSend();
|
|
8153
|
+
},
|
|
8154
|
+
onError: ()=>this.reset(),
|
|
8155
|
+
onEnd: ()=>this.reset()
|
|
8156
|
+
};
|
|
8157
|
+
let engine;
|
|
8158
|
+
if (this.config.api) {
|
|
8159
|
+
engine = this.config.api(callbacks);
|
|
8160
|
+
} else {
|
|
8161
|
+
const { url, apiKey } = this.config;
|
|
8162
|
+
if (!url || !apiKey) {
|
|
8163
|
+
return;
|
|
8164
|
+
}
|
|
8165
|
+
engine = new _voice_transcriber__WEBPACK_IMPORTED_MODULE_2__.VoiceTranscriber((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({
|
|
8166
|
+
url,
|
|
8167
|
+
apiKey,
|
|
8168
|
+
model: this.config.defaultModel,
|
|
8169
|
+
language: this.config.language,
|
|
8170
|
+
silenceMs: this.config.silenceTimeoutMs
|
|
8171
|
+
}, callbacks));
|
|
8172
|
+
}
|
|
8173
|
+
this.phraseActive = false;
|
|
8174
|
+
this.engine = engine;
|
|
8175
|
+
this.listening = true;
|
|
8176
|
+
this.setActive(true);
|
|
8177
|
+
engine.start();
|
|
8178
|
+
}
|
|
8179
|
+
reset() {
|
|
8180
|
+
this.clearAutoSend();
|
|
8181
|
+
this.setActive(false);
|
|
8182
|
+
this.phraseActive = false;
|
|
8183
|
+
this.listening = false;
|
|
8184
|
+
this.engine = null;
|
|
8185
|
+
this.io.focus();
|
|
8186
|
+
}
|
|
8187
|
+
/**
|
|
8188
|
+
* Schedule a hands-free auto-send after `autoSendSilenceMs` of no new speech.
|
|
8189
|
+
* No-op when the option is unset/null.
|
|
8190
|
+
*/ scheduleAutoSend() {
|
|
8191
|
+
this.clearAutoSend();
|
|
8192
|
+
const ms = this.config.autoSendSilenceMs;
|
|
8193
|
+
if (ms == null) {
|
|
8194
|
+
return;
|
|
8195
|
+
}
|
|
8196
|
+
this.autoSendTimer = this.jodit.async.setTimeout(()=>{
|
|
8197
|
+
this.autoSendTimer = 0;
|
|
8198
|
+
this.io.send();
|
|
8199
|
+
}, ms);
|
|
8200
|
+
}
|
|
8201
|
+
clearAutoSend() {
|
|
8202
|
+
if (this.autoSendTimer) {
|
|
8203
|
+
this.jodit.async.clearTimeout(this.autoSendTimer);
|
|
8204
|
+
this.autoSendTimer = 0;
|
|
8205
|
+
}
|
|
8206
|
+
}
|
|
8207
|
+
setActive(active) {
|
|
8208
|
+
this.button.container.classList.toggle(ACTIVE_CLASS, active);
|
|
8209
|
+
}
|
|
8210
|
+
/**
|
|
8211
|
+
* Insert the current phrase at the caret. The text around the caret (or
|
|
8212
|
+
* selection) is captured once at the start of each phrase from the live input,
|
|
8213
|
+
* so dictation lands where the cursor is, replaces any selection, and respects
|
|
8214
|
+
* manual edits / sends between phrases. Subsequent interims of the same phrase
|
|
8215
|
+
* replace its preview rather than accumulating.
|
|
8216
|
+
*/ insertPhrase(segment) {
|
|
8217
|
+
if (!this.phraseActive) {
|
|
8218
|
+
this.phraseActive = true;
|
|
8219
|
+
const { start, end } = this.io.getSelection();
|
|
8220
|
+
const value = this.io.getValue();
|
|
8221
|
+
this.before = value.slice(0, start);
|
|
8222
|
+
this.after = value.slice(end);
|
|
8223
|
+
}
|
|
8224
|
+
// Avoid gluing words: add a separating space when inserting mid-text.
|
|
8225
|
+
const needsSpace = this.before.length > 0 && !/\s$/.test(this.before);
|
|
8226
|
+
const inserted = (needsSpace ? ' ' : '') + segment;
|
|
8227
|
+
const caret = this.before.length + inserted.length;
|
|
8228
|
+
this.io.setValue(this.before + inserted + this.after, caret);
|
|
8229
|
+
}
|
|
8230
|
+
destruct() {
|
|
8231
|
+
var _this_engine;
|
|
8232
|
+
this.clearAutoSend();
|
|
8233
|
+
this.jodit.e.off('sendMessage.ai-assistant-pro', this.onPromptSent);
|
|
8234
|
+
(_this_engine = this.engine) === null || _this_engine === void 0 ? void 0 : _this_engine.stop();
|
|
8235
|
+
this.engine = null;
|
|
8236
|
+
this.button.destruct();
|
|
8237
|
+
}
|
|
8238
|
+
constructor(jodit, config, io){
|
|
8239
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "jodit", void 0);
|
|
8240
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "config", void 0);
|
|
8241
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "io", void 0);
|
|
8242
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "button", void 0);
|
|
8243
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "engine", void 0);
|
|
8244
|
+
/** Whether a recognition session is active. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "listening", void 0);
|
|
8245
|
+
/** Whether a phrase is in progress (between its first interim and its final). */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "phraseActive", void 0);
|
|
8246
|
+
/** Prompt text before the caret, captured at the start of the current phrase. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "before", void 0);
|
|
8247
|
+
/** Prompt text after the caret (or selection), captured at phrase start. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "after", void 0);
|
|
8248
|
+
/** Pending hands-free auto-send timer id (0 = none). */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "autoSendTimer", void 0);
|
|
8249
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onPromptSent", void 0);
|
|
8250
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "toggle", void 0);
|
|
8251
|
+
this.jodit = jodit;
|
|
8252
|
+
this.config = config;
|
|
8253
|
+
this.io = io;
|
|
8254
|
+
this.engine = null;
|
|
8255
|
+
this.listening = false;
|
|
8256
|
+
this.phraseActive = false;
|
|
8257
|
+
this.before = '';
|
|
8258
|
+
this.after = '';
|
|
8259
|
+
this.autoSendTimer = 0;
|
|
8260
|
+
this.onPromptSent = ()=>{
|
|
8261
|
+
this.phraseActive = false;
|
|
8262
|
+
};
|
|
8263
|
+
this.toggle = ()=>{
|
|
8264
|
+
if (this.listening) {
|
|
8265
|
+
var _this_engine;
|
|
8266
|
+
(_this_engine = this.engine) === null || _this_engine === void 0 ? void 0 : _this_engine.stop();
|
|
8267
|
+
// Reset the UI immediately on manual stop (a close that we initiate
|
|
8268
|
+
// does not always re-emit `onEnd`).
|
|
8269
|
+
this.reset();
|
|
8270
|
+
return;
|
|
8271
|
+
}
|
|
8272
|
+
this.start();
|
|
8273
|
+
};
|
|
8274
|
+
this.button = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_3__.UIButton(jodit, {
|
|
8275
|
+
name: 'voice-input',
|
|
8276
|
+
icon: {
|
|
8277
|
+
name: 'microphone'
|
|
8278
|
+
},
|
|
8279
|
+
variant: 'initial',
|
|
8280
|
+
size: 'middle'
|
|
8281
|
+
});
|
|
8282
|
+
this.button.container.setAttribute('title', 'Dictate');
|
|
8283
|
+
this.button.container.setAttribute('data-ref', 'voiceInputButton');
|
|
8284
|
+
this.jodit.e.on(this.button, 'click', this.toggle);
|
|
8285
|
+
// Sending clears the prompt; end the current phrase so the next one
|
|
8286
|
+
// re-captures its baseline from the (now empty) input rather than
|
|
8287
|
+
// re-inserting the text that was just sent.
|
|
8288
|
+
this.jodit.e.on('sendMessage.ai-assistant-pro', this.onPromptSent);
|
|
8289
|
+
}
|
|
8290
|
+
}
|
|
8291
|
+
|
|
8292
|
+
|
|
8293
|
+
/***/ }),
|
|
8294
|
+
|
|
8295
|
+
/***/ 20466:
|
|
8296
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8297
|
+
|
|
8298
|
+
"use strict";
|
|
8299
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8300
|
+
/* harmony export */ VoiceTranscriber: function() { return /* binding */ VoiceTranscriber; }
|
|
8301
|
+
/* harmony export */ });
|
|
8302
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
8303
|
+
/* harmony import */ var _microphone_streamer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88710);
|
|
8304
|
+
/*!
|
|
8305
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
8306
|
+
* See LICENSE.md in the project root for license information.
|
|
8307
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
8308
|
+
*/
|
|
8309
|
+
|
|
8310
|
+
class VoiceTranscriber {
|
|
8311
|
+
get isActive() {
|
|
8312
|
+
return this.running;
|
|
8313
|
+
}
|
|
8314
|
+
/** Open the socket and begin a transcription session. */ start() {
|
|
8315
|
+
if (this.running) {
|
|
8316
|
+
return;
|
|
8317
|
+
}
|
|
8318
|
+
this.running = true;
|
|
8319
|
+
let url;
|
|
8320
|
+
try {
|
|
8321
|
+
const u = new URL(this.options.url);
|
|
8322
|
+
u.searchParams.set('key', this.options.apiKey);
|
|
8323
|
+
if (this.options.model) {
|
|
8324
|
+
u.searchParams.set('model', this.options.model);
|
|
8325
|
+
}
|
|
8326
|
+
if (this.options.language) {
|
|
8327
|
+
u.searchParams.set('language', this.options.language);
|
|
8328
|
+
}
|
|
8329
|
+
if (this.options.silenceMs !== undefined) {
|
|
8330
|
+
u.searchParams.set('silence', String(this.options.silenceMs));
|
|
8331
|
+
}
|
|
8332
|
+
url = u.toString();
|
|
8333
|
+
} catch (unused) {
|
|
8334
|
+
this.fail('Invalid transcription URL');
|
|
8335
|
+
return;
|
|
8336
|
+
}
|
|
8337
|
+
const ws = new WebSocket(url);
|
|
8338
|
+
ws.binaryType = 'arraybuffer';
|
|
8339
|
+
this.ws = ws;
|
|
8340
|
+
ws.addEventListener('message', (event)=>this.onMessage(event));
|
|
8341
|
+
ws.addEventListener('error', ()=>this.fail('Transcription connection error'));
|
|
8342
|
+
ws.addEventListener('close', ()=>this.finish());
|
|
8343
|
+
}
|
|
8344
|
+
/** Stop the session and release the microphone. */ stop() {
|
|
8345
|
+
var _this_streamer;
|
|
8346
|
+
if (!this.running) {
|
|
8347
|
+
return;
|
|
8348
|
+
}
|
|
8349
|
+
this.running = false;
|
|
8350
|
+
(_this_streamer = this.streamer) === null || _this_streamer === void 0 ? void 0 : _this_streamer.stop();
|
|
8351
|
+
this.streamer = null;
|
|
8352
|
+
if (this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING)) {
|
|
8353
|
+
this.ws.close();
|
|
8354
|
+
}
|
|
8355
|
+
}
|
|
8356
|
+
onMessage(event) {
|
|
8357
|
+
if (typeof event.data !== 'string') {
|
|
8358
|
+
return;
|
|
8359
|
+
}
|
|
8360
|
+
let data;
|
|
8361
|
+
try {
|
|
8362
|
+
data = JSON.parse(event.data);
|
|
8363
|
+
} catch (unused) {
|
|
8364
|
+
return;
|
|
8365
|
+
}
|
|
8366
|
+
switch(data.type){
|
|
8367
|
+
case 'ready':
|
|
8368
|
+
var _this_options_onReady, _this_options;
|
|
8369
|
+
(_this_options_onReady = (_this_options = this.options).onReady) === null || _this_options_onReady === void 0 ? void 0 : _this_options_onReady.call(_this_options);
|
|
8370
|
+
this.startAudio();
|
|
8371
|
+
break;
|
|
8372
|
+
case 'delta':
|
|
8373
|
+
if (data.text) {
|
|
8374
|
+
var _this_options_onInterim, _this_options1;
|
|
8375
|
+
(_this_options_onInterim = (_this_options1 = this.options).onInterim) === null || _this_options_onInterim === void 0 ? void 0 : _this_options_onInterim.call(_this_options1, data.text);
|
|
8376
|
+
}
|
|
8377
|
+
break;
|
|
8378
|
+
case 'final':
|
|
8379
|
+
if (data.text) {
|
|
8380
|
+
var _this_options_onFinal, _this_options2;
|
|
8381
|
+
(_this_options_onFinal = (_this_options2 = this.options).onFinal) === null || _this_options_onFinal === void 0 ? void 0 : _this_options_onFinal.call(_this_options2, data.text);
|
|
8382
|
+
}
|
|
8383
|
+
break;
|
|
8384
|
+
case 'error':
|
|
8385
|
+
var _data_message;
|
|
8386
|
+
this.fail((_data_message = data.message) !== null && _data_message !== void 0 ? _data_message : 'Transcription error');
|
|
8387
|
+
break;
|
|
8388
|
+
}
|
|
8389
|
+
}
|
|
8390
|
+
startAudio() {
|
|
8391
|
+
if (!this.running || this.streamer) {
|
|
8392
|
+
return;
|
|
8393
|
+
}
|
|
8394
|
+
const streamer = new _microphone_streamer__WEBPACK_IMPORTED_MODULE_1__.MicrophoneStreamer((frame)=>{
|
|
8395
|
+
var _this_ws;
|
|
8396
|
+
if (((_this_ws = this.ws) === null || _this_ws === void 0 ? void 0 : _this_ws.readyState) === WebSocket.OPEN) {
|
|
8397
|
+
this.ws.send(frame);
|
|
8398
|
+
}
|
|
8399
|
+
});
|
|
8400
|
+
this.streamer = streamer;
|
|
8401
|
+
streamer.start().catch(()=>{
|
|
8402
|
+
this.fail('Microphone access denied');
|
|
8403
|
+
});
|
|
8404
|
+
}
|
|
8405
|
+
fail(message) {
|
|
8406
|
+
var _this_options_onError, _this_options;
|
|
8407
|
+
(_this_options_onError = (_this_options = this.options).onError) === null || _this_options_onError === void 0 ? void 0 : _this_options_onError.call(_this_options, message);
|
|
8408
|
+
this.stop();
|
|
8409
|
+
}
|
|
8410
|
+
finish() {
|
|
8411
|
+
var _this_streamer;
|
|
8412
|
+
const wasRunning = this.running;
|
|
8413
|
+
this.running = false;
|
|
8414
|
+
(_this_streamer = this.streamer) === null || _this_streamer === void 0 ? void 0 : _this_streamer.stop();
|
|
8415
|
+
this.streamer = null;
|
|
8416
|
+
if (wasRunning) {
|
|
8417
|
+
var _this_options_onEnd, _this_options;
|
|
8418
|
+
(_this_options_onEnd = (_this_options = this.options).onEnd) === null || _this_options_onEnd === void 0 ? void 0 : _this_options_onEnd.call(_this_options);
|
|
8419
|
+
}
|
|
8420
|
+
}
|
|
8421
|
+
constructor(options){
|
|
8422
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "options", void 0);
|
|
8423
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ws", void 0);
|
|
8424
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "streamer", void 0);
|
|
8425
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "running", void 0);
|
|
8426
|
+
this.options = options;
|
|
8427
|
+
this.ws = null;
|
|
8428
|
+
this.streamer = null;
|
|
8429
|
+
this.running = false;
|
|
8430
|
+
}
|
|
8431
|
+
}
|
|
8432
|
+
|
|
8433
|
+
|
|
7882
8434
|
/***/ }),
|
|
7883
8435
|
|
|
7884
8436
|
/***/ 18549:
|