jodit-pro 4.11.26 → 4.11.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/CHANGELOG.md +115 -1
  2. package/es2015/jodit.css +32 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +6 -6
  5. package/es2015/jodit.js +39 -9
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +3 -3
  8. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  9. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +105 -3
  10. package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +4 -4
  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 +58 -7
  58. package/es2015/plugins/style/style.min.js +2 -2
  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.css +1 -1
  74. package/es2018/jodit.min.js +3 -3
  75. package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +23 -23
  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 +2 -2
  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 +32 -1
  100. package/es2021/jodit.fat.min.css +1 -1
  101. package/es2021/jodit.fat.min.js +6 -6
  102. package/es2021/jodit.js +39 -8
  103. package/es2021/jodit.min.css +1 -1
  104. package/es2021/jodit.min.js +3 -3
  105. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  106. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +105 -3
  107. package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +5 -5
  108. package/es2021/plugins/autocomplete/autocomplete.js +1 -1
  109. package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
  110. package/es2021/plugins/backup/backup.css +1 -1
  111. package/es2021/plugins/backup/backup.js +1 -1
  112. package/es2021/plugins/backup/backup.min.js +1 -1
  113. package/es2021/plugins/button-generator/button-generator.css +1 -1
  114. package/es2021/plugins/button-generator/button-generator.js +1 -1
  115. package/es2021/plugins/button-generator/button-generator.min.js +1 -1
  116. package/es2021/plugins/change-case/change-case.js +1 -1
  117. package/es2021/plugins/change-case/change-case.min.js +1 -1
  118. package/es2021/plugins/color-picker/color-picker.css +1 -1
  119. package/es2021/plugins/color-picker/color-picker.js +1 -1
  120. package/es2021/plugins/color-picker/color-picker.min.js +1 -1
  121. package/es2021/plugins/emoji/emoji.css +1 -1
  122. package/es2021/plugins/emoji/emoji.js +1 -1
  123. package/es2021/plugins/emoji/emoji.min.js +1 -1
  124. package/es2021/plugins/export-docs/export-docs.js +1 -1
  125. package/es2021/plugins/export-docs/export-docs.min.js +1 -1
  126. package/es2021/plugins/finder/finder.css +1 -1
  127. package/es2021/plugins/finder/finder.js +1 -1
  128. package/es2021/plugins/finder/finder.min.js +1 -1
  129. package/es2021/plugins/google-maps/google-maps.css +1 -1
  130. package/es2021/plugins/google-maps/google-maps.js +1 -1
  131. package/es2021/plugins/google-maps/google-maps.min.js +1 -1
  132. package/es2021/plugins/google-search/google-search.js +1 -1
  133. package/es2021/plugins/google-search/google-search.min.js +1 -1
  134. package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
  135. package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
  136. package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
  137. package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
  138. package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
  139. package/es2021/plugins/keyboard/keyboard.css +1 -1
  140. package/es2021/plugins/keyboard/keyboard.js +1 -1
  141. package/es2021/plugins/keyboard/keyboard.min.js +1 -1
  142. package/es2021/plugins/mobile-view/mobile-view.js +1 -1
  143. package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
  144. package/es2021/plugins/page-break/page-break.js +1 -1
  145. package/es2021/plugins/page-break/page-break.min.js +1 -1
  146. package/es2021/plugins/paste-code/paste-code.css +1 -1
  147. package/es2021/plugins/paste-code/paste-code.js +1 -1
  148. package/es2021/plugins/paste-code/paste-code.min.js +1 -1
  149. package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
  150. package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
  151. package/es2021/plugins/show-blocks/show-blocks.js +1 -1
  152. package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
  153. package/es2021/plugins/style/style.css +1 -1
  154. package/es2021/plugins/style/style.js +56 -5
  155. package/es2021/plugins/style/style.min.js +2 -2
  156. package/es2021/plugins/templates/templates.css +1 -1
  157. package/es2021/plugins/templates/templates.js +1 -1
  158. package/es2021/plugins/templates/templates.min.js +1 -1
  159. package/es2021/plugins/todo-list/todo-list.css +1 -1
  160. package/es2021/plugins/todo-list/todo-list.js +1 -1
  161. package/es2021/plugins/todo-list/todo-list.min.js +1 -1
  162. package/es2021/plugins/translate/translate.css +1 -1
  163. package/es2021/plugins/translate/translate.js +1 -1
  164. package/es2021/plugins/translate/translate.min.js +1 -1
  165. package/es2021/plugins/tune-block/tune-block.css +1 -1
  166. package/es2021/plugins/tune-block/tune-block.js +1 -1
  167. package/es2021/plugins/tune-block/tune-block.min.js +1 -1
  168. package/es2021.en/jodit.css +32 -1
  169. package/es2021.en/jodit.fat.min.css +1 -1
  170. package/es2021.en/jodit.fat.min.js +6 -6
  171. package/es2021.en/jodit.js +39 -8
  172. package/es2021.en/jodit.min.css +1 -1
  173. package/es2021.en/jodit.min.js +3 -3
  174. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  175. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +105 -3
  176. package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +26 -26
  177. package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
  178. package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
  179. package/es2021.en/plugins/backup/backup.css +1 -1
  180. package/es2021.en/plugins/backup/backup.js +1 -1
  181. package/es2021.en/plugins/backup/backup.min.js +1 -1
  182. package/es2021.en/plugins/button-generator/button-generator.css +1 -1
  183. package/es2021.en/plugins/button-generator/button-generator.js +1 -1
  184. package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
  185. package/es2021.en/plugins/change-case/change-case.js +1 -1
  186. package/es2021.en/plugins/change-case/change-case.min.js +1 -1
  187. package/es2021.en/plugins/color-picker/color-picker.css +1 -1
  188. package/es2021.en/plugins/color-picker/color-picker.js +1 -1
  189. package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
  190. package/es2021.en/plugins/emoji/emoji.css +1 -1
  191. package/es2021.en/plugins/emoji/emoji.js +1 -1
  192. package/es2021.en/plugins/emoji/emoji.min.js +1 -1
  193. package/es2021.en/plugins/export-docs/export-docs.js +1 -1
  194. package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
  195. package/es2021.en/plugins/finder/finder.css +1 -1
  196. package/es2021.en/plugins/finder/finder.js +1 -1
  197. package/es2021.en/plugins/finder/finder.min.js +1 -1
  198. package/es2021.en/plugins/google-maps/google-maps.css +1 -1
  199. package/es2021.en/plugins/google-maps/google-maps.js +1 -1
  200. package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
  201. package/es2021.en/plugins/google-search/google-search.js +1 -1
  202. package/es2021.en/plugins/google-search/google-search.min.js +1 -1
  203. package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
  204. package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
  205. package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
  206. package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
  207. package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
  208. package/es2021.en/plugins/keyboard/keyboard.css +1 -1
  209. package/es2021.en/plugins/keyboard/keyboard.js +1 -1
  210. package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
  211. package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
  212. package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
  213. package/es2021.en/plugins/page-break/page-break.js +1 -1
  214. package/es2021.en/plugins/page-break/page-break.min.js +1 -1
  215. package/es2021.en/plugins/paste-code/paste-code.css +1 -1
  216. package/es2021.en/plugins/paste-code/paste-code.js +1 -1
  217. package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
  218. package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
  219. package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
  220. package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
  221. package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
  222. package/es2021.en/plugins/style/style.css +1 -1
  223. package/es2021.en/plugins/style/style.js +56 -5
  224. package/es2021.en/plugins/style/style.min.js +2 -2
  225. package/es2021.en/plugins/templates/templates.css +1 -1
  226. package/es2021.en/plugins/templates/templates.js +1 -1
  227. package/es2021.en/plugins/templates/templates.min.js +1 -1
  228. package/es2021.en/plugins/todo-list/todo-list.css +1 -1
  229. package/es2021.en/plugins/todo-list/todo-list.js +1 -1
  230. package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
  231. package/es2021.en/plugins/translate/translate.css +1 -1
  232. package/es2021.en/plugins/translate/translate.js +1 -1
  233. package/es2021.en/plugins/translate/translate.min.js +1 -1
  234. package/es2021.en/plugins/tune-block/tune-block.css +1 -1
  235. package/es2021.en/plugins/tune-block/tune-block.js +1 -1
  236. package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
  237. package/es5/jodit.css +37 -2
  238. package/es5/jodit.fat.min.css +1 -1
  239. package/es5/jodit.fat.min.js +2 -2
  240. package/es5/jodit.js +43 -9
  241. package/es5/jodit.min.css +3 -3
  242. package/es5/jodit.min.js +2 -2
  243. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
  244. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +169 -3
  245. package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +2 -2
  246. package/es5/plugins/autocomplete/autocomplete.js +1 -1
  247. package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
  248. package/es5/plugins/backup/backup.css +1 -1
  249. package/es5/plugins/backup/backup.js +1 -1
  250. package/es5/plugins/backup/backup.min.js +1 -1
  251. package/es5/plugins/button-generator/button-generator.css +1 -1
  252. package/es5/plugins/button-generator/button-generator.js +1 -1
  253. package/es5/plugins/button-generator/button-generator.min.js +1 -1
  254. package/es5/plugins/change-case/change-case.js +1 -1
  255. package/es5/plugins/change-case/change-case.min.js +1 -1
  256. package/es5/plugins/color-picker/color-picker.css +1 -1
  257. package/es5/plugins/color-picker/color-picker.js +1 -1
  258. package/es5/plugins/color-picker/color-picker.min.js +1 -1
  259. package/es5/plugins/emoji/emoji.css +1 -1
  260. package/es5/plugins/emoji/emoji.js +1 -1
  261. package/es5/plugins/emoji/emoji.min.js +1 -1
  262. package/es5/plugins/export-docs/export-docs.js +1 -1
  263. package/es5/plugins/export-docs/export-docs.min.js +1 -1
  264. package/es5/plugins/finder/finder.css +1 -1
  265. package/es5/plugins/finder/finder.js +1 -1
  266. package/es5/plugins/finder/finder.min.js +1 -1
  267. package/es5/plugins/google-maps/google-maps.css +1 -1
  268. package/es5/plugins/google-maps/google-maps.js +1 -1
  269. package/es5/plugins/google-maps/google-maps.min.js +1 -1
  270. package/es5/plugins/google-search/google-search.js +1 -1
  271. package/es5/plugins/google-search/google-search.min.js +1 -1
  272. package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
  273. package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
  274. package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
  275. package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
  276. package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
  277. package/es5/plugins/keyboard/keyboard.css +1 -1
  278. package/es5/plugins/keyboard/keyboard.js +1 -1
  279. package/es5/plugins/keyboard/keyboard.min.js +1 -1
  280. package/es5/plugins/mobile-view/mobile-view.js +1 -1
  281. package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
  282. package/es5/plugins/page-break/page-break.js +1 -1
  283. package/es5/plugins/page-break/page-break.min.js +1 -1
  284. package/es5/plugins/paste-code/paste-code.css +1 -1
  285. package/es5/plugins/paste-code/paste-code.js +1 -1
  286. package/es5/plugins/paste-code/paste-code.min.js +1 -1
  287. package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
  288. package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
  289. package/es5/plugins/show-blocks/show-blocks.js +1 -1
  290. package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
  291. package/es5/plugins/style/style.css +1 -1
  292. package/es5/plugins/style/style.js +114 -25
  293. package/es5/plugins/style/style.min.js +2 -2
  294. package/es5/plugins/templates/templates.css +1 -1
  295. package/es5/plugins/templates/templates.js +1 -1
  296. package/es5/plugins/templates/templates.min.js +1 -1
  297. package/es5/plugins/todo-list/todo-list.css +1 -1
  298. package/es5/plugins/todo-list/todo-list.js +1 -1
  299. package/es5/plugins/todo-list/todo-list.min.js +1 -1
  300. package/es5/plugins/translate/translate.css +1 -1
  301. package/es5/plugins/translate/translate.js +1 -1
  302. package/es5/plugins/translate/translate.min.js +1 -1
  303. package/es5/plugins/tune-block/tune-block.css +1 -1
  304. package/es5/plugins/tune-block/tune-block.js +1 -1
  305. package/es5/plugins/tune-block/tune-block.min.js +1 -1
  306. package/es5/polyfills.fat.min.js +1 -1
  307. package/es5/polyfills.js +1 -1
  308. package/es5/polyfills.min.js +1 -1
  309. package/esm/config.d.ts +2 -0
  310. package/esm/plugins/ai-assistant-pro/ai-assistant-pro.d.ts +3 -0
  311. package/esm/plugins/ai-assistant-pro/ai-assistant-pro.js +2 -2
  312. package/esm/plugins/ai-assistant-pro/config.js +1 -1
  313. package/esm/plugins/ai-assistant-pro/interface/options.d.ts +40 -0
  314. package/esm/plugins/ai-assistant-pro/providers/jodit-ai-adapter.js +1 -1
  315. package/esm/plugins/autocomplete/autocomplete.js +1 -1
  316. package/esm/plugins/autocomplete/config.d.ts +2 -1
  317. package/esm/plugins/autocomplete/config.js +1 -1
  318. package/esm/plugins/autocomplete/interface.d.ts +1 -0
  319. package/esm/plugins/autocomplete/ui/autocomplete.d.ts +3 -1
  320. package/esm/plugins/autocomplete/ui/autocomplete.js +1 -1
  321. package/esm/plugins/autocomplete/ui/item.d.ts +2 -0
  322. package/esm/plugins/autocomplete/ui/item.js +1 -1
  323. package/esm/plugins/style/helpers/apply-style.js +1 -1
  324. package/esm/plugins/style/helpers/detect-active-style.js +1 -1
  325. package/esm/plugins/style/interface.d.ts +2 -1
  326. package/esm/plugins/style/ui/style-popup.js +1 -1
  327. package/package.json +1 -1
  328. package/types/config.d.ts +2 -0
  329. package/types/plugins/ai-assistant-pro/ai-assistant-pro.d.ts +3 -0
  330. package/types/plugins/ai-assistant-pro/interface/options.d.ts +40 -0
  331. package/types/plugins/autocomplete/config.d.ts +2 -1
  332. package/types/plugins/autocomplete/interface.d.ts +1 -0
  333. package/types/plugins/autocomplete/ui/autocomplete.d.ts +3 -1
  334. package/types/plugins/autocomplete/ui/item.d.ts +2 -0
  335. package/types/plugins/style/interface.d.ts +2 -1
