@copilotkit/react-textarea 1.3.0 → 1.3.1

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 +10 -0
  2. package/dist/chunk-224UKA7C.mjs +38 -0
  3. package/dist/chunk-224UKA7C.mjs.map +1 -0
  4. package/dist/chunk-23Q6A46J.mjs +103 -0
  5. package/dist/chunk-23Q6A46J.mjs.map +1 -0
  6. package/dist/chunk-2C7O2EVM.mjs +27 -0
  7. package/dist/chunk-2C7O2EVM.mjs.map +1 -0
  8. package/dist/chunk-2QDCE7PD.mjs +32 -0
  9. package/dist/chunk-2QDCE7PD.mjs.map +1 -0
  10. package/dist/chunk-2XDYLKPH.mjs +181 -0
  11. package/dist/chunk-2XDYLKPH.mjs.map +1 -0
  12. package/dist/chunk-3PQ7GSFE.mjs +17 -0
  13. package/dist/chunk-3PQ7GSFE.mjs.map +1 -0
  14. package/dist/chunk-4AMCUMC7.mjs +124 -0
  15. package/dist/chunk-4AMCUMC7.mjs.map +1 -0
  16. package/dist/chunk-4CVSOOJY.mjs +30 -0
  17. package/dist/chunk-4CVSOOJY.mjs.map +1 -0
  18. package/dist/chunk-4NHVQZ67.mjs +108 -0
  19. package/dist/chunk-4NHVQZ67.mjs.map +1 -0
  20. package/dist/chunk-4PDYALMP.mjs +52 -0
  21. package/dist/chunk-4PDYALMP.mjs.map +1 -0
  22. package/dist/chunk-5UNJXFUO.mjs +29 -0
  23. package/dist/chunk-5UNJXFUO.mjs.map +1 -0
  24. package/dist/chunk-7LSRNPNI.mjs +59 -0
  25. package/dist/chunk-7LSRNPNI.mjs.map +1 -0
  26. package/dist/chunk-AJ5OMEXM.mjs +13 -0
  27. package/dist/chunk-AJ5OMEXM.mjs.map +1 -0
  28. package/dist/chunk-CF5GISTC.mjs +113 -0
  29. package/dist/chunk-CF5GISTC.mjs.map +1 -0
  30. package/dist/chunk-D2SUDM2O.mjs +99 -0
  31. package/dist/chunk-D2SUDM2O.mjs.map +1 -0
  32. package/dist/chunk-D47EKHIF.mjs +26 -0
  33. package/dist/chunk-D47EKHIF.mjs.map +1 -0
  34. package/dist/chunk-DE5K76I2.mjs +1 -0
  35. package/dist/chunk-DE5K76I2.mjs.map +1 -0
  36. package/dist/chunk-DFTV4TST.mjs +36 -0
  37. package/dist/chunk-DFTV4TST.mjs.map +1 -0
  38. package/dist/chunk-DRV2FOHZ.mjs +70 -0
  39. package/dist/chunk-DRV2FOHZ.mjs.map +1 -0
  40. package/dist/chunk-ECR45NSD.mjs +104 -0
  41. package/dist/chunk-ECR45NSD.mjs.map +1 -0
  42. package/dist/chunk-EJGGLWWR.mjs +82 -0
  43. package/dist/chunk-EJGGLWWR.mjs.map +1 -0
  44. package/dist/chunk-FYCQE57K.mjs +60 -0
  45. package/dist/chunk-FYCQE57K.mjs.map +1 -0
  46. package/dist/chunk-GQN2HYFJ.mjs +22 -0
  47. package/dist/chunk-GQN2HYFJ.mjs.map +1 -0
  48. package/dist/chunk-H4VKQGVU.mjs +1 -0
  49. package/dist/chunk-H4VKQGVU.mjs.map +1 -0
  50. package/dist/chunk-HL7EF7KA.mjs +32 -0
  51. package/dist/chunk-HL7EF7KA.mjs.map +1 -0
  52. package/dist/chunk-I3SPIGAI.mjs +31 -0
  53. package/dist/chunk-I3SPIGAI.mjs.map +1 -0
  54. package/dist/chunk-I72DKFHD.mjs +114 -0
  55. package/dist/chunk-I72DKFHD.mjs.map +1 -0
  56. package/dist/chunk-IU3WTXLQ.mjs +1 -0
  57. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  58. package/dist/chunk-J62KUPFZ.mjs +264 -0
  59. package/dist/chunk-J62KUPFZ.mjs.map +1 -0
  60. package/dist/chunk-KMVGEY7Q.mjs +51 -0
  61. package/dist/chunk-KMVGEY7Q.mjs.map +1 -0
  62. package/dist/chunk-KNQIEOFP.mjs +19 -0
  63. package/dist/chunk-KNQIEOFP.mjs.map +1 -0
  64. package/dist/chunk-L7VVZH4Q.mjs +1 -0
  65. package/dist/chunk-L7VVZH4Q.mjs.map +1 -0
  66. package/dist/chunk-LQ2OWQU7.mjs +49 -0
  67. package/dist/chunk-LQ2OWQU7.mjs.map +1 -0
  68. package/dist/chunk-LYB4B6MK.mjs +19 -0
  69. package/dist/chunk-LYB4B6MK.mjs.map +1 -0
  70. package/dist/chunk-MCNXIA4Q.mjs +75 -0
  71. package/dist/chunk-MCNXIA4Q.mjs.map +1 -0
  72. package/dist/chunk-MMVDU6DF.mjs +1 -0
  73. package/dist/chunk-MMVDU6DF.mjs.map +1 -0
  74. package/dist/chunk-MRXNTQOX.mjs +59 -0
  75. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  76. package/dist/chunk-QJNFNPWH.mjs +85 -0
  77. package/dist/chunk-QJNFNPWH.mjs.map +1 -0
  78. package/dist/chunk-RUV6NBIF.mjs +1 -0
  79. package/dist/chunk-RUV6NBIF.mjs.map +1 -0
  80. package/dist/chunk-SDHH6DI6.mjs +63 -0
  81. package/dist/chunk-SDHH6DI6.mjs.map +1 -0
  82. package/dist/chunk-T6MTDQZ7.mjs +45 -0
  83. package/dist/chunk-T6MTDQZ7.mjs.map +1 -0
  84. package/dist/chunk-UGEKMSRR.mjs +225 -0
  85. package/dist/chunk-UGEKMSRR.mjs.map +1 -0
  86. package/dist/chunk-VSVQZUPW.mjs +124 -0
  87. package/dist/chunk-VSVQZUPW.mjs.map +1 -0
  88. package/dist/chunk-WADHCMPK.mjs +1 -0
  89. package/dist/chunk-WADHCMPK.mjs.map +1 -0
  90. package/dist/chunk-WGWQRALG.mjs +83 -0
  91. package/dist/chunk-WGWQRALG.mjs.map +1 -0
  92. package/dist/chunk-WJHSY5T6.mjs +1 -0
  93. package/dist/chunk-WJHSY5T6.mjs.map +1 -0
  94. package/dist/chunk-XW3ICO4S.mjs +25 -0
  95. package/dist/chunk-XW3ICO4S.mjs.map +1 -0
  96. package/dist/chunk-YLFAIYRY.mjs +50 -0
  97. package/dist/chunk-YLFAIYRY.mjs.map +1 -0
  98. package/dist/components/base-copilot-textarea/base-copilot-textarea.css +9 -0
  99. package/dist/components/base-copilot-textarea/base-copilot-textarea.css.map +1 -0
  100. package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +1 -1
  101. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +114 -49
  102. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  103. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +36 -1687
  104. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
  105. package/dist/components/base-copilot-textarea/render-element.d.ts +1 -1
  106. package/dist/components/base-copilot-textarea/render-element.mjs +4 -48
  107. package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
  108. package/dist/components/base-copilot-textarea/render-placeholder.d.ts +1 -1
  109. package/dist/components/base-copilot-textarea/render-placeholder.mjs +4 -46
  110. package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -1
  111. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +4 -2
  112. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +1 -1
  113. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +5 -81
  114. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -1
  115. package/dist/components/base-copilot-textarea/use-add-branding-css.js.map +1 -1
  116. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +4 -54
  117. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
  118. package/dist/components/copilot-textarea/copilot-textarea.css +9 -0
  119. package/dist/components/copilot-textarea/copilot-textarea.css.map +1 -0
  120. package/dist/components/copilot-textarea/copilot-textarea.d.ts +9 -3
  121. package/dist/components/copilot-textarea/copilot-textarea.js +116 -51
  122. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  123. package/dist/components/copilot-textarea/copilot-textarea.mjs +44 -2212
  124. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
  125. package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +1 -1
  126. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +5 -13
  127. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
  128. package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +2 -1
  129. package/dist/components/hovering-toolbar/hovering-toolbar-components.js +21 -0
  130. package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -1
  131. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +9 -111
  132. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
  133. package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +1 -1
  134. package/dist/components/hovering-toolbar/hovering-toolbar.js +94 -31
  135. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  136. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +19 -808
  137. package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
  138. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +1 -1
  139. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +65 -21
  140. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  141. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +14 -520
  142. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
  143. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +1 -1
  144. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +68 -24
  145. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  146. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +15 -543
  147. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
  148. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.d.ts +16 -0
  149. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +133 -0
  150. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -0
  151. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +12 -0
  152. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +1 -0
  153. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +68 -24
  154. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  155. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +16 -543
  156. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
  157. package/dist/components/index.css +9 -0
  158. package/dist/components/index.css.map +1 -0
  159. package/dist/components/index.js +116 -51
  160. package/dist/components/index.js.map +1 -1
  161. package/dist/components/index.mjs +46 -2211
  162. package/dist/components/index.mjs.map +1 -1
  163. package/dist/components/manual-ui/chip-with-icon.d.ts +1 -1
  164. package/dist/components/manual-ui/chip-with-icon.mjs +2 -0
  165. package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
  166. package/dist/components/source-search-box/source-search-box.d.ts +1 -1
  167. package/dist/components/source-search-box/source-search-box.js +4 -2
  168. package/dist/components/source-search-box/source-search-box.js.map +1 -1
  169. package/dist/components/source-search-box/source-search-box.mjs +8 -200
  170. package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
  171. package/dist/components/ui/button.d.ts +1 -1
  172. package/dist/components/ui/button.mjs +6 -76
  173. package/dist/components/ui/button.mjs.map +1 -1
  174. package/dist/components/ui/command.mjs +14 -233
  175. package/dist/components/ui/command.mjs.map +1 -1
  176. package/dist/components/ui/dialog.mjs +11 -135
  177. package/dist/components/ui/dialog.mjs.map +1 -1
  178. package/dist/components/ui/label.mjs +5 -51
  179. package/dist/components/ui/label.mjs.map +1 -1
  180. package/dist/context/index.d.ts +1 -1
  181. package/dist/context/index.mjs +1 -0
  182. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.ts +1 -1
  183. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -1
  184. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +7 -152
  185. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
  186. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +5 -165
  187. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
  188. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js.map +1 -1
  189. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +6 -141
  190. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
  191. package/dist/hooks/index.d.ts +1 -1
  192. package/dist/hooks/index.mjs +1 -0
  193. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -1
  194. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +4 -139
  195. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
  196. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -1
  197. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +4 -221
  198. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
  199. package/dist/hooks/misc/use-autosize-textarea.mjs +4 -12
  200. package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
  201. package/dist/index.css +644 -1
  202. package/dist/index.css.map +1 -0
  203. package/dist/index.js +116 -58
  204. package/dist/index.js.map +1 -1
  205. package/dist/index.mjs +54 -2218
  206. package/dist/index.mjs.map +1 -1
  207. package/dist/lib/debouncer.d.ts +1 -1
  208. package/dist/lib/debouncer.js.map +1 -1
  209. package/dist/lib/debouncer.mjs +4 -48
  210. package/dist/lib/debouncer.mjs.map +1 -1
  211. package/dist/lib/editor-to-text.mjs +4 -40
  212. package/dist/lib/editor-to-text.mjs.map +1 -1
  213. package/dist/lib/get-text-around-cursor.d.ts +1 -1
  214. package/dist/lib/get-text-around-cursor.mjs +7 -96
  215. package/dist/lib/get-text-around-cursor.mjs.map +1 -1
  216. package/dist/lib/retry.mjs +4 -14
  217. package/dist/lib/retry.mjs.map +1 -1
  218. package/dist/lib/slatejs-edits/add-autocompletions.mjs +4 -22
  219. package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
  220. package/dist/lib/slatejs-edits/clear-autocompletions.js.map +1 -1
  221. package/dist/lib/slatejs-edits/clear-autocompletions.mjs +4 -17
  222. package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
  223. package/dist/lib/slatejs-edits/replace-text.mjs +4 -24
  224. package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
  225. package/dist/lib/slatejs-edits/with-partial-history.d.ts +1 -1
  226. package/dist/lib/slatejs-edits/with-partial-history.mjs +5 -102
  227. package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
  228. package/dist/lib/stream-promise-flatten.js.map +1 -1
  229. package/dist/lib/stream-promise-flatten.mjs +4 -44
  230. package/dist/lib/stream-promise-flatten.mjs.map +1 -1
  231. package/dist/lib/utils.mjs +8 -58
  232. package/dist/lib/utils.mjs.map +1 -1
  233. package/dist/lib/utils.test.d.ts +1 -1
  234. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +1 -1
  235. package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +1 -1
  236. package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
  237. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +9 -258
  238. package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
  239. package/dist/types/autosuggestions-config/editing-api-config.d.ts +1 -1
  240. package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -1
  241. package/dist/types/autosuggestions-config/editing-api-config.mjs +6 -75
  242. package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
  243. package/dist/types/autosuggestions-config/index.js.map +1 -1
  244. package/dist/types/autosuggestions-config/index.mjs +10 -258
  245. package/dist/types/autosuggestions-config/index.mjs.map +1 -1
  246. package/dist/types/autosuggestions-config/insertions-api-config.d.ts +1 -1
  247. package/dist/types/autosuggestions-config/insertions-api-config.js.map +1 -1
  248. package/dist/types/autosuggestions-config/insertions-api-config.mjs +6 -68
  249. package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
  250. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +1 -1
  251. package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +1 -1
  252. package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -1
  253. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +6 -56
  254. package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
  255. package/dist/types/base/autosuggestion-state.d.ts +1 -1
  256. package/dist/types/base/autosuggestions-bare-function.d.ts +1 -1
  257. package/dist/types/base/base-autosuggestions-config.d.ts +1 -1
  258. package/dist/types/base/base-autosuggestions-config.mjs +4 -25
  259. package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
  260. package/dist/types/base/custom-editor.d.ts +1 -1
  261. package/dist/types/base/editor-autocomplete-state.d.ts +1 -1
  262. package/dist/types/base/editor-autocomplete-state.mjs +5 -9
  263. package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
  264. package/dist/types/base/index.d.ts +1 -1
  265. package/dist/types/base/index.mjs +5 -25
  266. package/dist/types/base/index.mjs.map +1 -1
  267. package/dist/types/html-copilot-textarea-element.d.ts +1 -1
  268. package/dist/types/html-copilot-textarea-element.mjs +1 -0
  269. package/dist/types/index.js.map +1 -1
  270. package/dist/types/index.mjs +14 -258
  271. package/dist/types/index.mjs.map +1 -1
  272. package/package.json +11 -17
  273. package/src/components/base-copilot-textarea/base-copilot-textarea.css +9 -0
  274. package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +1 -0
  275. package/src/components/copilot-textarea/copilot-textarea.tsx +8 -2
  276. package/src/components/hovering-toolbar/hovering-toolbar-components.tsx +17 -0
  277. package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +7 -4
  278. package/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx +55 -0
  279. package/src/styles.css +2 -9
  280. package/tsup.config.ts +15 -63
  281. package/dist/components/base-copilot-textarea/base-copilot-textarea.d.mts +0 -43
  282. package/dist/components/base-copilot-textarea/render-element.d.mts +0 -6
  283. package/dist/components/base-copilot-textarea/render-placeholder.d.mts +0 -6
  284. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.mts +0 -8
  285. package/dist/components/base-copilot-textarea/use-add-branding-css.d.mts +0 -3
  286. package/dist/components/copilot-textarea/copilot-textarea.d.mts +0 -165
  287. package/dist/components/hovering-toolbar/hovering-editor-provider.d.mts +0 -18
  288. package/dist/components/hovering-toolbar/hovering-toolbar-components.d.mts +0 -17
  289. package/dist/components/hovering-toolbar/hovering-toolbar.d.mts +0 -12
  290. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.mts +0 -16
  291. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.mts +0 -14
  292. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.d.mts +0 -4
  293. package/dist/components/index.d.mts +0 -15
  294. package/dist/components/manual-ui/chip-with-icon.d.mts +0 -10
  295. package/dist/components/source-search-box/source-search-box.d.mts +0 -16
  296. package/dist/components/ui/button.d.mts +0 -14
  297. package/dist/components/ui/command.d.mts +0 -53
  298. package/dist/components/ui/dialog.d.mts +0 -19
  299. package/dist/components/ui/label.d.mts +0 -8
  300. package/dist/context/index.d.mts +0 -2
  301. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.mts +0 -15
  302. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.d.mts +0 -8
  303. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.mts +0 -7
  304. package/dist/hooks/index.d.mts +0 -2
  305. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.mts +0 -22
  306. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.d.mts +0 -23
  307. package/dist/hooks/misc/use-autosize-textarea.d.mts +0 -5
  308. package/dist/index.d.mts +0 -15
  309. package/dist/lib/debouncer.d.mts +0 -11
  310. package/dist/lib/editor-to-text.d.mts +0 -7
  311. package/dist/lib/get-text-around-cursor.d.mts +0 -15
  312. package/dist/lib/retry.d.mts +0 -3
  313. package/dist/lib/slatejs-edits/add-autocompletions.d.mts +0 -8
  314. package/dist/lib/slatejs-edits/clear-autocompletions.d.mts +0 -8
  315. package/dist/lib/slatejs-edits/replace-text.d.mts +0 -5
  316. package/dist/lib/slatejs-edits/with-partial-history.d.mts +0 -8
  317. package/dist/lib/stream-promise-flatten.d.mts +0 -12
  318. package/dist/lib/utils.d.mts +0 -9
  319. package/dist/lib/utils.test.d.mts +0 -2
  320. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.mts +0 -23
  321. package/dist/types/autosuggestions-config/autosuggestions-config.d.mts +0 -20
  322. package/dist/types/autosuggestions-config/editing-api-config.d.mts +0 -15
  323. package/dist/types/autosuggestions-config/index.d.mts +0 -10
  324. package/dist/types/autosuggestions-config/insertions-api-config.d.mts +0 -15
  325. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.mts +0 -3
  326. package/dist/types/autosuggestions-config/suggestions-api-config.d.mts +0 -14
  327. package/dist/types/base/autosuggestion-state.d.mts +0 -8
  328. package/dist/types/base/autosuggestions-bare-function.d.mts +0 -19
  329. package/dist/types/base/base-autosuggestions-config.d.mts +0 -83
  330. package/dist/types/base/base-copilot-textarea-props.d.mts +0 -5
  331. package/dist/types/base/custom-editor.d.mts +0 -29
  332. package/dist/types/base/editor-autocomplete-state.d.mts +0 -10
  333. package/dist/types/base/index.d.mts +0 -54
  334. package/dist/types/html-copilot-textarea-element.d.mts +0 -7
  335. package/dist/types/index.d.mts +0 -13
@@ -1,23 +0,0 @@
1
- import { Generator_InsertionOrEditingSuggestion } from '../../types/base/autosuggestions-bare-function.mjs';
2
- import { InsertionsApiConfig } from '../../types/autosuggestions-config/insertions-api-config.mjs';
3
- import { EditingApiConfig } from '../../types/autosuggestions-config/editing-api-config.mjs';
4
- import '@copilotkit/react-core';
5
- import '@copilotkit/runtime-client-gql';
6
- import '../../types/autosuggestions-config/subtypes/make-system-prompt.mjs';
7
-
8
- /**
9
- * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
10
- * The function takes in the text before and after the cursor, and an abort signal.
11
- * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.
12
- * The function returns the suggestion from the API response.
13
- *
14
- * @param textareaPurpose - The purpose of the textarea. This is included in the system message.
15
- * @param apiEndpoint - The API endpoint to send the autosuggestion request to.
16
- * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.
17
- * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.
18
- * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) "global" context category.
19
- * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
20
- */
21
- declare function useMakeStandardInsertionOrEditingFunction(textareaPurpose: string, contextCategories: string[], insertionApiConfig: InsertionsApiConfig, editingApiConfig: EditingApiConfig): Generator_InsertionOrEditingSuggestion;
22
-
23
- export { useMakeStandardInsertionOrEditingFunction };
@@ -1,5 +0,0 @@
1
- import { RefObject } from 'react';
2
-
3
- declare const useAutosizeTextArea: (textAreaRef: RefObject<HTMLTextAreaElement>, value: string) => void;
4
-
5
- export { useAutosizeTextArea as default };
package/dist/index.d.mts DELETED
@@ -1,15 +0,0 @@
1
- export { BaseCopilotTextarea } from './components/base-copilot-textarea/base-copilot-textarea.mjs';
2
- export { CopilotTextarea, CopilotTextareaProps } from './components/copilot-textarea/copilot-textarea.mjs';
3
- export { BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig } from './types/base/base-autosuggestions-config.mjs';
4
- export { AutosuggestionsBareFunction } from './types/base/autosuggestions-bare-function.mjs';
5
- export { BaseCopilotTextareaProps } from './types/base/index.mjs';
6
- export { HTMLCopilotTextAreaElement } from './types/html-copilot-textarea-element.mjs';
7
- export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './types/autosuggestions-config/autosuggestions-config.mjs';
8
- export { MakeSystemPrompt } from './types/autosuggestions-config/subtypes/make-system-prompt.mjs';
9
- export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './types/autosuggestions-config/autosuggestions-config-user-specified.mjs';
10
- import 'react';
11
- import '@copilotkit/react-core';
12
- import './types/autosuggestions-config/suggestions-api-config.mjs';
13
- import '@copilotkit/runtime-client-gql';
14
- import './types/autosuggestions-config/insertions-api-config.mjs';
15
- import './types/autosuggestions-config/editing-api-config.mjs';
@@ -1,11 +0,0 @@
1
- type AsyncFunction<T extends any[]> = (...args: [...T, AbortSignal]) => Promise<void>;
2
- declare class Debouncer<T extends any[]> {
3
- private wait;
4
- private timeoutId?;
5
- private activeAbortController?;
6
- constructor(wait: number);
7
- debounce: (func: AsyncFunction<T>, ...args: T) => Promise<void>;
8
- cancel: () => void;
9
- }
10
-
11
- export { type AsyncFunction, Debouncer };
@@ -1,7 +0,0 @@
1
- import { BaseEditor } from 'slate';
2
- import { HistoryEditor } from 'slate-history';
3
- import { ReactEditor } from 'slate-react';
4
-
5
- declare const editorToText: (editor: BaseEditor & ReactEditor & HistoryEditor) => string;
6
-
7
- export { editorToText };
@@ -1,15 +0,0 @@
1
- import { BaseRange, Editor, Range } from 'slate';
2
- import { EditorAutocompleteState } from '../types/base/editor-autocomplete-state.mjs';
3
-
4
- interface EditorTextState {
5
- selection: BaseRange;
6
- textBeforeCursor: string;
7
- selectedText: string;
8
- textAfterCursor: string;
9
- }
10
- declare function getTextAroundCollapsedCursor(editor: Editor): EditorAutocompleteState | null;
11
- declare function getTextAroundSelection(editor: Editor): EditorTextState | null;
12
- declare function getFullEditorTextWithNewlines(editor: Editor): string;
13
- declare function extractTextWithNewlines(editor: Editor, range: Range): string;
14
-
15
- export { type EditorTextState, extractTextWithNewlines, getFullEditorTextWithNewlines, getTextAroundCollapsedCursor, getTextAroundSelection };
@@ -1,3 +0,0 @@
1
- declare function retry<T>(fn: () => Promise<T>, retriesLeft?: number, interval?: number, backoff?: number): Promise<T>;
2
-
3
- export { retry };
@@ -1,8 +0,0 @@
1
- import { BasePoint } from 'slate';
2
- import { CustomEditor } from '../../types/base/custom-editor.mjs';
3
- import 'slate-react';
4
- import 'slate-history';
5
-
6
- declare function addAutocompletionsToEditor(editor: CustomEditor, newSuggestion: string, point: BasePoint): void;
7
-
8
- export { addAutocompletionsToEditor };
@@ -1,8 +0,0 @@
1
- import { CustomEditor } from '../../types/base/custom-editor.mjs';
2
- import 'slate';
3
- import 'slate-react';
4
- import 'slate-history';
5
-
6
- declare function clearAutocompletionsFromEditor(editor: CustomEditor): void;
7
-
8
- export { clearAutocompletionsFromEditor };
@@ -1,5 +0,0 @@
1
- import { Editor } from 'slate';
2
-
3
- declare function replaceEditorText(editor: Editor, newText: string): void;
4
-
5
- export { replaceEditorText };
@@ -1,8 +0,0 @@
1
- import { Operation, Editor } from 'slate';
2
- import { HistoryEditor } from 'slate-history';
3
-
4
- type ShouldSaveToHistory = (op: Operation, prev: Operation | undefined) => boolean;
5
- declare const withPartialHistory: <T extends Editor>(editor: T, shouldSave: ShouldSaveToHistory) => T & HistoryEditor;
6
- declare const defaultShouldSave: (op: Operation, prev: Operation | undefined) => boolean;
7
-
8
- export { type ShouldSaveToHistory, defaultShouldSave, withPartialHistory };
@@ -1,12 +0,0 @@
1
- /**
2
- * Flatten a promise of a stream, into a stream.
3
- *
4
- * Useful because a stream already includes the notion of async value delivery,
5
- * so it often makes sense to simply await the values rather than the generator of the values.
6
- *
7
- * @param {Promise<ReadableStream<A>>} promise - The promise to flatten.
8
- * @returns {ReadableStream<A>} - The flattened stream.
9
- */
10
- declare function streamPromiseFlatten<A>(promise: Promise<ReadableStream<A>>): ReadableStream<A>;
11
-
12
- export { streamPromiseFlatten };
@@ -1,9 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
-
3
- declare function cn(...inputs: ClassValue[]): string;
4
- declare function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON>;
5
- declare function formatDate(input: string | number | Date): string;
6
- declare const arraysAreEqual: (arr1: number[], arr2: number[]) => boolean;
7
- declare function nullableCompatibleEqualityCheck<T>(naiveEqualityCheck: (a: T, b: T) => boolean, a: T | null | undefined, b: T | null | undefined): boolean;
8
-
9
- export { arraysAreEqual, cn, fetcher, formatDate, nullableCompatibleEqualityCheck };
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,23 +0,0 @@
1
- import { AutosuggestionsConfig } from './autosuggestions-config.mjs';
2
- import './subtypes/make-system-prompt.mjs';
3
- import { InsertionsApiConfig } from './insertions-api-config.mjs';
4
- import { SuggestionsApiConfig } from './suggestions-api-config.mjs';
5
- import '../base/base-autosuggestions-config.mjs';
6
- import '../base/autosuggestions-bare-function.mjs';
7
- import '@copilotkit/react-core';
8
- import './editing-api-config.mjs';
9
- import '@copilotkit/runtime-client-gql';
10
-
11
- interface SuggestionsApiConfigUserSpecified extends Partial<SuggestionsApiConfig> {
12
- }
13
- interface InsertionsApiConfigUserSpecified extends Partial<InsertionsApiConfig> {
14
- }
15
- interface AutosuggestionsConfigUserSpecified extends Partial<Omit<AutosuggestionsConfig, "chatApiConfigs" | "textareaPurpose">> {
16
- textareaPurpose: string;
17
- chatApiConfigs: {
18
- suggestionsApiConfig?: SuggestionsApiConfigUserSpecified;
19
- insertionApiConfig?: InsertionsApiConfigUserSpecified;
20
- };
21
- }
22
-
23
- export type { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified };
@@ -1,20 +0,0 @@
1
- import { BaseAutosuggestionsConfig } from '../base/base-autosuggestions-config.mjs';
2
- import { SuggestionsApiConfig } from './suggestions-api-config.mjs';
3
- import { InsertionsApiConfig } from './insertions-api-config.mjs';
4
- import { EditingApiConfig } from './editing-api-config.mjs';
5
- import '../base/autosuggestions-bare-function.mjs';
6
- import '@copilotkit/react-core';
7
- import '@copilotkit/runtime-client-gql';
8
- import './subtypes/make-system-prompt.mjs';
9
-
10
- interface AutosuggestionsConfig extends Omit<BaseAutosuggestionsConfig, "apiConfig"> {
11
- contextCategories: string[];
12
- chatApiConfigs: {
13
- suggestionsApiConfig: SuggestionsApiConfig;
14
- insertionApiConfig: InsertionsApiConfig;
15
- editingApiConfig: EditingApiConfig;
16
- };
17
- }
18
- declare const defaultAutosuggestionsConfig: Omit<AutosuggestionsConfig, "textareaPurpose" | "apiEndpoint">;
19
-
20
- export { type AutosuggestionsConfig, defaultAutosuggestionsConfig };
@@ -1,15 +0,0 @@
1
- import { Message } from '@copilotkit/runtime-client-gql';
2
- import { MakeSystemPrompt } from './subtypes/make-system-prompt.mjs';
3
-
4
- interface EditingApiConfig {
5
- makeSystemPrompt: MakeSystemPrompt;
6
- fewShotMessages: Message[];
7
- forwardedParams: {
8
- [key: string]: any;
9
- } | undefined;
10
- }
11
- declare const defaultEditingMakeSystemPrompt: MakeSystemPrompt;
12
- declare const defaultEditingFewShotMessages: Message[];
13
- declare const defaultEditingApiConfig: EditingApiConfig;
14
-
15
- export { type EditingApiConfig, defaultEditingApiConfig, defaultEditingFewShotMessages, defaultEditingMakeSystemPrompt };
@@ -1,10 +0,0 @@
1
- export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './autosuggestions-config.mjs';
2
- export { MakeSystemPrompt } from './subtypes/make-system-prompt.mjs';
3
- export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './autosuggestions-config-user-specified.mjs';
4
- import '../base/base-autosuggestions-config.mjs';
5
- import '../base/autosuggestions-bare-function.mjs';
6
- import '@copilotkit/react-core';
7
- import './suggestions-api-config.mjs';
8
- import '@copilotkit/runtime-client-gql';
9
- import './insertions-api-config.mjs';
10
- import './editing-api-config.mjs';
@@ -1,15 +0,0 @@
1
- import { Message } from '@copilotkit/runtime-client-gql';
2
- import { MakeSystemPrompt } from './subtypes/make-system-prompt.mjs';
3
-
4
- interface InsertionsApiConfig {
5
- makeSystemPrompt: MakeSystemPrompt;
6
- fewShotMessages: Message[];
7
- forwardedParams: {
8
- [key: string]: any;
9
- } | undefined;
10
- }
11
- declare const defaultInsertionsMakeSystemPrompt: MakeSystemPrompt;
12
- declare const defaultInsertionsFewShotMessages: Message[];
13
- declare const defaultInsertionsApiConfig: InsertionsApiConfig;
14
-
15
- export { type InsertionsApiConfig, defaultInsertionsApiConfig, defaultInsertionsFewShotMessages, defaultInsertionsMakeSystemPrompt };
@@ -1,3 +0,0 @@
1
- type MakeSystemPrompt = (textareaPurpose: string, contextString: string) => string;
2
-
3
- export type { MakeSystemPrompt };
@@ -1,14 +0,0 @@
1
- import { Message } from '@copilotkit/runtime-client-gql';
2
- import { MakeSystemPrompt } from './subtypes/make-system-prompt.mjs';
3
-
4
- interface SuggestionsApiConfig {
5
- makeSystemPrompt: MakeSystemPrompt;
6
- fewShotMessages: Message[];
7
- maxTokens?: number;
8
- stop?: string[];
9
- }
10
- declare const defaultSuggestionsMakeSystemPrompt: MakeSystemPrompt;
11
- declare const defaultSuggestionsFewShotMessages: Message[];
12
- declare const defaultSuggestionsApiConfig: SuggestionsApiConfig;
13
-
14
- export { type SuggestionsApiConfig, defaultSuggestionsApiConfig, defaultSuggestionsFewShotMessages, defaultSuggestionsMakeSystemPrompt };
@@ -1,8 +0,0 @@
1
- import { BasePoint } from 'slate';
2
-
3
- interface AutosuggestionState {
4
- text: string;
5
- point: BasePoint;
6
- }
7
-
8
- export type { AutosuggestionState };
@@ -1,19 +0,0 @@
1
- import { DocumentPointer } from '@copilotkit/react-core';
2
-
3
- interface InsertionEditorState {
4
- textBeforeCursor: string;
5
- textAfterCursor: string;
6
- }
7
- interface EditingEditorState extends InsertionEditorState {
8
- selectedText: string;
9
- }
10
- type AutosuggestionsBareFunction = (editorState: InsertionEditorState, abortSignal: AbortSignal) => Promise<string>;
11
- type Generator_InsertionOrEditingSuggestion = (editorState: EditingEditorState, prompt: string, documents: DocumentPointer[], abortSignal: AbortSignal) => Promise<ReadableStream<string>>;
12
- interface InsertionEditorApiConfig {
13
- insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;
14
- }
15
- interface BaseCopilotTextareaApiConfig extends InsertionEditorApiConfig {
16
- autosuggestionsFunction: AutosuggestionsBareFunction;
17
- }
18
-
19
- export type { AutosuggestionsBareFunction, BaseCopilotTextareaApiConfig, EditingEditorState, Generator_InsertionOrEditingSuggestion, InsertionEditorApiConfig, InsertionEditorState };
@@ -1,83 +0,0 @@
1
- import { BaseCopilotTextareaApiConfig } from './autosuggestions-bare-function.mjs';
2
- import '@copilotkit/react-core';
3
-
4
- /**
5
- * @interface BaseAutosuggestionsConfig
6
- *
7
- * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.
8
- *
9
- * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.
10
- *
11
- * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.
12
- *
13
- * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.
14
- *
15
- * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.
16
- *
17
- * @property {boolean} disabled - Whether to disable autosuggestions entirely.
18
- *
19
- * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.
20
- *
21
- * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the current autosuggestion based on a key press event. By default, the Tab key is used to accept the autosuggestion. Example code:
22
- *
23
- * ```typescript
24
- * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {
25
- * // if tab, accept the autosuggestion
26
- * if (event.key === "Tab") {
27
- * return true;
28
- * }
29
- * return false;
30
- * }
31
- * ```
32
- *
33
- * @property {(event: React.TouchEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the current autosuggestion based on a mobile touch event. By default, the touching the end of a suggestion will accept it. Example code:
34
- *
35
- * ```typescript
36
- * const shouldAcceptAutosuggestionOnTouch = (event: React.TouchEvent<HTMLDivElement>) => {
37
- * // if tab, accept the autosuggestion
38
- * if (event.type === "touchstart") {
39
- * return true;
40
- * }
41
- * return false;
42
- * }
43
- * ```
44
- *
45
- * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event. By default, the Command + K key combination is used to toggle the hovering editor. Example code:
46
- *
47
- * ```typescript
48
- * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {
49
- * // if command-k, toggle the hovering editor
50
- * if (event.key === "k" && event.metaKey) {
51
- * return true;
52
- * }
53
- * return false;
54
- * }
55
- * ```
56
- */
57
- interface BaseAutosuggestionsConfig {
58
- textareaPurpose: string;
59
- contextCategories: string[];
60
- debounceTime: number;
61
- apiConfig: BaseCopilotTextareaApiConfig;
62
- disableWhenEmpty: boolean;
63
- disabled: boolean;
64
- temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;
65
- shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;
66
- shouldAcceptAutosuggestionOnTouch: (event: React.TouchEvent<HTMLDivElement>) => boolean;
67
- shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>, shortcut: string) => boolean;
68
- }
69
- /**
70
- * Default configuration for the BaseAutosuggestions.
71
- *
72
- * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.
73
- * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.
74
- * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.
75
- * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.
76
- * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.
77
- * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.
78
- * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.
79
- * @property {() => boolean} defaultShouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the autosuggestion based on a mobile touch event.
80
- */
81
- declare const defaultBaseAutosuggestionsConfig: Omit<BaseAutosuggestionsConfig, "textareaPurpose" | "apiConfig">;
82
-
83
- export { type BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig };
@@ -1,5 +0,0 @@
1
- import 'react';
2
- import './base-autosuggestions-config.mjs';
3
- import './autosuggestions-bare-function.mjs';
4
- export { BaseCopilotTextareaProps } from './index.mjs';
5
- import '@copilotkit/react-core';
@@ -1,29 +0,0 @@
1
- import { BaseEditor } from 'slate';
2
- import { ReactEditor } from 'slate-react';
3
- import { HistoryEditor } from 'slate-history';
4
-
5
- type CustomEditor = BaseEditor & ReactEditor & HistoryEditor;
6
- type ParagraphElement = {
7
- type: "paragraph";
8
- children: CustomText[];
9
- };
10
- type SuggestionElement = {
11
- type: "suggestion";
12
- inline: boolean;
13
- content: string;
14
- children: CustomText[];
15
- };
16
- type CustomElement = ParagraphElement | SuggestionElement;
17
- type SuggestionAwareText = {
18
- text: string;
19
- };
20
- type CustomText = SuggestionAwareText;
21
- declare module "slate" {
22
- interface CustomTypes {
23
- Editor: CustomEditor;
24
- Element: CustomElement;
25
- Text: CustomText;
26
- }
27
- }
28
-
29
- export type { CustomEditor, CustomElement, CustomText, ParagraphElement, SuggestionAwareText, SuggestionElement };
@@ -1,10 +0,0 @@
1
- import { BasePoint } from 'slate';
2
-
3
- interface EditorAutocompleteState {
4
- cursorPoint: BasePoint;
5
- textBeforeCursor: string;
6
- textAfterCursor: string;
7
- }
8
- declare function areEqual_autocompleteState(prev: EditorAutocompleteState, next: EditorAutocompleteState): boolean;
9
-
10
- export { type EditorAutocompleteState, areEqual_autocompleteState };
@@ -1,54 +0,0 @@
1
- import { BaseAutosuggestionsConfig } from './base-autosuggestions-config.mjs';
2
- export { defaultBaseAutosuggestionsConfig } from './base-autosuggestions-config.mjs';
3
- import { BaseCopilotTextareaApiConfig } from './autosuggestions-bare-function.mjs';
4
- export { AutosuggestionsBareFunction } from './autosuggestions-bare-function.mjs';
5
- import { TextareaHTMLAttributes } from 'react';
6
- import '@copilotkit/react-core';
7
-
8
- /**
9
- * `BaseCopilotTextareaProps` defines the properties for the `BaseCopilotTextarea` component.
10
- */
11
- interface BaseCopilotTextareaProps extends Omit<TextareaHTMLAttributes<HTMLDivElement>, "onChange"> {
12
- /**
13
- * Determines whether the CopilotKit branding should be disabled. Default is `false`.
14
- */
15
- disableBranding?: boolean;
16
- /**
17
- * Specifies the CSS styles to apply to the placeholder text.
18
- */
19
- placeholderStyle?: React.CSSProperties;
20
- /**
21
- * Specifies the CSS styles to apply to the suggestions list.
22
- */
23
- suggestionsStyle?: React.CSSProperties;
24
- /**
25
- * A class name to apply to the editor popover window.
26
- */
27
- hoverMenuClassname?: string;
28
- /**
29
- * The initial value of the textarea. Can be controlled via `onValueChange`.
30
- */
31
- value?: string;
32
- /**
33
- * Callback invoked when the value of the textarea changes.
34
- */
35
- onValueChange?: (value: string) => void;
36
- /**
37
- * Callback invoked when a `change` event is triggered on the textarea element.
38
- */
39
- onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
40
- /**
41
- * The shortcut to use to open the editor popover window. Default is `"Cmd-k"`.
42
- */
43
- shortcut?: string;
44
- /**
45
- * Configuration settings for the autosuggestions feature.
46
- * Includes a mandatory `textareaPurpose` to guide the autosuggestions.
47
- */
48
- baseAutosuggestionsConfig: Partial<BaseAutosuggestionsConfig> & {
49
- textareaPurpose: string;
50
- apiConfig: BaseCopilotTextareaApiConfig;
51
- };
52
- }
53
-
54
- export { BaseAutosuggestionsConfig, type BaseCopilotTextareaProps };
@@ -1,7 +0,0 @@
1
- interface HTMLCopilotTextAreaElement extends HTMLElement {
2
- value: string;
3
- focus: () => void;
4
- blur: () => void;
5
- }
6
-
7
- export type { HTMLCopilotTextAreaElement };
@@ -1,13 +0,0 @@
1
- export { BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig } from './base/base-autosuggestions-config.mjs';
2
- export { AutosuggestionsBareFunction } from './base/autosuggestions-bare-function.mjs';
3
- export { BaseCopilotTextareaProps } from './base/index.mjs';
4
- export { HTMLCopilotTextAreaElement } from './html-copilot-textarea-element.mjs';
5
- export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './autosuggestions-config/autosuggestions-config.mjs';
6
- export { MakeSystemPrompt } from './autosuggestions-config/subtypes/make-system-prompt.mjs';
7
- export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './autosuggestions-config/autosuggestions-config-user-specified.mjs';
8
- import '@copilotkit/react-core';
9
- import 'react';
10
- import './autosuggestions-config/suggestions-api-config.mjs';
11
- import '@copilotkit/runtime-client-gql';
12
- import './autosuggestions-config/insertions-api-config.mjs';
13
- import './autosuggestions-config/editing-api-config.mjs';