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.
Files changed (333) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.css +1 -1
  3. package/es2015/jodit.fat.min.js +8 -8
  4. package/es2015/jodit.js +38 -2
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
  7. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +596 -44
  8. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  9. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +33 -33
  10. package/es2015/plugins/autocomplete/autocomplete.css +1 -1
  11. package/es2015/plugins/autocomplete/autocomplete.js +1 -1
  12. package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
  13. package/es2015/plugins/backup/backup.css +1 -1
  14. package/es2015/plugins/backup/backup.js +1 -1
  15. package/es2015/plugins/backup/backup.min.js +1 -1
  16. package/es2015/plugins/button-generator/button-generator.css +1 -1
  17. package/es2015/plugins/button-generator/button-generator.js +1 -1
  18. package/es2015/plugins/button-generator/button-generator.min.js +1 -1
  19. package/es2015/plugins/change-case/change-case.js +1 -1
  20. package/es2015/plugins/change-case/change-case.min.js +1 -1
  21. package/es2015/plugins/color-picker/color-picker.css +1 -1
  22. package/es2015/plugins/color-picker/color-picker.js +1 -1
  23. package/es2015/plugins/color-picker/color-picker.min.js +1 -1
  24. package/es2015/plugins/emoji/emoji.css +1 -1
  25. package/es2015/plugins/emoji/emoji.js +1 -1
  26. package/es2015/plugins/emoji/emoji.min.js +1 -1
  27. package/es2015/plugins/export-docs/export-docs.js +1 -1
  28. package/es2015/plugins/export-docs/export-docs.min.js +1 -1
  29. package/es2015/plugins/finder/finder.css +1 -1
  30. package/es2015/plugins/finder/finder.js +1 -1
  31. package/es2015/plugins/finder/finder.min.js +1 -1
  32. package/es2015/plugins/google-maps/google-maps.css +1 -1
  33. package/es2015/plugins/google-maps/google-maps.js +1 -1
  34. package/es2015/plugins/google-maps/google-maps.min.js +1 -1
  35. package/es2015/plugins/google-search/google-search.js +1 -1
  36. package/es2015/plugins/google-search/google-search.min.js +1 -1
  37. package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
  38. package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
  39. package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
  40. package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
  41. package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
  42. package/es2015/plugins/keyboard/keyboard.css +1 -1
  43. package/es2015/plugins/keyboard/keyboard.js +1 -1
  44. package/es2015/plugins/keyboard/keyboard.min.js +1 -1
  45. package/es2015/plugins/mobile-view/mobile-view.js +1 -1
  46. package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
  47. package/es2015/plugins/page-break/page-break.js +1 -1
  48. package/es2015/plugins/page-break/page-break.min.js +1 -1
  49. package/es2015/plugins/paste-code/paste-code.css +1 -1
  50. package/es2015/plugins/paste-code/paste-code.js +1 -1
  51. package/es2015/plugins/paste-code/paste-code.min.js +1 -1
  52. package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
  53. package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
  54. package/es2015/plugins/show-blocks/show-blocks.js +1 -1
  55. package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
  56. package/es2015/plugins/style/style.css +1 -1
  57. package/es2015/plugins/style/style.js +1 -1
  58. package/es2015/plugins/style/style.min.js +1 -1
  59. package/es2015/plugins/templates/templates.css +1 -1
  60. package/es2015/plugins/templates/templates.js +1 -1
  61. package/es2015/plugins/templates/templates.min.js +1 -1
  62. package/es2015/plugins/todo-list/todo-list.css +1 -1
  63. package/es2015/plugins/todo-list/todo-list.js +1 -1
  64. package/es2015/plugins/todo-list/todo-list.min.js +1 -1
  65. package/es2015/plugins/translate/translate.css +1 -1
  66. package/es2015/plugins/translate/translate.js +1 -1
  67. package/es2015/plugins/translate/translate.min.js +1 -1
  68. package/es2015/plugins/tune-block/tune-block.css +1 -1
  69. package/es2015/plugins/tune-block/tune-block.js +1 -1
  70. package/es2015/plugins/tune-block/tune-block.min.js +1 -1
  71. package/es2018/jodit.fat.min.css +1 -1
  72. package/es2018/jodit.fat.min.js +6 -6
  73. package/es2018/jodit.min.js +2 -2
  74. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  75. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +38 -38
  76. package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
  77. package/es2018/plugins/backup/backup.min.js +1 -1
  78. package/es2018/plugins/button-generator/button-generator.min.js +1 -1
  79. package/es2018/plugins/change-case/change-case.min.js +1 -1
  80. package/es2018/plugins/color-picker/color-picker.min.js +1 -1
  81. package/es2018/plugins/emoji/emoji.min.js +1 -1
  82. package/es2018/plugins/export-docs/export-docs.min.js +1 -1
  83. package/es2018/plugins/finder/finder.min.js +1 -1
  84. package/es2018/plugins/google-maps/google-maps.min.js +1 -1
  85. package/es2018/plugins/google-search/google-search.min.js +1 -1
  86. package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
  87. package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
  88. package/es2018/plugins/keyboard/keyboard.min.js +1 -1
  89. package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
  90. package/es2018/plugins/page-break/page-break.min.js +1 -1
  91. package/es2018/plugins/paste-code/paste-code.min.js +1 -1
  92. package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
  93. package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
  94. package/es2018/plugins/style/style.min.js +1 -1
  95. package/es2018/plugins/templates/templates.min.js +1 -1
  96. package/es2018/plugins/todo-list/todo-list.min.js +1 -1
  97. package/es2018/plugins/translate/translate.min.js +1 -1
  98. package/es2018/plugins/tune-block/tune-block.min.js +1 -1
  99. package/es2021/jodit.css +1 -1
  100. package/es2021/jodit.fat.min.css +1 -1
  101. package/es2021/jodit.fat.min.js +8 -8
  102. package/es2021/jodit.js +38 -2
  103. package/es2021/jodit.min.js +3 -3
  104. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
  105. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +569 -42
  106. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  107. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +9 -9
  108. package/es2021/plugins/autocomplete/autocomplete.css +1 -1
  109. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  110. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  111. package/es2021/plugins/backup/backup.css +1 -1
  112. package/es2021/plugins/backup/backup.js +1 -1
  113. package/es2021/plugins/backup/backup.min.js +1 -1
  114. package/es2021/plugins/button-generator/button-generator.css +1 -1
  115. package/es2021/plugins/button-generator/button-generator.js +1 -1
  116. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  117. package/es2021/plugins/change-case/change-case.js +1 -1
  118. package/es2021/plugins/change-case/change-case.min.js +1 -1
  119. package/es2021/plugins/color-picker/color-picker.css +1 -1
  120. package/es2021/plugins/color-picker/color-picker.js +1 -1
  121. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  122. package/es2021/plugins/emoji/emoji.css +1 -1
  123. package/es2021/plugins/emoji/emoji.js +1 -1
  124. package/es2021/plugins/emoji/emoji.min.js +1 -1
  125. package/es2021/plugins/export-docs/export-docs.js +1 -1
  126. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  127. package/es2021/plugins/finder/finder.css +1 -1
  128. package/es2021/plugins/finder/finder.js +1 -1
  129. package/es2021/plugins/finder/finder.min.js +1 -1
  130. package/es2021/plugins/google-maps/google-maps.css +1 -1
  131. package/es2021/plugins/google-maps/google-maps.js +1 -1
  132. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  133. package/es2021/plugins/google-search/google-search.js +1 -1
  134. package/es2021/plugins/google-search/google-search.min.js +1 -1
  135. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  136. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  137. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  138. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  139. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  140. package/es2021/plugins/keyboard/keyboard.css +1 -1
  141. package/es2021/plugins/keyboard/keyboard.js +1 -1
  142. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  143. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  144. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  145. package/es2021/plugins/page-break/page-break.js +1 -1
  146. package/es2021/plugins/page-break/page-break.min.js +1 -1
  147. package/es2021/plugins/paste-code/paste-code.css +1 -1
  148. package/es2021/plugins/paste-code/paste-code.js +1 -1
  149. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  150. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  151. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  152. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  153. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  154. package/es2021/plugins/style/style.css +1 -1
  155. package/es2021/plugins/style/style.js +1 -1
  156. package/es2021/plugins/style/style.min.js +1 -1
  157. package/es2021/plugins/templates/templates.css +1 -1
  158. package/es2021/plugins/templates/templates.js +1 -1
  159. package/es2021/plugins/templates/templates.min.js +1 -1
  160. package/es2021/plugins/todo-list/todo-list.css +1 -1
  161. package/es2021/plugins/todo-list/todo-list.js +1 -1
  162. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  163. package/es2021/plugins/translate/translate.css +1 -1
  164. package/es2021/plugins/translate/translate.js +1 -1
  165. package/es2021/plugins/translate/translate.min.js +1 -1
  166. package/es2021/plugins/tune-block/tune-block.css +1 -1
  167. package/es2021/plugins/tune-block/tune-block.js +1 -1
  168. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  169. package/es2021.en/jodit.css +1 -1
  170. package/es2021.en/jodit.fat.min.css +1 -1
  171. package/es2021.en/jodit.fat.min.js +25 -25
  172. package/es2021.en/jodit.js +38 -2
  173. package/es2021.en/jodit.min.js +3 -3
  174. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
  175. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +569 -42
  176. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  177. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +9 -9
  178. package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
  179. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  180. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  181. package/es2021.en/plugins/backup/backup.css +1 -1
  182. package/es2021.en/plugins/backup/backup.js +1 -1
  183. package/es2021.en/plugins/backup/backup.min.js +1 -1
  184. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  185. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  186. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  187. package/es2021.en/plugins/change-case/change-case.js +1 -1
  188. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  189. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  190. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  191. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  192. package/es2021.en/plugins/emoji/emoji.css +1 -1
  193. package/es2021.en/plugins/emoji/emoji.js +1 -1
  194. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  195. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  196. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  197. package/es2021.en/plugins/finder/finder.css +1 -1
  198. package/es2021.en/plugins/finder/finder.js +1 -1
  199. package/es2021.en/plugins/finder/finder.min.js +1 -1
  200. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  201. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  202. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  203. package/es2021.en/plugins/google-search/google-search.js +1 -1
  204. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  205. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  206. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  207. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  208. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  209. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  210. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  211. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  212. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  213. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  214. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  215. package/es2021.en/plugins/page-break/page-break.js +1 -1
  216. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  217. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  218. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  219. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  220. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  221. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  222. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  223. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  224. package/es2021.en/plugins/style/style.css +1 -1
  225. package/es2021.en/plugins/style/style.js +1 -1
  226. package/es2021.en/plugins/style/style.min.js +1 -1
  227. package/es2021.en/plugins/templates/templates.css +1 -1
  228. package/es2021.en/plugins/templates/templates.js +1 -1
  229. package/es2021.en/plugins/templates/templates.min.js +1 -1
  230. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  231. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  232. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  233. package/es2021.en/plugins/translate/translate.css +1 -1
  234. package/es2021.en/plugins/translate/translate.js +1 -1
  235. package/es2021.en/plugins/translate/translate.min.js +1 -1
  236. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  237. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  238. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  239. package/es5/jodit.css +2 -2
  240. package/es5/jodit.fat.min.css +1 -1
  241. package/es5/jodit.fat.min.js +2 -2
  242. package/es5/jodit.js +38 -2
  243. package/es5/jodit.min.css +2 -2
  244. package/es5/jodit.min.js +2 -2
  245. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +34 -1
  246. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +734 -44
  247. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.css +1 -1
  248. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +2 -2
  249. package/es5/plugins/autocomplete/autocomplete.css +1 -1
  250. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  251. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  252. package/es5/plugins/backup/backup.css +1 -1
  253. package/es5/plugins/backup/backup.js +1 -1
  254. package/es5/plugins/backup/backup.min.js +1 -1
  255. package/es5/plugins/button-generator/button-generator.css +1 -1
  256. package/es5/plugins/button-generator/button-generator.js +1 -1
  257. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  258. package/es5/plugins/change-case/change-case.js +1 -1
  259. package/es5/plugins/change-case/change-case.min.js +1 -1
  260. package/es5/plugins/color-picker/color-picker.css +1 -1
  261. package/es5/plugins/color-picker/color-picker.js +1 -1
  262. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  263. package/es5/plugins/emoji/emoji.css +1 -1
  264. package/es5/plugins/emoji/emoji.js +1 -1
  265. package/es5/plugins/emoji/emoji.min.js +1 -1
  266. package/es5/plugins/export-docs/export-docs.js +1 -1
  267. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  268. package/es5/plugins/finder/finder.css +1 -1
  269. package/es5/plugins/finder/finder.js +1 -1
  270. package/es5/plugins/finder/finder.min.js +1 -1
  271. package/es5/plugins/google-maps/google-maps.css +1 -1
  272. package/es5/plugins/google-maps/google-maps.js +1 -1
  273. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  274. package/es5/plugins/google-search/google-search.js +1 -1
  275. package/es5/plugins/google-search/google-search.min.js +1 -1
  276. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  277. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  278. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  279. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  280. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  281. package/es5/plugins/keyboard/keyboard.css +1 -1
  282. package/es5/plugins/keyboard/keyboard.js +1 -1
  283. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  284. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  285. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  286. package/es5/plugins/page-break/page-break.js +1 -1
  287. package/es5/plugins/page-break/page-break.min.js +1 -1
  288. package/es5/plugins/paste-code/paste-code.css +1 -1
  289. package/es5/plugins/paste-code/paste-code.js +1 -1
  290. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  291. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  292. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  293. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  294. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  295. package/es5/plugins/style/style.css +1 -1
  296. package/es5/plugins/style/style.js +1 -1
  297. package/es5/plugins/style/style.min.js +1 -1
  298. package/es5/plugins/templates/templates.css +1 -1
  299. package/es5/plugins/templates/templates.js +1 -1
  300. package/es5/plugins/templates/templates.min.js +1 -1
  301. package/es5/plugins/todo-list/todo-list.css +1 -1
  302. package/es5/plugins/todo-list/todo-list.js +1 -1
  303. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  304. package/es5/plugins/translate/translate.css +1 -1
  305. package/es5/plugins/translate/translate.js +1 -1
  306. package/es5/plugins/translate/translate.min.js +1 -1
  307. package/es5/plugins/tune-block/tune-block.css +1 -1
  308. package/es5/plugins/tune-block/tune-block.js +1 -1
  309. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  310. package/es5/polyfills.fat.min.js +1 -1
  311. package/es5/polyfills.js +1 -1
  312. package/es5/polyfills.min.js +1 -1
  313. package/esm/plugins/ai-assistant-pro/config.js +1 -1
  314. package/esm/plugins/ai-assistant-pro/icons/microphone.svg.js +1 -0
  315. package/esm/plugins/ai-assistant-pro/interface/options.d.ts +35 -0
  316. package/esm/plugins/ai-assistant-pro/providers/jodit-ai-adapter.js +1 -1
  317. package/esm/plugins/ai-assistant-pro/ui/input-area/input-area.d.ts +20 -0
  318. package/esm/plugins/ai-assistant-pro/ui/input-area/input-area.js +2 -2
  319. package/esm/plugins/ai-assistant-pro/voice/microphone-streamer.d.ts +26 -0
  320. package/esm/plugins/ai-assistant-pro/voice/microphone-streamer.js +1 -0
  321. package/esm/plugins/ai-assistant-pro/voice/voice-engine.d.ts +36 -0
  322. package/esm/plugins/ai-assistant-pro/voice/voice-engine.js +0 -0
  323. package/esm/plugins/ai-assistant-pro/voice/voice-input-button.d.ts +85 -0
  324. package/esm/plugins/ai-assistant-pro/voice/voice-input-button.js +1 -0
  325. package/esm/plugins/ai-assistant-pro/voice/voice-transcriber.d.ts +55 -0
  326. package/esm/plugins/ai-assistant-pro/voice/voice-transcriber.js +1 -0
  327. package/package.json +1 -1
  328. package/types/plugins/ai-assistant-pro/interface/options.d.ts +35 -0
  329. package/types/plugins/ai-assistant-pro/ui/input-area/input-area.d.ts +20 -0
  330. package/types/plugins/ai-assistant-pro/voice/microphone-streamer.d.ts +26 -0
  331. package/types/plugins/ai-assistant-pro/voice/voice-engine.d.ts +36 -0
  332. package/types/plugins/ai-assistant-pro/voice/voice-input-button.d.ts +85 -0
  333. 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.32
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 _icons_send_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(99219);
1154
- /* harmony import */ var _icons_send_svg__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_icons_send_svg__WEBPACK_IMPORTED_MODULE_5__);
1155
- /* harmony import */ var _icons_shield_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63674);
1156
- /* harmony import */ var _icons_shield_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_icons_shield_svg__WEBPACK_IMPORTED_MODULE_6__);
1157
- /* harmony import */ var _icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4133);
1158
- /* harmony import */ var _icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_7__);
1159
- /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(94454);
1160
- /* harmony import */ var _tools__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(53835);
1161
- /* harmony import */ var jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6441);
1162
- /* harmony import */ var jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(12153);
1163
- /* harmony import */ var jodit_esm_plugins_ai_assistant_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(31974);
1164
- /* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(72573);
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
- jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_11__.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_5___default())).set('tool-bolt', (_icons_tool_bolt_svg__WEBPACK_IMPORTED_MODULE_7___default())).set('chevron-right', (_icons_chevron_right_svg__WEBPACK_IMPORTED_MODULE_4___default())).set('shield', (_icons_shield_svg__WEBPACK_IMPORTED_MODULE_6___default()));
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
- jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.aiAssistantPro = {
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,_tools__WEBPACK_IMPORTED_MODULE_9__.getToolNames)(),
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 marked__WEBPACK_IMPORTED_MODULE_13__.marked.parse(content, {
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,_providers__WEBPACK_IMPORTED_MODULE_8__.getAIProviderOptions)(name, config);
1328
+ return (0,_providers__WEBPACK_IMPORTED_MODULE_9__.getAIProviderOptions)(name, config);
1318
1329
  },
1319
1330
  registerAIProvider (name, factory) {
1320
- (0,_providers__WEBPACK_IMPORTED_MODULE_8__.registerAIProvider)(name, factory);
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
- */ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.controls.aiAssistantPro = {
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
- */ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.controls.aiAddContext = {
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
- */ jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.controls.aiCommandsPro = {
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: jodit_esm_plugins_ai_assistant_config__WEBPACK_IMPORTED_MODULE_12__.aiAssitentCommands,
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 = jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.tuneBlock?.popup || {};
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 (jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.tuneBlock) {
1443
- jodit_esm_config__WEBPACK_IMPORTED_MODULE_10__.Config.prototype.tuneBlock.popup = {
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
  };
@@ -3666,9 +3677,17 @@ __webpack_require__.r(__webpack_exports__);
3666
3677
  const url = config.url.replace(/\/+$/, '');
3667
3678
  const provider = config.provider ?? 'openai';
3668
3679
  const stream = config.stream !== false;
3680
+ // Voice dictation goes over a WebSocket to the transcription proxy; derive its
3681
+ // wss URL from the same host (http→ws, https→wss).
3682
+ const transcribeUrl = `${url.replace(/^http/, 'ws')}/v1/ai/transcribe`;
3669
3683
  return {
3670
3684
  apiMode: 'incremental',
3671
3685
  maxRetries: 0,
3686
+ // Enable voice dictation; the transcription model is chosen server-side
3687
+ // (like the text model). Override per-editor with the `voiceInput*` options.
3688
+ voiceInputEnabled: true,
3689
+ voiceInputUrl: transcribeUrl,
3690
+ voiceInputApiKey: config.apiKey,
3672
3691
  textAutocompleteEnabled: true,
3673
3692
  textAutocompleteApiRequest: async (query, maxSuggestions, signal)=>{
3674
3693
  const ajax = new jodit_esm_core_request_ajax__WEBPACK_IMPORTED_MODULE_1__.Ajax({
@@ -5422,11 +5441,12 @@ UIConversationList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
5422
5441
  /* harmony export */ });
5423
5442
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
5424
5443
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
5425
- /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65478);
5426
- /* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38837);
5427
- /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67510);
5428
- /* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(62843);
5429
- /* harmony import */ var jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85120);
5444
+ /* harmony import */ var _voice_voice_input_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66330);
5445
+ /* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65478);
5446
+ /* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38837);
5447
+ /* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67510);
5448
+ /* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62843);
5449
+ /* harmony import */ var jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85120);
5430
5450
  /*!
5431
5451
  * Jodit Editor PRO (https://xdsoft.net/jodit/)
5432
5452
  * See LICENSE.md in the project root for license information.
@@ -5438,7 +5458,8 @@ UIConversationList = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__
5438
5458
 
5439
5459
 
5440
5460
 
5441
- class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIElement {
5461
+
5462
+ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_5__.UIElement {
5442
5463
  className() {
5443
5464
  return 'UIInputArea';
5444
5465
  }
@@ -5446,6 +5467,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5446
5467
  this.textarea?.setParentView(view);
5447
5468
  this.sendButton?.setParentView(view);
5448
5469
  this.stopButton?.setParentView(view);
5470
+ this.voiceButton?.setParentView(view);
5449
5471
  return super.setParentView(view);
5450
5472
  }
5451
5473
  render() {
@@ -5471,19 +5493,30 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5471
5493
  this.contextBadges = this.getElm('context-badges');
5472
5494
  this.createControls();
5473
5495
  this.attachHandlers();
5496
+ this.autosize();
5497
+ }
5498
+ /** Grow the textarea to fit its content up to a max height, then scroll. */ autosize() {
5499
+ const input = this.textarea?.nativeInput;
5500
+ if (!input) {
5501
+ return;
5502
+ }
5503
+ const maxHeight = 160;
5504
+ input.style.height = 'auto';
5505
+ input.style.height = `${Math.min(input.scrollHeight, maxHeight)}px`;
5506
+ input.style.overflowY = input.scrollHeight > maxHeight ? 'auto' : 'hidden';
5474
5507
  }
5475
5508
  createControls() {
5476
5509
  const textareaWrapper = this.getElm('textarea-wrapper');
5477
5510
  const buttonsWrapper = this.getElm('buttons');
5478
5511
  // Textarea
5479
- this.textarea = new jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_6__.UITextArea(this.j, {
5512
+ this.textarea = new jodit_esm_core_ui_form_inputs_area_area__WEBPACK_IMPORTED_MODULE_7__.UITextArea(this.j, {
5480
5513
  name: 'message',
5481
5514
  placeholder: this.options.placeholderText,
5482
5515
  resizable: false
5483
5516
  });
5484
5517
  textareaWrapper.appendChild(this.textarea.container);
5485
5518
  // Send button
5486
- this.sendButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.UIButton(this.j, {
5519
+ this.sendButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.UIButton(this.j, {
5487
5520
  name: 'send-message',
5488
5521
  icon: {
5489
5522
  name: 'send'
@@ -5492,7 +5525,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5492
5525
  size: 'middle'
5493
5526
  });
5494
5527
  // Stop button
5495
- this.stopButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.UIButton(this.j, {
5528
+ this.stopButton = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.UIButton(this.j, {
5496
5529
  name: 'abort-message',
5497
5530
  icon: {
5498
5531
  name: 'cancel'
@@ -5501,12 +5534,57 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5501
5534
  size: 'middle'
5502
5535
  });
5503
5536
  this.stopButton.container.style.display = 'none';
5537
+ // Microphone (voice dictation) button — only when configured.
5538
+ if (this.options.voiceInputEnabled) {
5539
+ this.voiceButton = new _voice_voice_input_button__WEBPACK_IMPORTED_MODULE_2__.VoiceInputButton(this.j, {
5540
+ url: this.options.voiceInputUrl,
5541
+ apiKey: this.options.voiceInputApiKey,
5542
+ defaultModel: this.options.voiceInputDefaultModel,
5543
+ language: this.options.voiceInputLanguage,
5544
+ silenceTimeoutMs: this.options.voiceInputSilenceTimeoutMs,
5545
+ autoSendSilenceMs: this.options.voiceInputAutoSendSilenceMs,
5546
+ api: this.options.voiceInputApi
5547
+ }, {
5548
+ getValue: ()=>this.textarea?.nativeInput.value ?? '',
5549
+ setValue: (value, caret)=>{
5550
+ if (!this.textarea) {
5551
+ return;
5552
+ }
5553
+ this.textarea.value = value;
5554
+ if (caret !== undefined) {
5555
+ const input = this.textarea.nativeInput;
5556
+ input.selectionStart = caret;
5557
+ input.selectionEnd = caret;
5558
+ }
5559
+ this.autosize();
5560
+ },
5561
+ getSelection: ()=>{
5562
+ const input = this.textarea?.nativeInput;
5563
+ if (!input) {
5564
+ return {
5565
+ start: 0,
5566
+ end: 0
5567
+ };
5568
+ }
5569
+ const len = input.value.length;
5570
+ return {
5571
+ start: input.selectionStart ?? len,
5572
+ end: input.selectionEnd ?? len
5573
+ };
5574
+ },
5575
+ focus: ()=>this.focus(),
5576
+ send: ()=>this.onSend()
5577
+ });
5578
+ buttonsWrapper.appendChild(this.voiceButton.container);
5579
+ }
5504
5580
  buttonsWrapper.appendChild(this.sendButton.container);
5505
5581
  buttonsWrapper.appendChild(this.stopButton.container);
5506
5582
  }
5507
5583
  attachHandlers() {
5508
5584
  this.j.e.on(this.sendButton, 'click', this.onSend);
5509
5585
  this.j.e.on(this.stopButton, 'click', this.onStop);
5586
+ // Auto-grow the textarea as the user types.
5587
+ this.j.e.on(this.textarea.nativeInput, 'input', ()=>this.autosize());
5510
5588
  // Handle keyboard shortcuts
5511
5589
  this.j.e.on(this.textarea.nativeInput, 'keydown', (e)=>{
5512
5590
  const { sendShortcut, sendOnEnter } = this.options;
@@ -5547,6 +5625,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5547
5625
  this.j.e.fire('sendMessage.ai-assistant-pro', message);
5548
5626
  if (!this.textarea) return;
5549
5627
  this.textarea.value = '';
5628
+ this.autosize();
5550
5629
  this.textarea.nativeInput.focus();
5551
5630
  }
5552
5631
  onStop() {
@@ -5586,7 +5665,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5586
5665
  setLoading(loading) {
5587
5666
  this.isLoading = loading;
5588
5667
  const { sendButton, stopButton, textarea } = this;
5589
- (0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(sendButton && stopButton && textarea, 'Buttons must be initialized');
5668
+ (0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_4__.assert)(sendButton && stopButton && textarea, 'Buttons must be initialized');
5590
5669
  textarea.setMod('disabled', loading);
5591
5670
  sendButton.setMod('disabled', loading);
5592
5671
  this.setMod('loading', loading);
@@ -5604,6 +5683,7 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5604
5683
  setValue(value) {
5605
5684
  if (this.textarea) {
5606
5685
  this.textarea.value = value;
5686
+ this.autosize();
5607
5687
  }
5608
5688
  }
5609
5689
  getValue() {
@@ -5613,26 +5693,27 @@ class UIInputArea extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIEleme
5613
5693
  this.textarea?.destruct();
5614
5694
  this.sendButton?.destruct();
5615
5695
  this.stopButton?.destruct();
5696
+ this.voiceButton?.destruct();
5616
5697
  super.destruct();
5617
5698
  }
5618
5699
  constructor(view, options){
5619
- 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;
5700
+ 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;
5620
5701
  }
5621
5702
  }
5622
5703
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
5623
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)('input-row:click')
5704
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)('input-row:click')
5624
5705
  ], UIInputArea.prototype, "onInputRowClick", null);
5625
5706
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
5626
- (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_2__.hook)('ready')
5707
+ (0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.hook)('ready')
5627
5708
  ], UIInputArea.prototype, "afterRender", null);
5628
5709
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
5629
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
5710
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
5630
5711
  ], UIInputArea.prototype, "onSend", null);
5631
5712
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
5632
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
5713
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
5633
5714
  ], UIInputArea.prototype, "onStop", null);
5634
5715
  UIInputArea = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
5635
- jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_2__.component
5716
+ jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_3__.component
5636
5717
  ], UIInputArea);
5637
5718
 
5638
5719
 
@@ -7464,6 +7545,452 @@ UIWelcomeScreen = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__dec
7464
7545
  ], UIWelcomeScreen);