@@ -395,6 +395,46 @@ export interface IAIAssistantProOptions {
395
395
  * @default true
396
396
  */
397
397
  allowEditTheme: boolean;
398
+ /**
399
+ * Enable AI text autocomplete.
400
+ * Requires `textAutocompleteApiRequest` to be set.
401
+ * @default false
402
+ */
403
+ textAutocompleteEnabled: boolean;
404
+ /**
405
+ * Callback for AI autocomplete API requests.
406
+ * If not set, text autocomplete is disabled regardless of `textAutocompleteEnabled`.
407
+ * @default null
408
+ */
409
+ textAutocompleteApiRequest: ((query: string, maxSuggestions: number, signal: AbortSignal) => Promise<string[]>) | null;
410
+ /**
411
+ * Minimum number of characters before triggering AI autocomplete
412
+ * @default 3
413
+ */
414
+ textAutocompleteMinQueryLength: number;
415
+ /**
416
+ * Maximum number of suggestions to show
417
+ * @default 3
418
+ */
419
+ textAutocompleteMaxSuggestions: number;
420
+ /**
421
+ * Debounce delay in milliseconds for AI requests
422
+ * @default 500
423
+ */
424
+ textAutocompleteDebounceMs: number;
425
+ /**
426
+ * TTL for autocomplete cache entries in milliseconds.
427
+ * Repeated identical queries within this window return cached results.
428
+ * Set to 0 to disable caching.
429
+ * @default 30000
430
+ */
431
+ textAutocompleteCacheTTL: number;
432
+ /**
433
+ * Maximum number of entries in the autocomplete cache.
434
+ * When exceeded, the oldest entry is evicted.
435
+ * @default 50
436
+ */
437
+ textAutocompleteCacheMaxSize: number;
398
438
  /**
399
439
  * Allow uploading base64 artifact (images, audio) to server
400
440
  */
@@ -1 +1 @@
1
- var c=Object.defineProperty;var i=(e,a)=>c(e,"name",{value:a,configurable:!0});import{registerAIProvider as u}from"./registry.js";import{Ajax as l}from"jodit/esm/core/request/ajax.js";u("jodit-ai-adapter",(e=>{var a;const d=e.url.replace(/\/+$/,""),m=(a=e.provider)!==null&&a!==void 0?a:"openai",o=e.stream!==!1;return{apiMode:"incremental",maxRetries:0,apiRequest:i(async(t,s)=>{const r=new l({url:`${d}/ai/request?key=${encodeURIComponent(e.apiKey)}`,method:"POST",contentType:"application/json",data:{provider:m,context:o?{...t,metadata:{...t.metadata,stream:!0}}:t}});if(s&&s.addEventListener("abort",()=>r.abort(),{once:!0}),!o)return{mode:"final",response:(await(await r.send()).json()).result};const p=r.stream();return{mode:"stream",stream:(async function*(){for await(const n of p)yield JSON.parse(n)})()}},"apiRequest")}}));
1
+ var y=Object.defineProperty;var d=(e,t)=>y(e,"name",{value:t,configurable:!0});import{registerAIProvider as v}from"./registry.js";import{Ajax as m}from"jodit/esm/core/request/ajax.js";v("jodit-ai-adapter",(e=>{var t;const p=e.url.replace(/\/+$/,""),u=(t=e.provider)!==null&&t!==void 0?t:"openai",c=e.stream!==!1;return{apiMode:"incremental",maxRetries:0,textAutocompleteEnabled:!0,textAutocompleteApiRequest:d(async(a,s,o)=>{var r;const n=new m({url:`${p}/ai/autocomplete?query=${encodeURIComponent(a)}&key=${encodeURIComponent(e.apiKey)}`,method:"POST",contentType:"application/json",data:{provider:u,context:{maxSuggestions:s}}});o.addEventListener("abort",()=>n.abort(),{once:!0});const i=await(await n.send()).json();return i.success&&(!((r=i.result)===null||r===void 0)&&r.suggestions)?i.result.suggestions:[]},"textAutocompleteApiRequest"),apiRequest:d(async(a,s)=>{const o=new m({url:`${p}/ai/request?key=${encodeURIComponent(e.apiKey)}`,method:"POST",contentType:"application/json",data:{provider:u,context:c?{...a,metadata:{...a.metadata,stream:!0}}:a}});if(s&&s.addEventListener("abort",()=>o.abort(),{once:!0}),!c)return{mode:"final",response:(await(await o.send()).json()).result};const r=o.stream();return{mode:"stream",stream:(async function*(){for await(const n of r)yield JSON.parse(n)})()}},"apiRequest")}}));
@@ -1 +1 @@
1
- var R=Object.defineProperty;var m=(c,e)=>R(c,"name",{value:e,configurable:!0});var p=function(c,e,t,o){var r=arguments.length,s=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,o);else for(var i=c.length-1;i>=0;i--)(n=c[i])&&(s=(r<3?n(s):r>3?n(e,t,s):n(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};import"./config.js";import{Autocomplete as D}from"./ui/autocomplete.js";import{getTextLeftOfCursor as E,replaceTextLeftOfCursorAfterSpace as P}from"./helpers.js";import{KEY_DOWN as d,KEY_ENTER as O,KEY_ESC as b,KEY_TAB as y,KEY_UP as g}from"jodit/esm/core/constants.js";import{autobind as u,cache as v,debounce as _}from"jodit/esm/core/decorators/index.js";import{Dom as x}from"jodit/esm/core/dom/dom.js";import{isArray as w,isFunction as A,isPromise as S,isString as C,position as V,trim as F}from"jodit/esm/core/helpers/index.js";import{Plugin as T}from"jodit/esm/core/plugin/index.js";import{Popup as Y}from"jodit/esm/core/ui/popup/popup.js";import{JoditPro as j}from"../../jodit-pro.js";const a=class a extends T{constructor(){super(...arguments),this.hasStyle=!j.fatMode,this.sources=[]}get list(){return new D(this.jodit)}get popup(){const e=new Y(this.jodit);return e.setMod("padding",!1),e.setContent(this.list.container),this.jodit.e.on(e,"beforeClose",()=>{this.list.currentSelection=0}),e}afterInit(e){e.e.on("select.autocomplete",t=>{let o=t.value;A(t.insertValueRenderer)&&(o=t.insertValueRenderer(t)),x.isNode(o)||(o=e.createInside.fromHTML(o)),P(e.s.range,o),this.j.s.setCursorAfter(o),this.j.synchronizeValues(),this.popup.close()}).on("keydown.autocomplete",this.onKeyDown).on("keydown.autocomplete",this.onKeyControlDown,{top:!0}).on("beforeEnter.autocomplete",this.onEnter,{top:!0}).on("autocomplete.autocomplete",this.onAutoComplete).on("registerAutocompleteSource.autocomplete",this.registerAutocompleteSource).on("unregisterAutocompleteSource.autocomplete",this.unregisterAutocompleteSource)}registerAutocompleteSource(e){this.sources.push(e)}unregisterAutocompleteSource(e){const t=this.sources.indexOf(e);t!==-1&&this.sources.splice(t,1)}static isControlKey(e){return e===d||e===g||e===O||e===y}async onKeyDown(e){var t,o;if(e.key===b){this.popup.isOpened&&this.popup.close();return}const{s:r}=this.j;if(a.isControlKey(e.key)||!r.isInsideArea||!r.isCollapsed)return;const s=!((t=this.j.s.sel)===null||t===void 0)&&t.rangeCount?(o=this.j.s.sel)===null||o===void 0?void 0:o.getRangeAt(0):null,n=s&&E(s).split(" ").pop();if(n&&F(n).length){const i=await this.onAutoComplete(n);if(i.length)return this.openPopup(i)}this.popup.isOpened&&this.popup.close()}onKeyControlDown(e){if(this.popup.isOpened&&a.isControlKey(e.key)){switch(e.key){case d:this.list.selectNext();break;case g:this.list.selectPrevious();break;case y:this.list.select();break}return this.j.e.stopPropagation(e.type),!1}}onEnter(){if(this.popup.isOpened)return this.list.select(),!1}async onAutoComplete(e){const t=[];return await Promise.all(this.sources.concat(this.j.o.autocomplete.sources).map(async o=>{t.push(...await this.resolveFeed(e,o))})),t}async resolveFeed(e,t,o){let r;if(S(t)&&(t=await t),A(t))r=await t(e);else if(w(t)){const s=t,{isMatchedQuery:n}=this.j.o.autocomplete;r=s.filter(i=>C(i)?n(e,i):n(e,i.value)).map(i=>C(i)?{title:i,value:i}:i)}else r=await this.resolveFeed(e,t.feed,t);if(this.j.isDestructed)return[];if(r&&w(r)){const{itemRenderer:s,insertValueRenderer:n,maxItems:i}=this.j.o.autocomplete;return r=r.map(K=>{var h,f;return{itemRenderer:(h=o?.itemRenderer)!==null&&h!==void 0?h:s,insertValueRenderer:(f=o?.insertValueRenderer)!==null&&f!==void 0?f:n,...K}}),r.slice(0,i)}return[]}openPopup(e){this.list.build(e),this.popup.open(()=>{const{j:t}=this,o=t.s.range.getBoundingClientRect(),r={left:o.left,top:o.top,height:o.height,width:o.width};if(t.o.iframe&&t.iframe){const s=V(t.iframe,t);r.top+=s.top,r.left+=s.left}return r})}beforeDestruct(e){e.e.off(this.list).off(this.popup).off("keydown.autocomplete",this.onKeyDown).off("autocomplete.autocomplete",this.onAutoComplete).off(".autocomplete"),this.list.destruct(),this.popup.destruct()}};m(a,"autocomplete");let l=a;l.requires=["enter","license"],p([v],l.prototype,"list",null),p([v],l.prototype,"popup",null),p([u],l.prototype,"registerAutocompleteSource",null),p([u],l.prototype,"unregisterAutocompleteSource",null),p([_()],l.prototype,"onKeyDown",null),p([u],l.prototype,"onKeyControlDown",null),p([u],l.prototype,"onEnter",null),p([u],l.prototype,"onAutoComplete",null),p([u],l.prototype,"resolveFeed",null),j.plugins.add("autocomplete",l);export{l as autocomplete};
1
+ var R=Object.defineProperty;var m=(c,e)=>R(c,"name",{value:e,configurable:!0});var p=function(c,e,t,o){var r=arguments.length,s=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,o);else for(var i=c.length-1;i>=0;i--)(n=c[i])&&(s=(r<3?n(s):r>3?n(e,t,s):n(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s};import"./config.js";import{Autocomplete as D}from"./ui/autocomplete.js";import{getTextLeftOfCursor as E,replaceTextLeftOfCursorAfterSpace as P}from"./helpers.js";import{KEY_DOWN as d,KEY_ENTER as O,KEY_ESC as b,KEY_TAB as y,KEY_UP as g}from"jodit/esm/core/constants.js";import{autobind as u,cache as v,debounce as _}from"jodit/esm/core/decorators/index.js";import{Dom as x}from"jodit/esm/core/dom/dom.js";import{isArray as w,isFunction as A,isPromise as M,isString as C,position as S,trim as V}from"jodit/esm/core/helpers/index.js";import{Plugin as F}from"jodit/esm/core/plugin/index.js";import{Popup as T}from"jodit/esm/core/ui/popup/popup.js";import{JoditPro as j}from"../../jodit-pro.js";const a=class a extends F{constructor(){super(...arguments),this.hasStyle=!j.fatMode,this.sources=[]}get list(){const e=new D(this.jodit);return e.setDisplayMode(this.jodit.o.autocomplete.displayMode),e}get popup(){const e=new T(this.jodit);return e.setMod("padding",!1),e.setContent(this.list.container),this.jodit.o.autocomplete.displayMode==="inline"&&e.setMod("autocomplete-inline",!0),this.jodit.e.on(e,"beforeClose",()=>{this.list.currentSelection=0}),e}afterInit(e){e.e.on("select.autocomplete",t=>{let o=t.value;A(t.insertValueRenderer)&&(o=t.insertValueRenderer(t)),x.isNode(o)||(o=e.createInside.fromHTML(o)),P(e.s.range,o),this.j.s.setCursorAfter(o),this.j.synchronizeValues(),this.popup.close()}).on("keydown.autocomplete",this.onKeyDown).on("keydown.autocomplete",this.onKeyControlDown,{top:!0}).on("beforeEnter.autocomplete",this.onEnter,{top:!0}).on("autocomplete.autocomplete",this.onAutoComplete).on("registerAutocompleteSource.autocomplete",this.registerAutocompleteSource).on("unregisterAutocompleteSource.autocomplete",this.unregisterAutocompleteSource)}registerAutocompleteSource(e){this.sources.push(e)}unregisterAutocompleteSource(e){const t=this.sources.indexOf(e);t!==-1&&this.sources.splice(t,1)}static isControlKey(e){return e===d||e===g||e===O||e===y}async onKeyDown(e){var t,o;if(e.key===b){this.popup.isOpened&&this.popup.close();return}const{s:r}=this.j;if(a.isControlKey(e.key)||!r.isInsideArea||!r.isCollapsed)return;const s=!((t=this.j.s.sel)===null||t===void 0)&&t.rangeCount?(o=this.j.s.sel)===null||o===void 0?void 0:o.getRangeAt(0):null,n=s&&E(s).split(" ").pop();if(n&&V(n).length){const i=await this.onAutoComplete(n);if(i.length)return this.openPopup(i)}this.popup.isOpened&&this.popup.close()}onKeyControlDown(e){if(this.popup.isOpened&&a.isControlKey(e.key)){switch(e.key){case d:this.list.selectNext();break;case g:this.list.selectPrevious();break;case y:this.list.select();break}return this.j.e.stopPropagation(e.type),!1}}onEnter(){if(this.popup.isOpened)return this.list.select(),!1}async onAutoComplete(e){const t=[];return await Promise.all(this.sources.concat(this.j.o.autocomplete.sources).map(async o=>{t.push(...await this.resolveFeed(e,o))})),t}async resolveFeed(e,t,o){let r;if(M(t)&&(t=await t),A(t))r=await t(e);else if(w(t)){const s=t,{isMatchedQuery:n}=this.j.o.autocomplete;r=s.filter(i=>C(i)?n(e,i):n(e,i.value)).map(i=>C(i)?{title:i,value:i}:i)}else r=await this.resolveFeed(e,t.feed,t);if(this.j.isDestructed)return[];if(r&&w(r)){const{itemRenderer:s,insertValueRenderer:n,maxItems:i}=this.j.o.autocomplete;return r=r.map(K=>{var h,f;return{itemRenderer:(h=o?.itemRenderer)!==null&&h!==void 0?h:s,insertValueRenderer:(f=o?.insertValueRenderer)!==null&&f!==void 0?f:n,...K}}),r.slice(0,i)}return[]}openPopup(e){this.list.build(e),this.popup.open(()=>{const{j:t}=this,o=t.s.range.getBoundingClientRect(),r={left:o.left,top:o.top,height:o.height,width:o.width};if(t.o.iframe&&t.iframe){const s=S(t.iframe,t);r.top+=s.top,r.left+=s.left}return r})}beforeDestruct(e){e.e.off(this.list).off(this.popup).off("keydown.autocomplete",this.onKeyDown).off("autocomplete.autocomplete",this.onAutoComplete).off(".autocomplete"),this.list.destruct(),this.popup.destruct()}};m(a,"autocomplete");let l=a;l.requires=["enter","license"],p([v],l.prototype,"list",null),p([v],l.prototype,"popup",null),p([u],l.prototype,"registerAutocompleteSource",null),p([u],l.prototype,"unregisterAutocompleteSource",null),p([_()],l.prototype,"onKeyDown",null),p([u],l.prototype,"onKeyControlDown",null),p([u],l.prototype,"onEnter",null),p([u],l.prototype,"onAutoComplete",null),p([u],l.prototype,"resolveFeed",null),j.plugins.add("autocomplete",l);export{l as autocomplete};
@@ -3,10 +3,11 @@
3
3
  * See LICENSE.md in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5
5
  */
6
- import type { AutoCompleteSource, IAutoCompleteItem } from "./interface";
6
+ import type { AutoCompleteDisplayMode, AutoCompleteSource, IAutoCompleteItem } from "./interface";
7
7
  declare module 'jodit/esm/config' {
8
8
  interface Config {
9
9
  autocomplete: {
10
+ displayMode: AutoCompleteDisplayMode;
10
11
  maxItems: number;
11
12
  isMatchedQuery: (query: string, value: string) => boolean;
12
13
  itemRenderer: <T = any>(item: IAutoCompleteItem<T>) => string | HTMLElement;
@@ -1 +1 @@
1
- var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});import{Config as a}from"jodit/esm/config.js";a.prototype.autocomplete={sources:[],maxItems:50,isMatchedQuery:o((e,r)=>r.toLowerCase().indexOf(e.toLowerCase())===0,"isMatchedQuery"),itemRenderer:o(e=>{var r;return(r=e.title)!==null&&r!==void 0?r:e.value},"itemRenderer"),insertValueRenderer:o(e=>e.value+"&nbsp;","insertValueRenderer")};
1
+ var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});import{Config as a}from"jodit/esm/config.js";a.prototype.autocomplete={displayMode:"list",sources:[],maxItems:50,isMatchedQuery:o((e,r)=>r.toLowerCase().indexOf(e.toLowerCase())===0,"isMatchedQuery"),itemRenderer:o(e=>{var r;return(r=e.title)!==null&&r!==void 0?r:e.value},"itemRenderer"),insertValueRenderer:o(e=>e.value+"&nbsp;","insertValueRenderer")};
@@ -17,3 +17,4 @@ export interface IAutoCompleteCustomFeed {
17
17
  insertValueRenderer?: IAutoCompleteItem<IAutoCompleteItem>['insertValueRenderer'];
18
18
  }
19
19
  export type AutoCompleteSource = IAutoCompleteCustomFeed['feed'] | IAutoCompleteCustomFeed;
20
+ export type AutoCompleteDisplayMode = 'list' | 'inline';
@@ -5,12 +5,14 @@
5
5
  */
6
6
  import { AutocompleteItem } from "./item";
7
7
  import { UIGroup } from "jodit/esm/core/ui/group/group";
8
- import type { IAutoCompleteItem } from "../interface";
8
+ import type { AutoCompleteDisplayMode, IAutoCompleteItem } from "../interface";
9
9
  export declare class Autocomplete extends UIGroup {
10
10
  /** @override */
11
11
  className(): string;
12
12
  elements: AutocompleteItem[];
13
13
  currentSelection: number;
14
+ private displayMode;
15
+ setDisplayMode(mode: AutoCompleteDisplayMode): void;
14
16
  private onChangeSelection;
15
17
  private __previousList;
16
18
  private itemsMap;
@@ -1 +1 @@
1
- var x=Object.defineProperty;var f=(a,e)=>x(a,"name",{value:e,configurable:!0});var u,v=function(a,e,t,l){var s=arguments.length,i=s<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,l);else for(var m=a.length-1;m>=0;m--)(o=a[m])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};import{ListReconciler as _}from"../../../core/ui/helpers/index.js";import{AutocompleteItem as g}from"./item.js";import{component as M,watch as I}from"jodit/esm/core/decorators/index.js";import{UIGroup as O}from"jodit/esm/core/ui/group/group.js";let d=(u=class extends O{constructor(){super(...arguments),this.elements=[],this.currentSelection=-1,this.__previousList=[],this.itemsMap=new Map}className(){return"Autocomplete"}onChangeSelection(){var e,t;this.elements.forEach(l=>l.setMod("active",!1)),(e=this.elements[this.currentSelection])===null||e===void 0||e.setMod("active",!0),(t=this.elements[this.currentSelection])===null||t===void 0||t.container.scrollIntoView(!1)}build(e){var t;const l=(t=this.elements[this.currentSelection])===null||t===void 0?void 0:t.item.value,s=f(n=>n.value,"getId"),i=_.reconcile(this.__previousList,e,{getId:s}),o=new Set;i.toRemove.forEach(n=>{const r=s(n);if(o.has(r))return;o.add(r);const c=this.itemsMap.get(r);c&&(this.elements.indexOf(c)!==-1&&(this.remove(c),c.destruct()),this.itemsMap.delete(n.value))}),i.toCreate.forEach(n=>{const r=s(n);if(o.has(r))return;o.add(r);const c=new g(this.jodit,n,p=>{this.currentSelection=e.findIndex(S=>s(S)===p),this.select()});this.itemsMap.set(r,c);const h=e.indexOf(n);this.append(c,h)}),i.toUpdate.forEach(({newItem:n,index:r})=>{const c=s(n);if(o.has(c))return;o.add(c);const h=this.itemsMap.get(c);h&&(h.item=n,this.elements.indexOf(h)!==r&&r<this.elements.length&&(this.remove(h),this.append(h,r)))});const m=this.currentSelection;this.currentSelection=Math.max(0,e.findIndex(n=>s(n)===l)),m===this.currentSelection&&this.onChangeSelection(),this.__previousList=[...e]}selectNext(){this.currentSelection+1<=this.elements.length-1?this.currentSelection+=1:this.currentSelection=0}selectPrevious(){this.currentSelection-1>=0?this.currentSelection-=1:this.currentSelection=this.elements.length-1}select(){this.j.e.fire("select.autocomplete",this.elements[this.currentSelection].item)}},f(u,"Autocomplete"),u);v([I("currentSelection")],d.prototype,"onChangeSelection",null),d=v([M],d);export{d as Autocomplete};
1
+ var M=Object.defineProperty;var p=(a,e)=>M(a,"name",{value:e,configurable:!0});var u,S=function(a,e,i,h){var n=arguments.length,s=n<3?e:h===null?h=Object.getOwnPropertyDescriptor(e,i):h,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(a,e,i,h);else for(var d=a.length-1;d>=0;d--)(o=a[d])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};import{ListReconciler as x}from"../../../core/ui/helpers/index.js";import{AutocompleteItem as g}from"./item.js";import{component as _,watch as I}from"jodit/esm/core/decorators/index.js";import{UIGroup as w}from"jodit/esm/core/ui/group/group.js";let f=(u=class extends w{constructor(){super(...arguments),this.elements=[],this.currentSelection=-1,this.displayMode="list",this.__previousList=[],this.itemsMap=new Map}className(){return"Autocomplete"}setDisplayMode(e){this.displayMode=e,this.setMod("displayMode",e)}onChangeSelection(){this.elements.forEach(i=>{i.setMod("active",!1),i.showShortcut(!1)});const e=this.elements[this.currentSelection];e&&(e.setMod("active",!0),this.displayMode==="inline"&&e.showShortcut(!0),e.container.scrollIntoView(!1))}build(e){var i;const h=(i=this.elements[this.currentSelection])===null||i===void 0?void 0:i.item.value,n=p(t=>t.value,"getId"),s=x.reconcile(this.__previousList,e,{getId:n}),o=new Set;s.toRemove.forEach(t=>{const r=n(t);if(o.has(r))return;o.add(r);const c=this.itemsMap.get(r);c&&(this.elements.indexOf(c)!==-1&&(this.remove(c),c.destruct()),this.itemsMap.delete(t.value))}),s.toCreate.forEach(t=>{const r=n(t);if(o.has(r))return;o.add(r);const c=new g(this.jodit,t,m=>{this.currentSelection=e.findIndex(v=>n(v)===m),this.select()});this.itemsMap.set(r,c);const l=e.indexOf(t);this.append(c,l)}),s.toUpdate.forEach(({newItem:t,index:r})=>{const c=n(t);if(o.has(c))return;o.add(c);const l=this.itemsMap.get(c);l&&(l.item=t,this.elements.indexOf(l)!==r&&r<this.elements.length&&(this.remove(l),this.append(l,r)))});const d=this.currentSelection;this.currentSelection=Math.max(0,e.findIndex(t=>n(t)===h)),d===this.currentSelection&&this.onChangeSelection(),this.__previousList=[...e]}selectNext(){this.currentSelection+1<=this.elements.length-1?this.currentSelection+=1:this.currentSelection=0}selectPrevious(){this.currentSelection-1>=0?this.currentSelection-=1:this.currentSelection=this.elements.length-1}select(){this.j.e.fire("select.autocomplete",this.elements[this.currentSelection].item)}},p(u,"Autocomplete"),u);S([I("currentSelection")],f.prototype,"onChangeSelection",null),f=S([_],f);export{f as Autocomplete};
@@ -9,9 +9,11 @@ export declare class AutocompleteItem extends UIElement {
9
9
  item: IAutoCompleteItem;
10
10
  private onClick;
11
11
  readonly value: string;
12
+ private shortcutElm;
12
13
  /** @override */
13
14
  className(): string;
14
15
  constructor(jodit: AutocompleteItem['jodit'], item: IAutoCompleteItem, onClick: (value: string) => void);
16
+ showShortcut(show: boolean): void;
15
17
  protected onClickPrevent(e: MouseEvent): void;
16
18
  protected onClickHandler(): void;
17
19
  }
@@ -1 +1 @@
1
- var h=Object.defineProperty;var u=(c,e)=>h(c,"name",{value:e,configurable:!0});var i,p=function(c,e,t,l){var o=arguments.length,n=o<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(c,e,t,l);else for(var s=c.length-1;s>=0;s--)(r=c[s])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};import{component as m,watch as f}from"jodit/esm/core/decorators/index.js";import{isFunction as v,isString as d}from"jodit/esm/core/helpers/checker/index.js";import{UIElement as C}from"jodit/esm/core/ui/element.js";let a=(i=class extends C{className(){return"AutocompleteItem"}constructor(e,t,l){var o;super(e),this.item=t,this.onClick=l,this.value="";const{container:n}=this;if(this.value=t.value,v(t.itemRenderer)){const r=t.itemRenderer(t);d(r)?n.innerHTML=r:n.appendChild(r)}else n.innerText=(o=t.title)!==null&&o!==void 0?o:t.value}onClickPrevent(e){e.preventDefault(),e.stopPropagation()}onClickHandler(){this.onClick(this.value)}},u(i,"AutocompleteItem"),i);p([f("container:mousedown container:touchstart")],a.prototype,"onClickPrevent",null),p([f("container:click")],a.prototype,"onClickHandler",null),a=p([m],a);export{a as AutocompleteItem};
1
+ var m=Object.defineProperty;var a=(c,e)=>m(c,"name",{value:e,configurable:!0});var i,h=function(c,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(c,e,t,r);else for(var u=c.length-1;u>=0;u--)(l=c[u])&&(n=(o<3?l(n):o>3?l(e,t,n):l(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};import{component as f,watch as p}from"jodit/esm/core/decorators/index.js";import{isFunction as v,isString as d}from"jodit/esm/core/helpers/checker/index.js";import{UIElement as C}from"jodit/esm/core/ui/element.js";let s=(i=class extends C{className(){return"AutocompleteItem"}constructor(e,t,r){var o;super(e),this.item=t,this.onClick=r,this.value="",this.shortcutElm=null;const{container:n}=this;if(this.value=t.value,v(t.itemRenderer)){const l=t.itemRenderer(t);d(l)?n.innerHTML=l:n.appendChild(l)}else n.innerText=(o=t.title)!==null&&o!==void 0?o:t.value}showShortcut(e){if(e&&!this.shortcutElm){const t=this.j.c.element("span");t.className="jodit-autocomplete-item__shortcut",t.innerText="tab",this.container.appendChild(t),this.shortcutElm=t}else!e&&this.shortcutElm&&(this.shortcutElm.remove(),this.shortcutElm=null)}onClickPrevent(e){e.preventDefault(),e.stopPropagation()}onClickHandler(){this.onClick(this.value)}},a(i,"AutocompleteItem"),i);h([p("container:mousedown container:touchstart")],s.prototype,"onClickPrevent",null),h([p("container:click")],s.prototype,"onClickHandler",null),s=h([f],s);export{s as AutocompleteItem};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var r=(e,s)=>f(e,"name",{value:s,configurable:!0});import{detectActiveStyle as v}from"./detect-active-style.js";import{IS_BLOCK as a}from"jodit/esm/core/constants.js";import{Dom as o}from"jodit/esm/core/dom/dom.js";function c(e,s){const n=e.s.current();if(!n)return null;if(a.test(s.element))return o.closest(n,o.isBlock,e.editor);let t=o.isElement(n)?n:n.parentNode;for(;t&&t!==e.editor;){if(o.isElement(t)&&t.nodeName.toLowerCase()===s.element)return t;t=t.parentNode}return null}r(c,"findTarget");function u(e,s){for(const n of s)e.classList.remove(n);e.className===""&&e.removeAttribute("class")}r(u,"removeClassesFromElement");function p(e,s){var n;const t=(n=s.classes)===null||n===void 0?void 0:n.filter(Boolean);if(!t||t.length<=1)return;const i=e.s.current();if(i)if(a.test(s.element)){const l=o.closest(i,o.isBlock,e.editor);l&&u(l,t.slice(1))}else{const l=c(e,s);l&&(u(l,t.slice(1)),l.nodeName.toLowerCase()==="span"&&!l.attributes.length&&o.unwrap(l))}}r(p,"cleanupExtraClasses");function C(e,s){var n;const t=(n=s.classes)===null||n===void 0?void 0:n.filter(Boolean);if(!t||t.length<=1)return;const i=c(e,s);if(i)for(let l=1;l<t.length;l++)i.classList.add(t[l])}r(C,"addExtraClasses");function m(e){var s;const n=(s=e.classes)===null||s===void 0?void 0:s.filter(Boolean)[0];return n?{element:e.element,attributes:{class:n}}:{element:e.element}}r(m,"buildCommitStyleOptions");function b(e,s,n){const t=v(e,n);t&&(e.s.commitStyle(m(t)),p(e,t),t===s)||(e.s.commitStyle(m(s)),C(e,s))}r(b,"applyStyle");export{b as applyStyle};
1
+ var f=Object.defineProperty;var l=(t,s)=>f(t,"name",{value:s,configurable:!0});import{detectActiveStyle as v}from"./detect-active-style.js";import{IS_BLOCK as a}from"jodit/esm/core/constants.js";import{Dom as i}from"jodit/esm/core/dom/dom.js";function c(t,s){const n=t.s.current();if(!n)return null;if(a.test(s.element))return i.closest(n,i.isBlock,t.editor);let e=i.isElement(n)?n:n.parentNode;for(;e&&e!==t.editor;){if(i.isElement(e)&&e.nodeName.toLowerCase()===s.element)return e;e=e.parentNode}return null}l(c,"findTarget");function u(t,s){for(const n of s)t.classList.remove(n);t.className===""&&t.removeAttribute("class")}l(u,"removeClassesFromElement");function p(t,s){var n;const e=(n=s.classes)===null||n===void 0?void 0:n.filter(Boolean);if(!e||e.length<=1)return;const o=t.s.current();if(o)if(a.test(s.element)){const r=i.closest(o,i.isBlock,t.editor);r&&u(r,e.slice(1))}else{const r=c(t,s);r&&(u(r,e.slice(1)),r.nodeName.toLowerCase()==="span"&&!r.attributes.length&&i.unwrap(r))}}l(p,"cleanupExtraClasses");function b(t,s){var n;const e=(n=s.classes)===null||n===void 0?void 0:n.filter(Boolean);if(!e||e.length<=1)return;const o=c(t,s);if(o)for(let r=1;r<e.length;r++)o.classList.add(e[r])}l(b,"addExtraClasses");function m(t){var s;if(t.attributes)return{element:t.element,attributes:t.attributes};const n=(s=t.classes)===null||s===void 0?void 0:s.filter(Boolean)[0];return n?{element:t.element,attributes:{class:n}}:{element:t.element}}l(m,"buildCommitStyleOptions");function S(t,s,n){const e=v(t,n);e&&(t.s.commitStyle(m(e)),e.attributes||p(t,e),e===s)||(t.s.commitStyle(m(s)),s.attributes||b(t,s))}l(S,"applyStyle");export{S as applyStyle};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var i=(o,r)=>c(o,"name",{value:r,configurable:!0});import{IS_BLOCK as u}from"jodit/esm/core/constants.js";import{Dom as l}from"jodit/esm/core/dom/dom.js";function s(o,r){var n;if(o.nodeName.toLowerCase()!==r.element)return!1;const t=(n=r.classes)===null||n===void 0?void 0:n.filter(Boolean);return t?.length?t.every(e=>o.classList.contains(e)):!0}i(s,"elementMatchesDefinition");function d(o,r){const n=o.s.current();if(!n)return null;for(const t of r)if(u.test(t.element)){const e=l.closest(n,l.isBlock,o.editor);if(e&&s(e,t))return t}else{let e=l.isElement(n)?n:n.parentNode;for(;e&&e!==o.editor;){if(l.isElement(e)&&s(e,t))return t;e=e.parentNode}}return null}i(d,"detectActiveStyle");export{d as detectActiveStyle};
1
+ var u=Object.defineProperty;var o=(e,i)=>u(e,"name",{value:i,configurable:!0});import{IS_BLOCK as c}from"jodit/esm/core/constants.js";import{Dom as s}from"jodit/esm/core/dom/dom.js";import{attr as a}from"jodit/esm/core/helpers/utils/attr.js";import{css as m}from"jodit/esm/core/helpers/utils/css.js";function p(e,i){for(const[n,t]of Object.entries(i))if(t!=null){if(n==="class"){if(typeof t=="string"&&!e.classList.contains(t))return!1}else if(n==="style"){if(typeof t=="object"&&t!=null){for(const[r,l]of Object.entries(t))if(l!=null&&m(e,r,!0)!==String(l))return!1}}else if(a(e,n)!==String(t))return!1}return!0}o(p,"attributesMatch");function f(e,i){var n;if(e.nodeName.toLowerCase()!==i.element)return!1;if(i.attributes)return p(e,i.attributes);const t=(n=i.classes)===null||n===void 0?void 0:n.filter(Boolean);return t?.length?t.every(r=>e.classList.contains(r)):!0}o(f,"elementMatchesDefinition");function h(e,i){const n=e.s.current();if(!n)return null;for(const t of i)if(c.test(t.element)){const r=s.closest(n,s.isBlock,e.editor);if(r&&f(r,t))return t}else{let r=s.isElement(n)?n:n.parentNode;for(;r&&r!==e.editor;){if(s.isElement(r)&&f(r,t))return t;r=r.parentNode}}return null}o(h,"detectActiveStyle");export{h as detectActiveStyle};
@@ -3,11 +3,12 @@
3
3
  * See LICENSE.md in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5
5
  */
6
- import type { HTMLTagNames } from "jodit/esm/types/index";
6
+ import type { HTMLTagNames, IAttributes } from "jodit/esm/types/index";
7
7
  export interface IStyleDefinition {
8
8
  name: string;
9
9
  element: HTMLTagNames;
10
10
  classes?: string[];
11
+ attributes?: IAttributes;
11
12
  }
12
13
  export interface IStyleGroup {
13
14
  title: string;
@@ -1 +1 @@
1
- var b=Object.defineProperty;var u=(t,l)=>b(t,"name",{value:l,configurable:!0});import{applyStyle as $}from"../helpers/apply-style.js";import{classifyDefinitions as g}from"../helpers/classify-definitions.js";import{detectActiveStyle as S}from"../helpers/detect-active-style.js";const e="jodit-style-popup";function L(t,l,f){var o,s;const m=g(l),C=S(t,l),p=t.c.div(e);for(const i of m){const d=t.c.div(`${e}__group-title`);d.textContent=t.i18n(i.title),p.appendChild(d);const r=t.c.div(`${e}__grid`);for(const n of i.definitions){const c=t.c.element("button");c.type="button";const y=C===n;c.className=`${e}__card`+(y?` ${e}__card_active_true`:"");const _=t.c.div(`${e}__card-preview`),a=t.c.element(n.element);for(const h of(s=(o=n.classes)===null||o===void 0?void 0:o.filter(Boolean))!==null&&s!==void 0?s:[])a.classList.add(h);a.textContent=n.name,_.appendChild(a),c.appendChild(_);const v=t.c.div(`${e}__card-label`);v.textContent=n.name,c.appendChild(v),t.e.on(c,"click",()=>{t.s.focus(),$(t,n,l),t.synchronizeValues(),f()}),r.appendChild(c)}p.appendChild(r)}return p}u(L,"buildStylePopup");export{L as buildStylePopup};
1
+ var h=Object.defineProperty;var f=(t,o)=>h(t,"name",{value:o,configurable:!0});import{applyStyle as $}from"../helpers/apply-style.js";import{classifyDefinitions as g}from"../helpers/classify-definitions.js";import{detectActiveStyle as S}from"../helpers/detect-active-style.js";import{attr as x}from"jodit/esm/core/helpers/utils/attr.js";const n="jodit-style-popup";function j(t,o,v){var s,a;const m=g(o),C=S(t,o),i=t.c.div(n);for(const p of m){const r=t.c.div(`${n}__group-title`);r.textContent=t.i18n(p.title),i.appendChild(r);const d=t.c.div(`${n}__grid`);for(const e of p.definitions){const c=t.c.element("button");c.type="button";const b=C===e;c.className=`${n}__card`+(b?` ${n}__card_active_true`:"");const u=t.c.div(`${n}__card-preview`),l=t.c.element(e.element);if(e.attributes)x(l,e.attributes);else for(const y of(a=(s=e.classes)===null||s===void 0?void 0:s.filter(Boolean))!==null&&a!==void 0?a:[])l.classList.add(y);l.textContent=e.name,u.appendChild(l),c.appendChild(u);const _=t.c.div(`${n}__card-label`);_.textContent=e.name,c.appendChild(_),t.e.on(c,"click",()=>{t.s.focus(),$(t,e,o),t.synchronizeValues(),v()}),d.appendChild(c)}i.appendChild(d)}return i}f(j,"buildStylePopup");export{j as buildStylePopup};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit-pro",
3
- "version": "4.11.26",
3
+ "version": "4.11.28",
4
4
  "author": "Chupurnov Valerii <chupurnov@gmail.com>",
5
5
  "homepage": "https://xdsoft.net/jodit/pro/",
6
6
  "bugs": {
package/types/config.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { IAIAssistantProOptions } from "./plugins/ai-assistant-pro/interface/index";
2
+ import type { AutoCompleteDisplayMode } from "./plugins/autocomplete/interface";
2
3
  import type { IAutoCompleteItem } from "./plugins/autocomplete/interface";
3
4
  import type { AutoCompleteSource } from "./plugins/autocomplete/interface";
4
5
  import type { ISnapshotStorage } from "./plugins/backup/interface";
@@ -39,6 +40,7 @@ interface Config {
39
40
  }
40
41
  interface Config {
41
42
  autocomplete: {
43
+ displayMode: AutoCompleteDisplayMode;
42
44
  maxItems: number;
43
45
  isMatchedQuery: (query: string, value: string) => boolean;
44
46
  itemRenderer: <T = any>(item: IAutoCompleteItem<T>) => string | HTMLElement;
@@ -18,6 +18,9 @@ export declare class aiAssistantPro extends Plugin {
18
18
  * Get or create dialog
19
19
  */
20
20
  private get dialog();
21
+ private textAutocompleteSource;
22
+ private textAutocompleteCache;
23
+ private setupTextAutocomplete;
21
24
  protected afterInit(): void;
22
25
  private __initedPromise;
23
26
  private __loadData;
@@ -395,6 +395,46 @@ export interface IAIAssistantProOptions {
395
395
  * @default true
396
396
  */
397
397
  allowEditTheme: boolean;
398
+ /**
399
+ * Enable AI text autocomplete.
400
+ * Requires `textAutocompleteApiRequest` to be set.
401
+ * @default false
402
+ */
403
+ textAutocompleteEnabled: boolean;
404
+ /**
405
+ * Callback for AI autocomplete API requests.
406
+ * If not set, text autocomplete is disabled regardless of `textAutocompleteEnabled`.
407
+ * @default null
408
+ */
409
+ textAutocompleteApiRequest: ((query: string, maxSuggestions: number, signal: AbortSignal) => Promise<string[]>) | null;
410
+ /**
411
+ * Minimum number of characters before triggering AI autocomplete
412
+ * @default 3
413
+ */
414
+ textAutocompleteMinQueryLength: number;
415
+ /**
416
+ * Maximum number of suggestions to show
417
+ * @default 3
418
+ */
419
+ textAutocompleteMaxSuggestions: number;
420
+ /**
421
+ * Debounce delay in milliseconds for AI requests
422
+ * @default 500
423
+ */
424
+ textAutocompleteDebounceMs: number;
425
+ /**
426
+ * TTL for autocomplete cache entries in milliseconds.
427
+ * Repeated identical queries within this window return cached results.
428
+ * Set to 0 to disable caching.
429
+ * @default 30000
430
+ */
431
+ textAutocompleteCacheTTL: number;
432
+ /**
433
+ * Maximum number of entries in the autocomplete cache.
434
+ * When exceeded, the oldest entry is evicted.
435
+ * @default 50
436
+ */
437
+ textAutocompleteCacheMaxSize: number;
398
438
  /**
399
439
  * Allow uploading base64 artifact (images, audio) to server
400
440
  */
@@ -3,10 +3,11 @@
3
3
  * See LICENSE.md in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5
5
  */
6
- import type { AutoCompleteSource, IAutoCompleteItem } from "./interface";
6
+ import type { AutoCompleteDisplayMode, AutoCompleteSource, IAutoCompleteItem } from "./interface";
7
7
  declare module 'jodit/esm/config' {
8
8
  interface Config {
9
9
  autocomplete: {
10
+ displayMode: AutoCompleteDisplayMode;
10
11
  maxItems: number;
11
12
  isMatchedQuery: (query: string, value: string) => boolean;
12
13
  itemRenderer: <T = any>(item: IAutoCompleteItem<T>) => string | HTMLElement;
@@ -17,3 +17,4 @@ export interface IAutoCompleteCustomFeed {
17
17
  insertValueRenderer?: IAutoCompleteItem<IAutoCompleteItem>['insertValueRenderer'];
18
18
  }
19
19
  export type AutoCompleteSource = IAutoCompleteCustomFeed['feed'] | IAutoCompleteCustomFeed;
20
+ export type AutoCompleteDisplayMode = 'list' | 'inline';
@@ -5,12 +5,14 @@
5
5
  */
6
6
  import { AutocompleteItem } from "./item";
7
7
  import { UIGroup } from "jodit/esm/core/ui/group/group";
8
- import type { IAutoCompleteItem } from "../interface";
8
+ import type { AutoCompleteDisplayMode, IAutoCompleteItem } from "../interface";
9
9
  export declare class Autocomplete extends UIGroup {
10
10
  /** @override */
11
11
  className(): string;
12
12
  elements: AutocompleteItem[];
13
13
  currentSelection: number;
14
+ private displayMode;
15
+ setDisplayMode(mode: AutoCompleteDisplayMode): void;
14
16
  private onChangeSelection;
15
17
  private __previousList;
16
18
  private itemsMap;
@@ -9,9 +9,11 @@ export declare class AutocompleteItem extends UIElement {
9
9
  item: IAutoCompleteItem;
10
10
  private onClick;
11
11
  readonly value: string;
12
+ private shortcutElm;
12
13
  /** @override */
13
14
  className(): string;
14
15
  constructor(jodit: AutocompleteItem['jodit'], item: IAutoCompleteItem, onClick: (value: string) => void);
16
+ showShortcut(show: boolean): void;
15
17
  protected onClickPrevent(e: MouseEvent): void;
16
18
  protected onClickHandler(): void;
17
19
  }
@@ -3,11 +3,12 @@
3
3
  * See LICENSE.md in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
5
5
  */
6
- import type { HTMLTagNames } from "jodit/esm/types/index";
6
+ import type { HTMLTagNames, IAttributes } from "jodit/esm/types/index";
7
7
  export interface IStyleDefinition {
8
8
  name: string;
9
9
  element: HTMLTagNames;
10
10
  classes?: string[];
11
+ attributes?: IAttributes;
11
12
  }
12
13
  export interface IStyleGroup {
13
14
  title: string;