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
|
|
|
@@ -1150,18 +1157,20 @@ jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_16__.JoditPro.plugins.add('aiAssist
|
|
|
1150
1157
|
/* harmony import */ var _icons_ai_commands_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icons_ai_commands_svg__WEBPACK_IMPORTED_MODULE_3__);
|
|
1151
1158
|
/* harmony import */ var _icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83207);
|
|
1152
1159
|
/* harmony import */ var _icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_4__);
|
|
1153
|
-
/* harmony import */ var
|
|
1154
|
-
/* harmony import */ var
|
|
1155
|
-
/* harmony import */ var
|
|
1156
|
-
/* harmony import */ var
|
|
1157
|
-
/* harmony import */ var
|
|
1158
|
-
/* harmony import */ var
|
|
1159
|
-
/* harmony import */ var
|
|
1160
|
-
/* harmony import */ var
|
|
1161
|
-
/* harmony import */ var
|
|
1162
|
-
/* harmony import */ var
|
|
1163
|
-
/* harmony import */ var
|
|
1164
|
-
/* harmony import */ var
|
|
1160
|
+
/* harmony import */ var _icons_microphone_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(99293);
|
|
1161
|
+
/* harmony import */ var _icons_microphone_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icons_microphone_svg__WEBPACK_IMPORTED_MODULE_5__);
|
|
1162
|
+
/* harmony import */ var _icons_send_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99219);
|
|
1163
|
+
/* harmony import */ var _icons_send_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_send_svg__WEBPACK_IMPORTED_MODULE_6__);
|
|
1164
|
+
/* harmony import */ var _icons_shield_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(63674);
|
|
1165
|
+
/* harmony import */ var _icons_shield_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_shield_svg__WEBPACK_IMPORTED_MODULE_7__);
|
|
1166
|
+
/* harmony import */ var _icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4133);
|
|
1167
|
+
/* harmony import */ var _icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
1168
|
+
/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(94454);
|
|
1169
|
+
/* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(53835);
|
|
1170
|
+
/* harmony import */ var jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6441);
|
|
1171
|
+
/* harmony import */ var jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(12153);
|
|
1172
|
+
/* harmony import */ var jodit_esm_plugins_ai_assistant_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(31974);
|
|
1173
|
+
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(72573);
|
|
1165
1174
|
/*!
|
|
1166
1175
|
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
1167
1176
|
* See LICENSE.md in the project root for license information.
|
|
@@ -1180,10 +1189,11 @@ jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_16__.JoditPro.plugins.add('aiAssist
|
|
|
1180
1189
|
|
|
1181
1190
|
|
|
1182
1191
|
|
|
1192
|
+
|
|
1183
1193
|
// Register icons
|
|
1184
|
-
|
|
1194
|
+
jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_12__.Icon.set('ai-assistant-pro', (_icons_ai_assistant_svg__WEBPACK_IMPORTED_MODULE_2___default())).set('ai-commands-pro', (_icons_ai_commands_svg__WEBPACK_IMPORTED_MODULE_3___default())).set('ai-add-context', (_icons_add_context_svg__WEBPACK_IMPORTED_MODULE_1___default())).set('send', (_icons_send_svg__WEBPACK_IMPORTED_MODULE_6___default())).set('microphone', (_icons_microphone_svg__WEBPACK_IMPORTED_MODULE_5___default())).set('tool-bolt', (_icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_8___default())).set('chevron-right', (_icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_4___default())).set('shield', (_icons_shield_svg__WEBPACK_IMPORTED_MODULE_7___default()));
|
|
1185
1195
|
// Default configuration
|
|
1186
|
-
|
|
1196
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.aiAssistantPro = {
|
|
1187
1197
|
// ===== Display Settings =====
|
|
1188
1198
|
displayMode: 'right',
|
|
1189
1199
|
panelWidth: 400,
|
|
@@ -1199,7 +1209,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1199
1209
|
retryDelay: 1000,
|
|
1200
1210
|
maxRecursionToolCallDepth: 1000,
|
|
1201
1211
|
// ===== Tools Configuration =====
|
|
1202
|
-
enabledTools: (0,
|
|
1212
|
+
enabledTools: (0,_tools__WEBPACK_IMPORTED_MODULE_10__.getToolNames)(),
|
|
1203
1213
|
customTools: [],
|
|
1204
1214
|
toolPermissions: {},
|
|
1205
1215
|
// ===== Permission Settings =====
|
|
@@ -1239,7 +1249,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1239
1249
|
},
|
|
1240
1250
|
formatMessageContent: (content, role)=>{
|
|
1241
1251
|
// For user and assistant messages, use markdown
|
|
1242
|
-
return
|
|
1252
|
+
return marked__WEBPACK_IMPORTED_MODULE_14__.marked.parse(content, {
|
|
1243
1253
|
breaks: true,
|
|
1244
1254
|
gfm: true
|
|
1245
1255
|
});
|
|
@@ -1258,6 +1268,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1258
1268
|
autoOpen: true,
|
|
1259
1269
|
rememberLastConversation: true,
|
|
1260
1270
|
autoFocusInput: true,
|
|
1271
|
+
voiceInputEnabled: false,
|
|
1261
1272
|
closeAfterInsert: false,
|
|
1262
1273
|
enableSoundNotifications: false,
|
|
1263
1274
|
debug: false,
|
|
@@ -1314,15 +1325,15 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1314
1325
|
return artifact;
|
|
1315
1326
|
},
|
|
1316
1327
|
getAIProviderOptions (name, config) {
|
|
1317
|
-
return (0,
|
|
1328
|
+
return (0,_providers__WEBPACK_IMPORTED_MODULE_9__.getAIProviderOptions)(name, config);
|
|
1318
1329
|
},
|
|
1319
1330
|
registerAIProvider (name, factory) {
|
|
1320
|
-
(0,
|
|
1331
|
+
(0,_providers__WEBPACK_IMPORTED_MODULE_9__.registerAIProvider)(name, factory);
|
|
1321
1332
|
}
|
|
1322
1333
|
};
|
|
1323
1334
|
/**
|
|
1324
1335
|
* Main AI Assistant Pro control for toolbar
|
|
1325
|
-
*/
|
|
1336
|
+
*/ jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.controls.aiAssistantPro = {
|
|
1326
1337
|
icon: 'ai-assistant-pro',
|
|
1327
1338
|
tooltip: 'AI Assistant',
|
|
1328
1339
|
/**
|
|
@@ -1357,7 +1368,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1357
1368
|
};
|
|
1358
1369
|
/**
|
|
1359
1370
|
* Add Context control for context menu (adds selection to AI context)
|
|
1360
|
-
*/
|
|
1371
|
+
*/ jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.controls.aiAddContext = {
|
|
1361
1372
|
icon: 'ai-add-context',
|
|
1362
1373
|
tooltip: 'Add to AI Context',
|
|
1363
1374
|
/**
|
|
@@ -1379,7 +1390,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1379
1390
|
};
|
|
1380
1391
|
/**
|
|
1381
1392
|
* AI Commands control - quick AI commands dropdown
|
|
1382
|
-
*/
|
|
1393
|
+
*/ jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.controls.aiCommandsPro = {
|
|
1383
1394
|
icon: 'ai-commands-pro',
|
|
1384
1395
|
tooltip: 'AI Commands',
|
|
1385
1396
|
/**
|
|
@@ -1389,7 +1400,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1389
1400
|
},
|
|
1390
1401
|
/**
|
|
1391
1402
|
* Default list of commands (can be overridden via quickCommands config)
|
|
1392
|
-
*/ list:
|
|
1403
|
+
*/ list: jodit_esm_plugins_ai_assistant_config__WEBPACK_IMPORTED_MODULE_13__.aiAssitentCommands,
|
|
1393
1404
|
/**
|
|
1394
1405
|
* Execute handler - fires event with command name
|
|
1395
1406
|
*/ exec (editor, event, { control }) {
|
|
@@ -1398,7 +1409,7 @@ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro =
|
|
|
1398
1409
|
};
|
|
1399
1410
|
/**
|
|
1400
1411
|
* Extend tune-block popup to include "Add to AI Context" option
|
|
1401
|
-
*/ const originalTuneBlockPopup =
|
|
1412
|
+
*/ const originalTuneBlockPopup = jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.tuneBlock?.popup || {};
|
|
1402
1413
|
// Add AI context option to all block types
|
|
1403
1414
|
const tuneBlockExtension = {};
|
|
1404
1415
|
// Common block types
|
|
@@ -1439,8 +1450,8 @@ blockTypes.forEach((tag)=>{
|
|
|
1439
1450
|
];
|
|
1440
1451
|
});
|
|
1441
1452
|
// Merge with existing tune-block configuration
|
|
1442
|
-
if (
|
|
1443
|
-
|
|
1453
|
+
if (jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.tuneBlock) {
|
|
1454
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_11__.Config.prototype.tuneBlock.popup = {
|
|
1444
1455
|
...originalTuneBlockPopup,
|
|
1445
1456
|
...tuneBlockExtension
|
|
1446
1457
|
};
|
|
@@ -3761,9 +3772,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3761
3772
|
const url = config.url.replace(/\/+$/, '');
|
|
3762
3773
|
const provider = config.provider ?? 'openai';
|
|
3763
3774
|
const stream = config.stream !== false;
|
|
3775
|
+
// Voice dictation goes over a WebSocket to the transcription proxy; derive its
|
|
3776
|
+
// wss URL from the same host (http→ws, https→wss).
|
|
3777
|
+
const transcribeUrl = `${url.replace(/^http/, 'ws')}/v1/ai/transcribe`;
|
|
3764
3778
|
return {
|
|
3765
3779
|
apiMode: 'incremental',
|
|
3766
3780
|
maxRetries: 0,
|
|
3781
|
+
// Enable voice dictation; the transcription model is chosen server-side
|
|
3782
|
+
// (like the text model). Override per-editor with the `voiceInput*` options.
|
|
3783
|
+
voiceInputEnabled: true,
|
|
3784
|
+
voiceInputUrl: transcribeUrl,
|
|
3785
|
+
voiceInputApiKey: config.apiKey,
|
|
3767
3786
|
textAutocompleteEnabled: true,
|
|
3768
3787
|
textAutocompleteApiRequest: async (query, maxSuggestions, signal)=>{
|
|
3769
3788
|
const ajax = new jodit_esm_core_request_ajax__WEBPACK_IMPORTED_MODULE_1__.Ajax({
|
|
@@ -5517,11 +5536,12 @@ UIConversationList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
5517
5536
|
/* harmony export */ });
|
|
5518
5537
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
5519
5538
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
5520
|
-
/* harmony import */ var
|
|
5521
|
-
/* harmony import */ var
|
|
5522
|
-
/* harmony import */ var
|
|
5523
|
-
/* harmony import */ var
|
|
5524
|
-
/* harmony import */ var
|
|
5539
|
+
/* harmony import */ var _voice_voice_input_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66330);
|
|
5540
|
+
/* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65478);
|
|
5541
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38837);
|
|
5542
|
+
/* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67510);
|
|
5543
|
+
/* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62843);
|
|
5544
|
+
/* harmony import */ var jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85120);
|
|
5525
5545
|
/*!
|
|
5526
5546
|
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
5527
5547
|
* See LICENSE.md in the project root for license information.
|
|
@@ -5533,7 +5553,8 @@ UIConversationList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
|
|
|
5533
5553
|
|
|
5534
5554
|
|
|
5535
5555
|
|
|
5536
|
-
|
|
5556
|
+
|
|
5557
|
+
class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_5__.UIElement {
|
|
5537
5558
|
className() {
|
|
5538
5559
|
return 'UIInputArea';
|
|
5539
5560
|
}
|
|
@@ -5541,6 +5562,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5541
5562
|
this.textarea?.setParentView(view);
|
|
5542
5563
|
this.sendButton?.setParentView(view);
|
|
5543
5564
|
this.stopButton?.setParentView(view);
|
|
5565
|
+
this.voiceButton?.setParentView(view);
|
|
5544
5566
|
return super.setParentView(view);
|
|
5545
5567
|
}
|
|
5546
5568
|
render() {
|
|
@@ -5566,19 +5588,30 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5566
5588
|
this.contextBadges = this.getElm('context-badges');
|
|
5567
5589
|
this.createControls();
|
|
5568
5590
|
this.attachHandlers();
|
|
5591
|
+
this.autosize();
|
|
5592
|
+
}
|
|
5593
|
+
/** Grow the textarea to fit its content up to a max height, then scroll. */ autosize() {
|
|
5594
|
+
const input = this.textarea?.nativeInput;
|
|
5595
|
+
if (!input) {
|
|
5596
|
+
return;
|
|
5597
|
+
}
|
|
5598
|
+
const maxHeight = 160;
|
|
5599
|
+
input.style.height = 'auto';
|
|
5600
|
+
input.style.height = `${Math.min(input.scrollHeight, maxHeight)}px`;
|
|
5601
|
+
input.style.overflowY = input.scrollHeight > maxHeight ? 'auto' : 'hidden';
|
|
5569
5602
|
}
|
|
5570
5603
|
createControls() {
|
|
5571
5604
|
const textareaWrapper = this.getElm('textarea-wrapper');
|
|
5572
5605
|
const buttonsWrapper = this.getElm('buttons');
|
|
5573
5606
|
// Textarea
|
|
5574
|
-
this.textarea = new
|
|
5607
|
+
this.textarea = new jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_7__.UITextArea(this.j, {
|
|
5575
5608
|
name: 'message',
|
|
5576
5609
|
placeholder: this.options.placeholderText,
|
|
5577
5610
|
resizable: false
|
|
5578
5611
|
});
|
|
5579
5612
|
textareaWrapper.appendChild(this.textarea.container);
|
|
5580
5613
|
// Send button
|
|
5581
|
-
this.sendButton = new
|
|
5614
|
+
this.sendButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.UIButton(this.j, {
|
|
5582
5615
|
name: 'send-message',
|
|
5583
5616
|
icon: {
|
|
5584
5617
|
name: 'send'
|
|
@@ -5587,7 +5620,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5587
5620
|
size: 'middle'
|
|
5588
5621
|
});
|
|
5589
5622
|
// Stop button
|
|
5590
|
-
this.stopButton = new
|
|
5623
|
+
this.stopButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.UIButton(this.j, {
|
|
5591
5624
|
name: 'abort-message',
|
|
5592
5625
|
icon: {
|
|
5593
5626
|
name: 'cancel'
|
|
@@ -5596,12 +5629,57 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5596
5629
|
size: 'middle'
|
|
5597
5630
|
});
|
|
5598
5631
|
this.stopButton.container.style.display = 'none';
|
|
5632
|
+
// Microphone (voice dictation) button — only when configured.
|
|
5633
|
+
if (this.options.voiceInputEnabled) {
|
|
5634
|
+
this.voiceButton = new _voice_voice_input_button__WEBPACK_IMPORTED_MODULE_2__.VoiceInputButton(this.j, {
|
|
5635
|
+
url: this.options.voiceInputUrl,
|
|
5636
|
+
apiKey: this.options.voiceInputApiKey,
|
|
5637
|
+
defaultModel: this.options.voiceInputDefaultModel,
|
|
5638
|
+
language: this.options.voiceInputLanguage,
|
|
5639
|
+
silenceTimeoutMs: this.options.voiceInputSilenceTimeoutMs,
|
|
5640
|
+
autoSendSilenceMs: this.options.voiceInputAutoSendSilenceMs,
|
|
5641
|
+
api: this.options.voiceInputApi
|
|
5642
|
+
}, {
|
|
5643
|
+
getValue: ()=>this.textarea?.nativeInput.value ?? '',
|
|
5644
|
+
setValue: (value, caret)=>{
|
|
5645
|
+
if (!this.textarea) {
|
|
5646
|
+
return;
|
|
5647
|
+
}
|
|
5648
|
+
this.textarea.value = value;
|
|
5649
|
+
if (caret !== undefined) {
|
|
5650
|
+
const input = this.textarea.nativeInput;
|
|
5651
|
+
input.selectionStart = caret;
|
|
5652
|
+
input.selectionEnd = caret;
|
|
5653
|
+
}
|
|
5654
|
+
this.autosize();
|
|
5655
|
+
},
|
|
5656
|
+
getSelection: ()=>{
|
|
5657
|
+
const input = this.textarea?.nativeInput;
|
|
5658
|
+
if (!input) {
|
|
5659
|
+
return {
|
|
5660
|
+
start: 0,
|
|
5661
|
+
end: 0
|
|
5662
|
+
};
|
|
5663
|
+
}
|
|
5664
|
+
const len = input.value.length;
|
|
5665
|
+
return {
|
|
5666
|
+
start: input.selectionStart ?? len,
|
|
5667
|
+
end: input.selectionEnd ?? len
|
|
5668
|
+
};
|
|
5669
|
+
},
|
|
5670
|
+
focus: ()=>this.focus(),
|
|
5671
|
+
send: ()=>this.onSend()
|
|
5672
|
+
});
|
|
5673
|
+
buttonsWrapper.appendChild(this.voiceButton.container);
|
|
5674
|
+
}
|
|
5599
5675
|
buttonsWrapper.appendChild(this.sendButton.container);
|
|
5600
5676
|
buttonsWrapper.appendChild(this.stopButton.container);
|
|
5601
5677
|
}
|
|
5602
5678
|
attachHandlers() {
|
|
5603
5679
|
this.j.e.on(this.sendButton, 'click', this.onSend);
|
|
5604
5680
|
this.j.e.on(this.stopButton, 'click', this.onStop);
|
|
5681
|
+
// Auto-grow the textarea as the user types.
|
|
5682
|
+
this.j.e.on(this.textarea.nativeInput, 'input', ()=>this.autosize());
|
|
5605
5683
|
// Handle keyboard shortcuts
|
|
5606
5684
|
this.j.e.on(this.textarea.nativeInput, 'keydown', (e)=>{
|
|
5607
5685
|
const { sendShortcut, sendOnEnter } = this.options;
|
|
@@ -5642,6 +5720,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5642
5720
|
this.j.e.fire('sendMessage.ai-assistant-pro', message);
|
|
5643
5721
|
if (!this.textarea) return;
|
|
5644
5722
|
this.textarea.value = '';
|
|
5723
|
+
this.autosize();
|
|
5645
5724
|
this.textarea.nativeInput.focus();
|
|
5646
5725
|
}
|
|
5647
5726
|
onStop() {
|
|
@@ -5681,7 +5760,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5681
5760
|
setLoading(loading) {
|
|
5682
5761
|
this.isLoading = loading;
|
|
5683
5762
|
const { sendButton, stopButton, textarea } = this;
|
|
5684
|
-
(0,
|
|
5763
|
+
(0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(sendButton && stopButton && textarea, 'Buttons must be initialized');
|
|
5685
5764
|
textarea.setMod('disabled', loading);
|
|
5686
5765
|
sendButton.setMod('disabled', loading);
|
|
5687
5766
|
this.setMod('loading', loading);
|
|
@@ -5699,6 +5778,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5699
5778
|
setValue(value) {
|
|
5700
5779
|
if (this.textarea) {
|
|
5701
5780
|
this.textarea.value = value;
|
|
5781
|
+
this.autosize();
|
|
5702
5782
|
}
|
|
5703
5783
|
}
|
|
5704
5784
|
getValue() {
|
|
@@ -5708,26 +5788,27 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
|
|
|
5708
5788
|
this.textarea?.destruct();
|
|
5709
5789
|
this.sendButton?.destruct();
|
|
5710
5790
|
this.stopButton?.destruct();
|
|
5791
|
+
this.voiceButton?.destruct();
|
|
5711
5792
|
super.destruct();
|
|
5712
5793
|
}
|
|
5713
5794
|
constructor(view, options){
|
|
5714
|
-
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;
|
|
5795
|
+
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;
|
|
5715
5796
|
}
|
|
5716
5797
|
}
|
|
5717
5798
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5718
|
-
(0,
|
|
5799
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)('input-row:click')
|
|
5719
5800
|
], UIInputArea.prototype, "onInputRowClick", null);
|
|
5720
5801
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5721
|
-
(0,
|
|
5802
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.hook)('ready')
|
|
5722
5803
|
], UIInputArea.prototype, "afterRender", null);
|
|
5723
5804
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5724
|
-
|
|
5805
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
5725
5806
|
], UIInputArea.prototype, "onSend", null);
|
|
5726
5807
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5727
|
-
|
|
5808
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
5728
5809
|
], UIInputArea.prototype, "onStop", null);
|
|
5729
5810
|
UIInputArea = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
5730
|
-
|
|
5811
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.component
|
|
5731
5812
|
], UIInputArea);
|
|
5732
5813
|
|
|
5733
5814
|
|
|
@@ -7559,6 +7640,452 @@ UIWelcomeScreen = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__dec
|
|
|
7559
7640
|
], UIWelcomeScreen);
|
|
7560
7641
|
|
|
7561
7642
|
|
|
7643
|
+
/***/ }),
|
|
7644
|
+
|
|
7645
|
+
/***/ 88710:
|
|
7646
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7647
|
+
|
|
7648
|
+
"use strict";
|
|
7649
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7650
|
+
/* harmony export */ MicrophoneStreamer: function() { return /* binding */ MicrophoneStreamer; }
|
|
7651
|
+
/* harmony export */ });
|
|
7652
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
7653
|
+
|
|
7654
|
+
/*!
|
|
7655
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
7656
|
+
* See LICENSE.md in the project root for license information.
|
|
7657
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
7658
|
+
*/ /**
|
|
7659
|
+
* Captures the microphone and emits mono PCM16 @ 24 kHz audio frames — the format
|
|
7660
|
+
* the transcription proxy forwards to the realtime provider. Downsamples from the
|
|
7661
|
+
* browser's native sample rate. Uses only global browser APIs (`getUserMedia`,
|
|
7662
|
+
* `AudioContext`) so it can be stubbed in tests.
|
|
7663
|
+
*
|
|
7664
|
+
* @module plugins/ai-assistant-pro/voice
|
|
7665
|
+
*/ const TARGET_SAMPLE_RATE = 24000;
|
|
7666
|
+
function floatTo16BitPCM(input) {
|
|
7667
|
+
const output = new Int16Array(input.length);
|
|
7668
|
+
for(let i = 0; i < input.length; i++){
|
|
7669
|
+
const sample = Math.max(-1, Math.min(1, input[i]));
|
|
7670
|
+
output[i] = sample < 0 ? sample * 0x8000 : sample * 0x7fff;
|
|
7671
|
+
}
|
|
7672
|
+
return output;
|
|
7673
|
+
}
|
|
7674
|
+
function downsample(input, inputRate, outputRate) {
|
|
7675
|
+
if (outputRate >= inputRate) {
|
|
7676
|
+
return input;
|
|
7677
|
+
}
|
|
7678
|
+
const ratio = inputRate / outputRate;
|
|
7679
|
+
const newLength = Math.round(input.length / ratio);
|
|
7680
|
+
const result = new Float32Array(newLength);
|
|
7681
|
+
for(let i = 0; i < newLength; i++){
|
|
7682
|
+
result[i] = input[Math.min(Math.round(i * ratio), input.length - 1)];
|
|
7683
|
+
}
|
|
7684
|
+
return result;
|
|
7685
|
+
}
|
|
7686
|
+
class MicrophoneStreamer {
|
|
7687
|
+
/**
|
|
7688
|
+
* Request the microphone and start streaming audio frames. Rejects if access
|
|
7689
|
+
* is denied or the audio graph cannot start.
|
|
7690
|
+
*/ async start() {
|
|
7691
|
+
this.running = true;
|
|
7692
|
+
this.stream = await navigator.mediaDevices.getUserMedia({
|
|
7693
|
+
audio: {
|
|
7694
|
+
channelCount: 1,
|
|
7695
|
+
echoCancellation: true,
|
|
7696
|
+
noiseSuppression: true
|
|
7697
|
+
}
|
|
7698
|
+
});
|
|
7699
|
+
if (!this.running) {
|
|
7700
|
+
this.stopTracks();
|
|
7701
|
+
return;
|
|
7702
|
+
}
|
|
7703
|
+
const ctx = new AudioContext();
|
|
7704
|
+
// Browsers often start the context suspended (autoplay policy); without
|
|
7705
|
+
// resuming, onaudioprocess never fires and no audio is sent.
|
|
7706
|
+
if (ctx.state === 'suspended') {
|
|
7707
|
+
await ctx.resume();
|
|
7708
|
+
}
|
|
7709
|
+
if (!this.running) {
|
|
7710
|
+
void ctx.close();
|
|
7711
|
+
return;
|
|
7712
|
+
}
|
|
7713
|
+
const source = ctx.createMediaStreamSource(this.stream);
|
|
7714
|
+
const processor = ctx.createScriptProcessor(4096, 1, 1);
|
|
7715
|
+
const zeroGain = ctx.createGain();
|
|
7716
|
+
zeroGain.gain.value = 0; // keep the graph running without playback
|
|
7717
|
+
processor.onaudioprocess = (e)=>{
|
|
7718
|
+
if (!this.running) {
|
|
7719
|
+
return;
|
|
7720
|
+
}
|
|
7721
|
+
const input = e.inputBuffer.getChannelData(0);
|
|
7722
|
+
const pcm = floatTo16BitPCM(downsample(input, e.inputBuffer.sampleRate, TARGET_SAMPLE_RATE));
|
|
7723
|
+
// Send the typed-array view directly — its bytes are the PCM16 frame.
|
|
7724
|
+
this.onFrame(pcm);
|
|
7725
|
+
};
|
|
7726
|
+
source.connect(processor);
|
|
7727
|
+
processor.connect(zeroGain);
|
|
7728
|
+
zeroGain.connect(ctx.destination);
|
|
7729
|
+
this.audioCtx = ctx;
|
|
7730
|
+
this.source = source;
|
|
7731
|
+
this.processor = processor;
|
|
7732
|
+
this.zeroGain = zeroGain;
|
|
7733
|
+
}
|
|
7734
|
+
/** Stop streaming and release the microphone and audio graph. */ stop() {
|
|
7735
|
+
this.running = false;
|
|
7736
|
+
if (this.processor) {
|
|
7737
|
+
this.processor.onaudioprocess = null;
|
|
7738
|
+
this.processor.disconnect();
|
|
7739
|
+
this.processor = null;
|
|
7740
|
+
}
|
|
7741
|
+
this.zeroGain?.disconnect();
|
|
7742
|
+
this.source?.disconnect();
|
|
7743
|
+
this.zeroGain = null;
|
|
7744
|
+
this.source = null;
|
|
7745
|
+
if (this.audioCtx) {
|
|
7746
|
+
void this.audioCtx.close();
|
|
7747
|
+
this.audioCtx = null;
|
|
7748
|
+
}
|
|
7749
|
+
this.stopTracks();
|
|
7750
|
+
}
|
|
7751
|
+
stopTracks() {
|
|
7752
|
+
this.stream?.getTracks().forEach((track)=>track.stop());
|
|
7753
|
+
this.stream = null;
|
|
7754
|
+
}
|
|
7755
|
+
/**
|
|
7756
|
+
* @param onFrame - receives each binary PCM16 audio frame to send upstream.
|
|
7757
|
+
*/ constructor(onFrame){
|
|
7758
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onFrame", void 0);
|
|
7759
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "stream", void 0);
|
|
7760
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "audioCtx", void 0);
|
|
7761
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "processor", void 0);
|
|
7762
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "source", void 0);
|
|
7763
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "zeroGain", void 0);
|
|
7764
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "running", void 0);
|
|
7765
|
+
this.onFrame = onFrame;
|
|
7766
|
+
this.stream = null;
|
|
7767
|
+
this.audioCtx = null;
|
|
7768
|
+
this.processor = null;
|
|
7769
|
+
this.source = null;
|
|
7770
|
+
this.zeroGain = null;
|
|
7771
|
+
this.running = false;
|
|
7772
|
+
}
|
|
7773
|
+
}
|
|
7774
|
+
|
|
7775
|
+
|
|
7776
|
+
/***/ }),
|
|
7777
|
+
|
|
7778
|
+
/***/ 66330:
|
|
7779
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7780
|
+
|
|
7781
|
+
"use strict";
|
|
7782
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7783
|
+
/* harmony export */ VoiceInputButton: function() { return /* binding */ VoiceInputButton; }
|
|
7784
|
+
/* harmony export */ });
|
|
7785
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
7786
|
+
/* harmony import */ var _voice_transcriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20466);
|
|
7787
|
+
/* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62843);
|
|
7788
|
+
/*!
|
|
7789
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
7790
|
+
* See LICENSE.md in the project root for license information.
|
|
7791
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
7792
|
+
*/
|
|
7793
|
+
|
|
7794
|
+
|
|
7795
|
+
const ACTIVE_CLASS = 'jodit-ai-voice-active';
|
|
7796
|
+
/**
|
|
7797
|
+
* The microphone button for the assistant input area. Toggles a
|
|
7798
|
+
* `VoiceTranscriber` session and writes interim/final transcripts into the prompt
|
|
7799
|
+
* (interim text is previewed; final phrases are appended).
|
|
7800
|
+
*/ class VoiceInputButton {
|
|
7801
|
+
get container() {
|
|
7802
|
+
return this.button.container;
|
|
7803
|
+
}
|
|
7804
|
+
setParentView(view) {
|
|
7805
|
+
this.button.setParentView(view);
|
|
7806
|
+
}
|
|
7807
|
+
start() {
|
|
7808
|
+
const callbacks = {
|
|
7809
|
+
onInterim: (text)=>{
|
|
7810
|
+
// New speech — cancel any pending hands-free send.
|
|
7811
|
+
this.clearAutoSend();
|
|
7812
|
+
this.insertPhrase(text);
|
|
7813
|
+
},
|
|
7814
|
+
onFinal: (text)=>{
|
|
7815
|
+
this.insertPhrase(text);
|
|
7816
|
+
this.phraseActive = false;
|
|
7817
|
+
this.scheduleAutoSend();
|
|
7818
|
+
},
|
|
7819
|
+
onError: ()=>this.reset(),
|
|
7820
|
+
onEnd: ()=>this.reset()
|
|
7821
|
+
};
|
|
7822
|
+
let engine;
|
|
7823
|
+
if (this.config.api) {
|
|
7824
|
+
engine = this.config.api(callbacks);
|
|
7825
|
+
} else {
|
|
7826
|
+
const { url, apiKey } = this.config;
|
|
7827
|
+
if (!url || !apiKey) {
|
|
7828
|
+
return;
|
|
7829
|
+
}
|
|
7830
|
+
engine = new _voice_transcriber__WEBPACK_IMPORTED_MODULE_1__.VoiceTranscriber({
|
|
7831
|
+
url,
|
|
7832
|
+
apiKey,
|
|
7833
|
+
model: this.config.defaultModel,
|
|
7834
|
+
language: this.config.language,
|
|
7835
|
+
silenceMs: this.config.silenceTimeoutMs,
|
|
7836
|
+
...callbacks
|
|
7837
|
+
});
|
|
7838
|
+
}
|
|
7839
|
+
this.phraseActive = false;
|
|
7840
|
+
this.engine = engine;
|
|
7841
|
+
this.listening = true;
|
|
7842
|
+
this.setActive(true);
|
|
7843
|
+
engine.start();
|
|
7844
|
+
}
|
|
7845
|
+
reset() {
|
|
7846
|
+
this.clearAutoSend();
|
|
7847
|
+
this.setActive(false);
|
|
7848
|
+
this.phraseActive = false;
|
|
7849
|
+
this.listening = false;
|
|
7850
|
+
this.engine = null;
|
|
7851
|
+
this.io.focus();
|
|
7852
|
+
}
|
|
7853
|
+
/**
|
|
7854
|
+
* Schedule a hands-free auto-send after `autoSendSilenceMs` of no new speech.
|
|
7855
|
+
* No-op when the option is unset/null.
|
|
7856
|
+
*/ scheduleAutoSend() {
|
|
7857
|
+
this.clearAutoSend();
|
|
7858
|
+
const ms = this.config.autoSendSilenceMs;
|
|
7859
|
+
if (ms == null) {
|
|
7860
|
+
return;
|
|
7861
|
+
}
|
|
7862
|
+
this.autoSendTimer = this.jodit.async.setTimeout(()=>{
|
|
7863
|
+
this.autoSendTimer = 0;
|
|
7864
|
+
this.io.send();
|
|
7865
|
+
}, ms);
|
|
7866
|
+
}
|
|
7867
|
+
clearAutoSend() {
|
|
7868
|
+
if (this.autoSendTimer) {
|
|
7869
|
+
this.jodit.async.clearTimeout(this.autoSendTimer);
|
|
7870
|
+
this.autoSendTimer = 0;
|
|
7871
|
+
}
|
|
7872
|
+
}
|
|
7873
|
+
setActive(active) {
|
|
7874
|
+
this.button.container.classList.toggle(ACTIVE_CLASS, active);
|
|
7875
|
+
}
|
|
7876
|
+
/**
|
|
7877
|
+
* Insert the current phrase at the caret. The text around the caret (or
|
|
7878
|
+
* selection) is captured once at the start of each phrase from the live input,
|
|
7879
|
+
* so dictation lands where the cursor is, replaces any selection, and respects
|
|
7880
|
+
* manual edits / sends between phrases. Subsequent interims of the same phrase
|
|
7881
|
+
* replace its preview rather than accumulating.
|
|
7882
|
+
*/ insertPhrase(segment) {
|
|
7883
|
+
if (!this.phraseActive) {
|
|
7884
|
+
this.phraseActive = true;
|
|
7885
|
+
const { start, end } = this.io.getSelection();
|
|
7886
|
+
const value = this.io.getValue();
|
|
7887
|
+
this.before = value.slice(0, start);
|
|
7888
|
+
this.after = value.slice(end);
|
|
7889
|
+
}
|
|
7890
|
+
// Avoid gluing words: add a separating space when inserting mid-text.
|
|
7891
|
+
const needsSpace = this.before.length > 0 && !/\s$/.test(this.before);
|
|
7892
|
+
const inserted = (needsSpace ? ' ' : '') + segment;
|
|
7893
|
+
const caret = this.before.length + inserted.length;
|
|
7894
|
+
this.io.setValue(this.before + inserted + this.after, caret);
|
|
7895
|
+
}
|
|
7896
|
+
destruct() {
|
|
7897
|
+
this.clearAutoSend();
|
|
7898
|
+
this.jodit.e.off('sendMessage.ai-assistant-pro', this.onPromptSent);
|
|
7899
|
+
this.engine?.stop();
|
|
7900
|
+
this.engine = null;
|
|
7901
|
+
this.button.destruct();
|
|
7902
|
+
}
|
|
7903
|
+
constructor(jodit, config, io){
|
|
7904
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "jodit", void 0);
|
|
7905
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "config", void 0);
|
|
7906
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "io", void 0);
|
|
7907
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "button", void 0);
|
|
7908
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "engine", void 0);
|
|
7909
|
+
/** Whether a recognition session is active. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "listening", void 0);
|
|
7910
|
+
/** 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);
|
|
7911
|
+
/** 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);
|
|
7912
|
+
/** Prompt text after the caret (or selection), captured at phrase start. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "after", void 0);
|
|
7913
|
+
/** Pending hands-free auto-send timer id (0 = none). */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "autoSendTimer", void 0);
|
|
7914
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onPromptSent", void 0);
|
|
7915
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "toggle", void 0);
|
|
7916
|
+
this.jodit = jodit;
|
|
7917
|
+
this.config = config;
|
|
7918
|
+
this.io = io;
|
|
7919
|
+
this.engine = null;
|
|
7920
|
+
this.listening = false;
|
|
7921
|
+
this.phraseActive = false;
|
|
7922
|
+
this.before = '';
|
|
7923
|
+
this.after = '';
|
|
7924
|
+
this.autoSendTimer = 0;
|
|
7925
|
+
this.onPromptSent = ()=>{
|
|
7926
|
+
this.phraseActive = false;
|
|
7927
|
+
};
|
|
7928
|
+
this.toggle = ()=>{
|
|
7929
|
+
if (this.listening) {
|
|
7930
|
+
this.engine?.stop();
|
|
7931
|
+
// Reset the UI immediately on manual stop (a close that we initiate
|
|
7932
|
+
// does not always re-emit `onEnd`).
|
|
7933
|
+
this.reset();
|
|
7934
|
+
return;
|
|
7935
|
+
}
|
|
7936
|
+
this.start();
|
|
7937
|
+
};
|
|
7938
|
+
this.button = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.UIButton(jodit, {
|
|
7939
|
+
name: 'voice-input',
|
|
7940
|
+
icon: {
|
|
7941
|
+
name: 'microphone'
|
|
7942
|
+
},
|
|
7943
|
+
variant: 'initial',
|
|
7944
|
+
size: 'middle'
|
|
7945
|
+
});
|
|
7946
|
+
this.button.container.setAttribute('title', 'Dictate');
|
|
7947
|
+
this.button.container.setAttribute('data-ref', 'voiceInputButton');
|
|
7948
|
+
this.jodit.e.on(this.button, 'click', this.toggle);
|
|
7949
|
+
// Sending clears the prompt; end the current phrase so the next one
|
|
7950
|
+
// re-captures its baseline from the (now empty) input rather than
|
|
7951
|
+
// re-inserting the text that was just sent.
|
|
7952
|
+
this.jodit.e.on('sendMessage.ai-assistant-pro', this.onPromptSent);
|
|
7953
|
+
}
|
|
7954
|
+
}
|
|
7955
|
+
|
|
7956
|
+
|
|
7957
|
+
/***/ }),
|
|
7958
|
+
|
|
7959
|
+
/***/ 20466:
|
|
7960
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7961
|
+
|
|
7962
|
+
"use strict";
|
|
7963
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7964
|
+
/* harmony export */ VoiceTranscriber: function() { return /* binding */ VoiceTranscriber; }
|
|
7965
|
+
/* harmony export */ });
|
|
7966
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
7967
|
+
/* harmony import */ var _microphone_streamer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88710);
|
|
7968
|
+
/*!
|
|
7969
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
7970
|
+
* See LICENSE.md in the project root for license information.
|
|
7971
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
7972
|
+
*/
|
|
7973
|
+
|
|
7974
|
+
class VoiceTranscriber {
|
|
7975
|
+
get isActive() {
|
|
7976
|
+
return this.running;
|
|
7977
|
+
}
|
|
7978
|
+
/** Open the socket and begin a transcription session. */ start() {
|
|
7979
|
+
if (this.running) {
|
|
7980
|
+
return;
|
|
7981
|
+
}
|
|
7982
|
+
this.running = true;
|
|
7983
|
+
let url;
|
|
7984
|
+
try {
|
|
7985
|
+
const u = new URL(this.options.url);
|
|
7986
|
+
u.searchParams.set('key', this.options.apiKey);
|
|
7987
|
+
if (this.options.model) {
|
|
7988
|
+
u.searchParams.set('model', this.options.model);
|
|
7989
|
+
}
|
|
7990
|
+
if (this.options.language) {
|
|
7991
|
+
u.searchParams.set('language', this.options.language);
|
|
7992
|
+
}
|
|
7993
|
+
if (this.options.silenceMs !== undefined) {
|
|
7994
|
+
u.searchParams.set('silence', String(this.options.silenceMs));
|
|
7995
|
+
}
|
|
7996
|
+
url = u.toString();
|
|
7997
|
+
} catch {
|
|
7998
|
+
this.fail('Invalid transcription URL');
|
|
7999
|
+
return;
|
|
8000
|
+
}
|
|
8001
|
+
const ws = new WebSocket(url);
|
|
8002
|
+
ws.binaryType = 'arraybuffer';
|
|
8003
|
+
this.ws = ws;
|
|
8004
|
+
ws.addEventListener('message', (event)=>this.onMessage(event));
|
|
8005
|
+
ws.addEventListener('error', ()=>this.fail('Transcription connection error'));
|
|
8006
|
+
ws.addEventListener('close', ()=>this.finish());
|
|
8007
|
+
}
|
|
8008
|
+
/** Stop the session and release the microphone. */ stop() {
|
|
8009
|
+
if (!this.running) {
|
|
8010
|
+
return;
|
|
8011
|
+
}
|
|
8012
|
+
this.running = false;
|
|
8013
|
+
this.streamer?.stop();
|
|
8014
|
+
this.streamer = null;
|
|
8015
|
+
if (this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING)) {
|
|
8016
|
+
this.ws.close();
|
|
8017
|
+
}
|
|
8018
|
+
}
|
|
8019
|
+
onMessage(event) {
|
|
8020
|
+
if (typeof event.data !== 'string') {
|
|
8021
|
+
return;
|
|
8022
|
+
}
|
|
8023
|
+
let data;
|
|
8024
|
+
try {
|
|
8025
|
+
data = JSON.parse(event.data);
|
|
8026
|
+
} catch {
|
|
8027
|
+
return;
|
|
8028
|
+
}
|
|
8029
|
+
switch(data.type){
|
|
8030
|
+
case 'ready':
|
|
8031
|
+
this.options.onReady?.();
|
|
8032
|
+
this.startAudio();
|
|
8033
|
+
break;
|
|
8034
|
+
case 'delta':
|
|
8035
|
+
if (data.text) {
|
|
8036
|
+
this.options.onInterim?.(data.text);
|
|
8037
|
+
}
|
|
8038
|
+
break;
|
|
8039
|
+
case 'final':
|
|
8040
|
+
if (data.text) {
|
|
8041
|
+
this.options.onFinal?.(data.text);
|
|
8042
|
+
}
|
|
8043
|
+
break;
|
|
8044
|
+
case 'error':
|
|
8045
|
+
this.fail(data.message ?? 'Transcription error');
|
|
8046
|
+
break;
|
|
8047
|
+
}
|
|
8048
|
+
}
|
|
8049
|
+
startAudio() {
|
|
8050
|
+
if (!this.running || this.streamer) {
|
|
8051
|
+
return;
|
|
8052
|
+
}
|
|
8053
|
+
const streamer = new _microphone_streamer__WEBPACK_IMPORTED_MODULE_1__.MicrophoneStreamer((frame)=>{
|
|
8054
|
+
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
8055
|
+
this.ws.send(frame);
|
|
8056
|
+
}
|
|
8057
|
+
});
|
|
8058
|
+
this.streamer = streamer;
|
|
8059
|
+
streamer.start().catch(()=>{
|
|
8060
|
+
this.fail('Microphone access denied');
|
|
8061
|
+
});
|
|
8062
|
+
}
|
|
8063
|
+
fail(message) {
|
|
8064
|
+
this.options.onError?.(message);
|
|
8065
|
+
this.stop();
|
|
8066
|
+
}
|
|
8067
|
+
finish() {
|
|
8068
|
+
const wasRunning = this.running;
|
|
8069
|
+
this.running = false;
|
|
8070
|
+
this.streamer?.stop();
|
|
8071
|
+
this.streamer = null;
|
|
8072
|
+
if (wasRunning) {
|
|
8073
|
+
this.options.onEnd?.();
|
|
8074
|
+
}
|
|
8075
|
+
}
|
|
8076
|
+
constructor(options){
|
|
8077
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "options", void 0);
|
|
8078
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ws", void 0);
|
|
8079
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "streamer", void 0);
|
|
8080
|
+
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "running", void 0);
|
|
8081
|
+
this.options = options;
|
|
8082
|
+
this.ws = null;
|
|
8083
|
+
this.streamer = null;
|
|
8084
|
+
this.running = false;
|
|
8085
|
+
}
|
|
8086
|
+
}
|
|
8087
|
+
|
|
8088
|
+
|
|
7562
8089
|
/***/ }),
|
|
7563
8090
|
|
|
7564
8091
|
/***/ 18549:
|