7465
7546
 
7466
7547
 
7548
+ /***/ }),
7549
+
7550
+ /***/ 88710:
7551
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7552
+
7553
+ "use strict";
7554
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7555
+ /* harmony export */ MicrophoneStreamer: function() { return /* binding */ MicrophoneStreamer; }
7556
+ /* harmony export */ });
7557
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
7558
+
7559
+ /*!
7560
+ * Jodit Editor PRO (https://xdsoft.net/jodit/)
7561
+ * See LICENSE.md in the project root for license information.
7562
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
7563
+ */ /**
7564
+ * Captures the microphone and emits mono PCM16 @ 24 kHz audio frames — the format
7565
+ * the transcription proxy forwards to the realtime provider. Downsamples from the
7566
+ * browser's native sample rate. Uses only global browser APIs (`getUserMedia`,
7567
+ * `AudioContext`) so it can be stubbed in tests.
7568
+ *
7569
+ * @module plugins/ai-assistant-pro/voice
7570
+ */ const TARGET_SAMPLE_RATE = 24000;
7571
+ function floatTo16BitPCM(input) {
7572
+ const output = new Int16Array(input.length);
7573
+ for(let i = 0; i < input.length; i++){
7574
+ const sample = Math.max(-1, Math.min(1, input[i]));
7575
+ output[i] = sample < 0 ? sample * 0x8000 : sample * 0x7fff;
7576
+ }
7577
+ return output;
7578
+ }
7579
+ function downsample(input, inputRate, outputRate) {
7580
+ if (outputRate >= inputRate) {
7581
+ return input;
7582
+ }
7583
+ const ratio = inputRate / outputRate;
7584
+ const newLength = Math.round(input.length / ratio);
7585
+ const result = new Float32Array(newLength);
7586
+ for(let i = 0; i < newLength; i++){
7587
+ result[i] = input[Math.min(Math.round(i * ratio), input.length - 1)];
7588
+ }
7589
+ return result;
7590
+ }
7591
+ class MicrophoneStreamer {
7592
+ /**
7593
+ * Request the microphone and start streaming audio frames. Rejects if access
7594
+ * is denied or the audio graph cannot start.
7595
+ */ async start() {
7596
+ this.running = true;
7597
+ this.stream = await navigator.mediaDevices.getUserMedia({
7598
+ audio: {
7599
+ channelCount: 1,
7600
+ echoCancellation: true,
7601
+ noiseSuppression: true
7602
+ }
7603
+ });
7604
+ if (!this.running) {
7605
+ this.stopTracks();
7606
+ return;
7607
+ }
7608
+ const ctx = new AudioContext();
7609
+ // Browsers often start the context suspended (autoplay policy); without
7610
+ // resuming, onaudioprocess never fires and no audio is sent.
7611
+ if (ctx.state === 'suspended') {
7612
+ await ctx.resume();
7613
+ }
7614
+ if (!this.running) {
7615
+ void ctx.close();
7616
+ return;
7617
+ }
7618
+ const source = ctx.createMediaStreamSource(this.stream);
7619
+ const processor = ctx.createScriptProcessor(4096, 1, 1);
7620
+ const zeroGain = ctx.createGain();
7621
+ zeroGain.gain.value = 0; // keep the graph running without playback
7622
+ processor.onaudioprocess = (e)=>{
7623
+ if (!this.running) {
7624
+ return;
7625
+ }
7626
+ const input = e.inputBuffer.getChannelData(0);
7627
+ const pcm = floatTo16BitPCM(downsample(input, e.inputBuffer.sampleRate, TARGET_SAMPLE_RATE));
7628
+ // Send the typed-array view directly — its bytes are the PCM16 frame.
7629
+ this.onFrame(pcm);
7630
+ };
7631
+ source.connect(processor);
7632
+ processor.connect(zeroGain);
7633
+ zeroGain.connect(ctx.destination);
7634
+ this.audioCtx = ctx;
7635
+ this.source = source;
7636
+ this.processor = processor;
7637
+ this.zeroGain = zeroGain;
7638
+ }
7639
+ /** Stop streaming and release the microphone and audio graph. */ stop() {
7640
+ this.running = false;
7641
+ if (this.processor) {
7642
+ this.processor.onaudioprocess = null;
7643
+ this.processor.disconnect();
7644
+ this.processor = null;
7645
+ }
7646
+ this.zeroGain?.disconnect();
7647
+ this.source?.disconnect();
7648
+ this.zeroGain = null;
7649
+ this.source = null;
7650
+ if (this.audioCtx) {
7651
+ void this.audioCtx.close();
7652
+ this.audioCtx = null;
7653
+ }
7654
+ this.stopTracks();
7655
+ }
7656
+ stopTracks() {
7657
+ this.stream?.getTracks().forEach((track)=>track.stop());
7658
+ this.stream = null;
7659
+ }
7660
+ /**
7661
+ * @param onFrame - receives each binary PCM16 audio frame to send upstream.
7662
+ */ constructor(onFrame){
7663
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onFrame", void 0);
7664
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "stream", void 0);
7665
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "audioCtx", void 0);
7666
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "processor", void 0);
7667
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "source", void 0);
7668
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "zeroGain", void 0);
7669
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "running", void 0);
7670
+ this.onFrame = onFrame;
7671
+ this.stream = null;
7672
+ this.audioCtx = null;
7673
+ this.processor = null;
7674
+ this.source = null;
7675
+ this.zeroGain = null;
7676
+ this.running = false;
7677
+ }
7678
+ }
7679
+
7680
+
7681
+ /***/ }),
7682
+
7683
+ /***/ 66330:
7684
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7685
+
7686
+ "use strict";
7687
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7688
+ /* harmony export */ VoiceInputButton: function() { return /* binding */ VoiceInputButton; }
7689
+ /* harmony export */ });
7690
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
7691
+ /* harmony import */ var _voice_transcriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20466);
7692
+ /* harmony import */ var jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62843);
7693
+ /*!
7694
+ * Jodit Editor PRO (https://xdsoft.net/jodit/)
7695
+ * See LICENSE.md in the project root for license information.
7696
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
7697
+ */
7698
+
7699
+
7700
+ const ACTIVE_CLASS = 'jodit-ai-voice-active';
7701
+ /**
7702
+ * The microphone button for the assistant input area. Toggles a
7703
+ * `VoiceTranscriber` session and writes interim/final transcripts into the prompt
7704
+ * (interim text is previewed; final phrases are appended).
7705
+ */ class VoiceInputButton {
7706
+ get container() {
7707
+ return this.button.container;
7708
+ }
7709
+ setParentView(view) {
7710
+ this.button.setParentView(view);
7711
+ }
7712
+ start() {
7713
+ const callbacks = {
7714
+ onInterim: (text)=>{
7715
+ // New speech — cancel any pending hands-free send.
7716
+ this.clearAutoSend();
7717
+ this.insertPhrase(text);
7718
+ },
7719
+ onFinal: (text)=>{
7720
+ this.insertPhrase(text);
7721
+ this.phraseActive = false;
7722
+ this.scheduleAutoSend();
7723
+ },
7724
+ onError: ()=>this.reset(),
7725
+ onEnd: ()=>this.reset()
7726
+ };
7727
+ let engine;
7728
+ if (this.config.api) {
7729
+ engine = this.config.api(callbacks);
7730
+ } else {
7731
+ const { url, apiKey } = this.config;
7732
+ if (!url || !apiKey) {
7733
+ return;
7734
+ }
7735
+ engine = new _voice_transcriber__WEBPACK_IMPORTED_MODULE_1__.VoiceTranscriber({
7736
+ url,
7737
+ apiKey,
7738
+ model: this.config.defaultModel,
7739
+ language: this.config.language,
7740
+ silenceMs: this.config.silenceTimeoutMs,
7741
+ ...callbacks
7742
+ });
7743
+ }
7744
+ this.phraseActive = false;
7745
+ this.engine = engine;
7746
+ this.listening = true;
7747
+ this.setActive(true);
7748
+ engine.start();
7749
+ }
7750
+ reset() {
7751
+ this.clearAutoSend();
7752
+ this.setActive(false);
7753
+ this.phraseActive = false;
7754
+ this.listening = false;
7755
+ this.engine = null;
7756
+ this.io.focus();
7757
+ }
7758
+ /**
7759
+ * Schedule a hands-free auto-send after `autoSendSilenceMs` of no new speech.
7760
+ * No-op when the option is unset/null.
7761
+ */ scheduleAutoSend() {
7762
+ this.clearAutoSend();
7763
+ const ms = this.config.autoSendSilenceMs;
7764
+ if (ms == null) {
7765
+ return;
7766
+ }
7767
+ this.autoSendTimer = this.jodit.async.setTimeout(()=>{
7768
+ this.autoSendTimer = 0;
7769
+ this.io.send();
7770
+ }, ms);
7771
+ }
7772
+ clearAutoSend() {
7773
+ if (this.autoSendTimer) {
7774
+ this.jodit.async.clearTimeout(this.autoSendTimer);
7775
+ this.autoSendTimer = 0;
7776
+ }
7777
+ }
7778
+ setActive(active) {
7779
+ this.button.container.classList.toggle(ACTIVE_CLASS, active);
7780
+ }
7781
+ /**
7782
+ * Insert the current phrase at the caret. The text around the caret (or
7783
+ * selection) is captured once at the start of each phrase from the live input,
7784
+ * so dictation lands where the cursor is, replaces any selection, and respects
7785
+ * manual edits / sends between phrases. Subsequent interims of the same phrase
7786
+ * replace its preview rather than accumulating.
7787
+ */ insertPhrase(segment) {
7788
+ if (!this.phraseActive) {
7789
+ this.phraseActive = true;
7790
+ const { start, end } = this.io.getSelection();
7791
+ const value = this.io.getValue();
7792
+ this.before = value.slice(0, start);
7793
+ this.after = value.slice(end);
7794
+ }
7795
+ // Avoid gluing words: add a separating space when inserting mid-text.
7796
+ const needsSpace = this.before.length > 0 && !/\s$/.test(this.before);
7797
+ const inserted = (needsSpace ? ' ' : '') + segment;
7798
+ const caret = this.before.length + inserted.length;
7799
+ this.io.setValue(this.before + inserted + this.after, caret);
7800
+ }
7801
+ destruct() {
7802
+ this.clearAutoSend();
7803
+ this.jodit.e.off('sendMessage.ai-assistant-pro', this.onPromptSent);
7804
+ this.engine?.stop();
7805
+ this.engine = null;
7806
+ this.button.destruct();
7807
+ }
7808
+ constructor(jodit, config, io){
7809
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "jodit", void 0);
7810
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "config", void 0);
7811
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "io", void 0);
7812
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "button", void 0);
7813
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "engine", void 0);
7814
+ /** Whether a recognition session is active. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "listening", void 0);
7815
+ /** 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);
7816
+ /** 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);
7817
+ /** Prompt text after the caret (or selection), captured at phrase start. */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "after", void 0);
7818
+ /** Pending hands-free auto-send timer id (0 = none). */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "autoSendTimer", void 0);
7819
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onPromptSent", void 0);
7820
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "toggle", void 0);
7821
+ this.jodit = jodit;
7822
+ this.config = config;
7823
+ this.io = io;
7824
+ this.engine = null;
7825
+ this.listening = false;
7826
+ this.phraseActive = false;
7827
+ this.before = '';
7828
+ this.after = '';
7829
+ this.autoSendTimer = 0;
7830
+ this.onPromptSent = ()=>{
7831
+ this.phraseActive = false;
7832
+ };
7833
+ this.toggle = ()=>{
7834
+ if (this.listening) {
7835
+ this.engine?.stop();
7836
+ // Reset the UI immediately on manual stop (a close that we initiate
7837
+ // does not always re-emit `onEnd`).
7838
+ this.reset();
7839
+ return;
7840
+ }
7841
+ this.start();
7842
+ };
7843
+ this.button = new jodit_esm_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.UIButton(jodit, {
7844
+ name: 'voice-input',
7845
+ icon: {
7846
+ name: 'microphone'
7847
+ },
7848
+ variant: 'initial',
7849
+ size: 'middle'
7850
+ });
7851
+ this.button.container.setAttribute('title', 'Dictate');
7852
+ this.button.container.setAttribute('data-ref', 'voiceInputButton');
7853
+ this.jodit.e.on(this.button, 'click', this.toggle);
7854
+ // Sending clears the prompt; end the current phrase so the next one
7855
+ // re-captures its baseline from the (now empty) input rather than
7856
+ // re-inserting the text that was just sent.
7857
+ this.jodit.e.on('sendMessage.ai-assistant-pro', this.onPromptSent);
7858
+ }
7859
+ }
7860
+
7861
+
7862
+ /***/ }),
7863
+
7864
+ /***/ 20466:
7865
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7866
+
7867
+ "use strict";
7868
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7869
+ /* harmony export */ VoiceTranscriber: function() { return /* binding */ VoiceTranscriber; }
7870
+ /* harmony export */ });
7871
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
7872
+ /* harmony import */ var _microphone_streamer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88710);
7873
+ /*!
7874
+ * Jodit Editor PRO (https://xdsoft.net/jodit/)
7875
+ * See LICENSE.md in the project root for license information.
7876
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
7877
+ */
7878
+
7879
+ class VoiceTranscriber {
7880
+ get isActive() {
7881
+ return this.running;
7882
+ }
7883
+ /** Open the socket and begin a transcription session. */ start() {
7884
+ if (this.running) {
7885
+ return;
7886
+ }
7887
+ this.running = true;
7888
+ let url;
7889
+ try {
7890
+ const u = new URL(this.options.url);
7891
+ u.searchParams.set('key', this.options.apiKey);
7892
+ if (this.options.model) {
7893
+ u.searchParams.set('model', this.options.model);
7894
+ }
7895
+ if (this.options.language) {
7896
+ u.searchParams.set('language', this.options.language);
7897
+ }
7898
+ if (this.options.silenceMs !== undefined) {
7899
+ u.searchParams.set('silence', String(this.options.silenceMs));
7900
+ }
7901
+ url = u.toString();
7902
+ } catch {
7903
+ this.fail('Invalid transcription URL');
7904
+ return;
7905
+ }
7906
+ const ws = new WebSocket(url);
7907
+ ws.binaryType = 'arraybuffer';
7908
+ this.ws = ws;
7909
+ ws.addEventListener('message', (event)=>this.onMessage(event));
7910
+ ws.addEventListener('error', ()=>this.fail('Transcription connection error'));
7911
+ ws.addEventListener('close', ()=>this.finish());
7912
+ }
7913
+ /** Stop the session and release the microphone. */ stop() {
7914
+ if (!this.running) {
7915
+ return;
7916
+ }
7917
+ this.running = false;
7918
+ this.streamer?.stop();
7919
+ this.streamer = null;
7920
+ if (this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING)) {
7921
+ this.ws.close();
7922
+ }
7923
+ }
7924
+ onMessage(event) {
7925
+ if (typeof event.data !== 'string') {
7926
+ return;
7927
+ }
7928
+ let data;
7929
+ try {
7930
+ data = JSON.parse(event.data);
7931
+ } catch {
7932
+ return;
7933
+ }
7934
+ switch(data.type){
7935
+ case 'ready':
7936
+ this.options.onReady?.();
7937
+ this.startAudio();
7938
+ break;
7939
+ case 'delta':
7940
+ if (data.text) {
7941
+ this.options.onInterim?.(data.text);
7942
+ }
7943
+ break;
7944
+ case 'final':
7945
+ if (data.text) {
7946
+ this.options.onFinal?.(data.text);
7947
+ }
7948
+ break;
7949
+ case 'error':
7950
+ this.fail(data.message ?? 'Transcription error');
7951
+ break;
7952
+ }
7953
+ }
7954
+ startAudio() {
7955
+ if (!this.running || this.streamer) {
7956
+ return;
7957
+ }
7958
+ const streamer = new _microphone_streamer__WEBPACK_IMPORTED_MODULE_1__.MicrophoneStreamer((frame)=>{
7959
+ if (this.ws?.readyState === WebSocket.OPEN) {
7960
+ this.ws.send(frame);
7961
+ }
7962
+ });
7963
+ this.streamer = streamer;
7964
+ streamer.start().catch(()=>{
7965
+ this.fail('Microphone access denied');
7966
+ });
7967
+ }
7968
+ fail(message) {
7969
+ this.options.onError?.(message);
7970
+ this.stop();
7971
+ }
7972
+ finish() {
7973
+ const wasRunning = this.running;
7974
+ this.running = false;
7975
+ this.streamer?.stop();
7976
+ this.streamer = null;
7977
+ if (wasRunning) {
7978
+ this.options.onEnd?.();
7979
+ }
7980
+ }
7981
+ constructor(options){
7982
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "options", void 0);
7983
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ws", void 0);
7984
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "streamer", void 0);
7985
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "running", void 0);
7986
+ this.options = options;
7987
+ this.ws = null;
7988
+ this.streamer = null;
7989
+ this.running = false;
7990
+ }
7991
+ }
7992
+
7993
+
7467
7994
  /***/ }),
7468
7995
 
7469
7996
  /***/ 18549: