@copilotkit/react-textarea 0.28.0-alpha.8 → 0.28.0

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 (339) hide show
  1. package/.turbo/turbo-build.log +429 -467
  2. package/CHANGELOG.md +45 -0
  3. package/dist/chunk-224UKA7C.mjs +9 -4
  4. package/dist/chunk-224UKA7C.mjs.map +1 -1
  5. package/dist/chunk-2C7O2EVM.mjs +4 -4
  6. package/dist/chunk-2C7O2EVM.mjs.map +1 -1
  7. package/dist/chunk-2QDCE7PD.mjs +6 -3
  8. package/dist/chunk-2QDCE7PD.mjs.map +1 -1
  9. package/dist/chunk-3PQ7GSFE.mjs +4 -4
  10. package/dist/chunk-3PQ7GSFE.mjs.map +1 -1
  11. package/dist/chunk-4NHVQZ67.mjs +6 -5
  12. package/dist/chunk-4NHVQZ67.mjs.map +1 -1
  13. package/dist/chunk-4OJ3H65F.mjs +5 -2
  14. package/dist/chunk-4OJ3H65F.mjs.map +1 -1
  15. package/dist/chunk-5J3UZV77.mjs +23 -11
  16. package/dist/chunk-5J3UZV77.mjs.map +1 -1
  17. package/dist/chunk-5UNJXFUO.mjs +4 -4
  18. package/dist/chunk-5UNJXFUO.mjs.map +1 -1
  19. package/dist/chunk-72P3KOHZ.mjs +17 -7
  20. package/dist/chunk-72P3KOHZ.mjs.map +1 -1
  21. package/dist/chunk-7LSRNPNI.mjs +4 -4
  22. package/dist/chunk-7LSRNPNI.mjs.map +1 -1
  23. package/dist/chunk-7SUZ6CXM.mjs +15 -6
  24. package/dist/chunk-7SUZ6CXM.mjs.map +1 -1
  25. package/dist/chunk-AZHILHKM.mjs +21 -8
  26. package/dist/chunk-AZHILHKM.mjs.map +1 -1
  27. package/dist/chunk-B6TKVDDY.mjs +58 -22
  28. package/dist/chunk-B6TKVDDY.mjs.map +1 -1
  29. package/dist/chunk-BBZ7AWOB.mjs +8 -4
  30. package/dist/chunk-BBZ7AWOB.mjs.map +1 -1
  31. package/dist/chunk-DE5K76I2.mjs +0 -2
  32. package/dist/chunk-DE5K76I2.mjs.map +1 -1
  33. package/dist/chunk-DRV2FOHZ.mjs +11 -6
  34. package/dist/chunk-DRV2FOHZ.mjs.map +1 -1
  35. package/dist/chunk-ECR45NSD.mjs +7 -4
  36. package/dist/chunk-ECR45NSD.mjs.map +1 -1
  37. package/dist/chunk-FJNUPSQK.mjs +16 -5
  38. package/dist/chunk-FJNUPSQK.mjs.map +1 -1
  39. package/dist/chunk-FP2EKU3L.mjs +4 -4
  40. package/dist/chunk-FP2EKU3L.mjs.map +1 -1
  41. package/dist/chunk-GQN2HYFJ.mjs +4 -4
  42. package/dist/chunk-GQN2HYFJ.mjs.map +1 -1
  43. package/dist/chunk-H4VKQGVU.mjs +0 -2
  44. package/dist/chunk-H4VKQGVU.mjs.map +1 -1
  45. package/dist/chunk-IU3WTXLQ.mjs +0 -2
  46. package/dist/chunk-IU3WTXLQ.mjs.map +1 -1
  47. package/dist/chunk-JJLQVT7S.mjs +6 -3
  48. package/dist/chunk-JJLQVT7S.mjs.map +1 -1
  49. package/dist/chunk-KDVMG3XF.mjs +5 -2
  50. package/dist/chunk-KDVMG3XF.mjs.map +1 -1
  51. package/dist/chunk-KFQZHRPJ.mjs +15 -8
  52. package/dist/chunk-KFQZHRPJ.mjs.map +1 -1
  53. package/dist/chunk-KNQIEOFP.mjs +3 -2
  54. package/dist/chunk-KNQIEOFP.mjs.map +1 -1
  55. package/dist/chunk-L7VVZH4Q.mjs +0 -2
  56. package/dist/chunk-L7VVZH4Q.mjs.map +1 -1
  57. package/dist/chunk-LQ2OWQU7.mjs +11 -7
  58. package/dist/chunk-LQ2OWQU7.mjs.map +1 -1
  59. package/dist/chunk-LYB4B6MK.mjs +6 -5
  60. package/dist/chunk-LYB4B6MK.mjs.map +1 -1
  61. package/dist/chunk-M2DR4KVB.mjs +6 -3
  62. package/dist/chunk-M2DR4KVB.mjs.map +1 -1
  63. package/dist/chunk-MMVDU6DF.mjs +0 -2
  64. package/dist/chunk-MMVDU6DF.mjs.map +1 -1
  65. package/dist/chunk-MRXNTQOX.mjs +6 -2
  66. package/dist/chunk-MRXNTQOX.mjs.map +1 -1
  67. package/dist/chunk-P4QVFRLY.mjs +17 -7
  68. package/dist/chunk-P4QVFRLY.mjs.map +1 -1
  69. package/dist/chunk-PTZVE6NC.mjs +22 -8
  70. package/dist/chunk-PTZVE6NC.mjs.map +1 -1
  71. package/dist/chunk-QCPS6IYI.mjs +15 -6
  72. package/dist/chunk-QCPS6IYI.mjs.map +1 -1
  73. package/dist/chunk-RKQ6RTZM.mjs +5 -2
  74. package/dist/chunk-RKQ6RTZM.mjs.map +1 -1
  75. package/dist/chunk-RT4UTBH3.mjs +15 -6
  76. package/dist/chunk-RT4UTBH3.mjs.map +1 -1
  77. package/dist/chunk-RUV6NBIF.mjs +0 -2
  78. package/dist/chunk-RUV6NBIF.mjs.map +1 -1
  79. package/dist/chunk-SNQEBH5I.mjs +24 -10
  80. package/dist/chunk-SNQEBH5I.mjs.map +1 -1
  81. package/dist/chunk-SX6NY5FW.mjs +11 -6
  82. package/dist/chunk-SX6NY5FW.mjs.map +1 -1
  83. package/dist/chunk-T6MTDQZ7.mjs +4 -4
  84. package/dist/chunk-T6MTDQZ7.mjs.map +1 -1
  85. package/dist/chunk-VB4VNCIQ.mjs +28 -12
  86. package/dist/chunk-VB4VNCIQ.mjs.map +1 -1
  87. package/dist/chunk-VPEH6V7T.mjs +12 -6
  88. package/dist/chunk-VPEH6V7T.mjs.map +1 -1
  89. package/dist/chunk-WADHCMPK.mjs +0 -2
  90. package/dist/chunk-WADHCMPK.mjs.map +1 -1
  91. package/dist/chunk-WFTAAA7R.mjs +16 -8
  92. package/dist/chunk-WFTAAA7R.mjs.map +1 -1
  93. package/dist/chunk-WJHSY5T6.mjs +0 -2
  94. package/dist/chunk-WJHSY5T6.mjs.map +1 -1
  95. package/dist/chunk-WTASPE2W.mjs +41 -22
  96. package/dist/chunk-WTASPE2W.mjs.map +1 -1
  97. package/dist/chunk-XW3ICO4S.mjs +10 -4
  98. package/dist/chunk-XW3ICO4S.mjs.map +1 -1
  99. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +379 -257
  100. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  101. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +39 -35
  102. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
  103. package/dist/components/base-copilot-textarea/render-element.js +32 -11
  104. package/dist/components/base-copilot-textarea/render-element.js.map +1 -1
  105. package/dist/components/base-copilot-textarea/render-element.mjs +7 -3
  106. package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
  107. package/dist/components/base-copilot-textarea/render-placeholder.js +29 -8
  108. package/dist/components/base-copilot-textarea/render-placeholder.js.map +1 -1
  109. package/dist/components/base-copilot-textarea/render-placeholder.mjs +7 -3
  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 +44 -17
  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 +8 -4
  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 +29 -7
  116. package/dist/components/base-copilot-textarea/use-add-branding-css.js.map +1 -1
  117. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +7 -3
  118. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
  119. package/dist/components/copilot-textarea/copilot-textarea.js +414 -272
  120. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  121. package/dist/components/copilot-textarea/copilot-textarea.mjs +48 -44
  122. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
  123. package/dist/components/hovering-toolbar/hovering-editor-provider.js +35 -12
  124. package/dist/components/hovering-toolbar/hovering-editor-provider.js.map +1 -1
  125. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +9 -3
  126. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
  127. package/dist/components/hovering-toolbar/hovering-toolbar-components.js +66 -36
  128. package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -1
  129. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +15 -3
  130. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
  131. package/dist/components/hovering-toolbar/hovering-toolbar.js +247 -179
  132. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  133. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +22 -18
  134. package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
  135. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +180 -129
  136. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  137. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +16 -12
  138. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
  139. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +185 -131
  140. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  141. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +17 -13
  142. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
  143. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +71 -55
  144. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -1
  145. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +11 -5
  146. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +1 -1
  147. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +185 -131
  148. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  149. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +18 -14
  150. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
  151. package/dist/components/index.js +418 -273
  152. package/dist/components/index.js.map +1 -1
  153. package/dist/components/index.mjs +52 -45
  154. package/dist/components/index.mjs.map +1 -1
  155. package/dist/components/manual-ui/chip-with-icon.js +31 -9
  156. package/dist/components/manual-ui/chip-with-icon.js.map +1 -1
  157. package/dist/components/manual-ui/chip-with-icon.mjs +6 -5
  158. package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
  159. package/dist/components/source-search-box/source-search-box.js +104 -72
  160. package/dist/components/source-search-box/source-search-box.js.map +1 -1
  161. package/dist/components/source-search-box/source-search-box.mjs +12 -6
  162. package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
  163. package/dist/components/ui/button.js +56 -40
  164. package/dist/components/ui/button.js.map +1 -1
  165. package/dist/components/ui/button.mjs +10 -4
  166. package/dist/components/ui/button.mjs.map +1 -1
  167. package/dist/components/ui/card.js +70 -50
  168. package/dist/components/ui/card.js.map +1 -1
  169. package/dist/components/ui/card.mjs +18 -7
  170. package/dist/components/ui/card.mjs.map +1 -1
  171. package/dist/components/ui/command.js +139 -97
  172. package/dist/components/ui/command.js.map +1 -1
  173. package/dist/components/ui/command.mjs +26 -5
  174. package/dist/components/ui/command.mjs.map +1 -1
  175. package/dist/components/ui/dialog.js +90 -69
  176. package/dist/components/ui/dialog.js.map +1 -1
  177. package/dist/components/ui/dialog.mjs +21 -4
  178. package/dist/components/ui/dialog.mjs.map +1 -1
  179. package/dist/components/ui/label.js +55 -40
  180. package/dist/components/ui/label.js.map +1 -1
  181. package/dist/components/ui/label.mjs +9 -4
  182. package/dist/components/ui/label.mjs.map +1 -1
  183. package/dist/components/ui/separator.js +54 -39
  184. package/dist/components/ui/separator.js.map +1 -1
  185. package/dist/components/ui/separator.mjs +15 -8
  186. package/dist/components/ui/separator.mjs.map +1 -1
  187. package/dist/components/ui/textarea.js +50 -35
  188. package/dist/components/ui/textarea.js.map +1 -1
  189. package/dist/components/ui/textarea.mjs +13 -7
  190. package/dist/components/ui/textarea.mjs.map +1 -1
  191. package/dist/context/index.js +17 -2
  192. package/dist/context/index.js.map +1 -1
  193. package/dist/context/index.mjs +1 -2
  194. package/dist/context/index.mjs.map +1 -1
  195. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js +43 -18
  196. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -1
  197. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +10 -6
  198. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
  199. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js +50 -25
  200. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js.map +1 -1
  201. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +8 -4
  202. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
  203. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js +62 -29
  204. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js.map +1 -1
  205. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +9 -5
  206. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
  207. package/dist/hooks/index.js +17 -2
  208. package/dist/hooks/index.js.map +1 -1
  209. package/dist/hooks/index.mjs +1 -2
  210. package/dist/hooks/index.mjs.map +1 -1
  211. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +35 -11
  212. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -1
  213. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +8 -4
  214. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
  215. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +38 -14
  216. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -1
  217. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +8 -4
  218. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
  219. package/dist/hooks/misc/use-autosize-textarea.js +25 -7
  220. package/dist/hooks/misc/use-autosize-textarea.js.map +1 -1
  221. package/dist/hooks/misc/use-autosize-textarea.mjs +7 -3
  222. package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
  223. package/dist/index.js +422 -275
  224. package/dist/index.js.map +1 -1
  225. package/dist/index.mjs +62 -49
  226. package/dist/index.mjs.map +1 -1
  227. package/dist/lib/debouncer.js +27 -5
  228. package/dist/lib/debouncer.js.map +1 -1
  229. package/dist/lib/debouncer.mjs +7 -3
  230. package/dist/lib/debouncer.mjs.map +1 -1
  231. package/dist/lib/editor-to-text.js +30 -8
  232. package/dist/lib/editor-to-text.js.map +1 -1
  233. package/dist/lib/editor-to-text.mjs +7 -3
  234. package/dist/lib/editor-to-text.mjs.map +1 -1
  235. package/dist/lib/get-text-around-cursor.js +49 -24
  236. package/dist/lib/get-text-around-cursor.js.map +1 -1
  237. package/dist/lib/get-text-around-cursor.mjs +13 -3
  238. package/dist/lib/get-text-around-cursor.mjs.map +1 -1
  239. package/dist/lib/retry.js +27 -4
  240. package/dist/lib/retry.js.map +1 -1
  241. package/dist/lib/retry.mjs +7 -3
  242. package/dist/lib/retry.mjs.map +1 -1
  243. package/dist/lib/slatejs-edits/add-autocompletions.js +29 -7
  244. package/dist/lib/slatejs-edits/add-autocompletions.js.map +1 -1
  245. package/dist/lib/slatejs-edits/add-autocompletions.mjs +7 -3
  246. package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
  247. package/dist/lib/slatejs-edits/clear-autocompletions.js +31 -9
  248. package/dist/lib/slatejs-edits/clear-autocompletions.js.map +1 -1
  249. package/dist/lib/slatejs-edits/clear-autocompletions.mjs +7 -3
  250. package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
  251. package/dist/lib/slatejs-edits/replace-text.js +32 -10
  252. package/dist/lib/slatejs-edits/replace-text.js.map +1 -1
  253. package/dist/lib/slatejs-edits/replace-text.mjs +7 -3
  254. package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
  255. package/dist/lib/slatejs-edits/with-partial-history.js +42 -19
  256. package/dist/lib/slatejs-edits/with-partial-history.js.map +1 -1
  257. package/dist/lib/slatejs-edits/with-partial-history.mjs +9 -3
  258. package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
  259. package/dist/lib/stream-promise-flatten.js +27 -5
  260. package/dist/lib/stream-promise-flatten.js.map +1 -1
  261. package/dist/lib/stream-promise-flatten.mjs +7 -3
  262. package/dist/lib/stream-promise-flatten.mjs.map +1 -1
  263. package/dist/lib/utils.js +44 -16
  264. package/dist/lib/utils.js.map +1 -1
  265. package/dist/lib/utils.mjs +17 -3
  266. package/dist/lib/utils.mjs.map +1 -1
  267. package/dist/lib/utils.test.js +1 -2
  268. package/dist/lib/utils.test.js.map +1 -1
  269. package/dist/lib/utils.test.mjs +0 -1
  270. package/dist/lib/utils.test.mjs.map +1 -1
  271. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js +17 -2
  272. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js.map +1 -1
  273. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +0 -2
  274. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -1
  275. package/dist/types/autosuggestions-config/autosuggestions-config.js +35 -9
  276. package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
  277. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +12 -8
  278. package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
  279. package/dist/types/autosuggestions-config/editing-api-config.js +31 -6
  280. package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -1
  281. package/dist/types/autosuggestions-config/editing-api-config.mjs +11 -3
  282. package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
  283. package/dist/types/autosuggestions-config/index.js +35 -9
  284. package/dist/types/autosuggestions-config/index.js.map +1 -1
  285. package/dist/types/autosuggestions-config/index.mjs +13 -9
  286. package/dist/types/autosuggestions-config/index.mjs.map +1 -1
  287. package/dist/types/autosuggestions-config/insertions-api-config.js +31 -6
  288. package/dist/types/autosuggestions-config/insertions-api-config.js.map +1 -1
  289. package/dist/types/autosuggestions-config/insertions-api-config.mjs +11 -3
  290. package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
  291. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js +17 -2
  292. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js.map +1 -1
  293. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +0 -2
  294. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -1
  295. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js +17 -2
  296. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js.map +1 -1
  297. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs +0 -2
  298. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -1
  299. package/dist/types/autosuggestions-config/suggestions-api-config.js +31 -6
  300. package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -1
  301. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +11 -3
  302. package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
  303. package/dist/types/base/autosuggestion-state.js +17 -2
  304. package/dist/types/base/autosuggestion-state.js.map +1 -1
  305. package/dist/types/base/autosuggestion-state.mjs +0 -2
  306. package/dist/types/base/autosuggestion-state.mjs.map +1 -1
  307. package/dist/types/base/autosuggestions-bare-function.js +17 -2
  308. package/dist/types/base/autosuggestions-bare-function.js.map +1 -1
  309. package/dist/types/base/autosuggestions-bare-function.mjs +0 -2
  310. package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -1
  311. package/dist/types/base/base-autosuggestions-config.js +29 -7
  312. package/dist/types/base/base-autosuggestions-config.js.map +1 -1
  313. package/dist/types/base/base-autosuggestions-config.mjs +7 -3
  314. package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
  315. package/dist/types/base/base-copilot-textarea-props.js +17 -2
  316. package/dist/types/base/base-copilot-textarea-props.js.map +1 -1
  317. package/dist/types/base/base-copilot-textarea-props.mjs +0 -2
  318. package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -1
  319. package/dist/types/base/custom-editor.js +17 -2
  320. package/dist/types/base/custom-editor.js.map +1 -1
  321. package/dist/types/base/custom-editor.mjs +0 -2
  322. package/dist/types/base/custom-editor.mjs.map +1 -1
  323. package/dist/types/base/editor-autocomplete-state.js +32 -8
  324. package/dist/types/base/editor-autocomplete-state.js.map +1 -1
  325. package/dist/types/base/editor-autocomplete-state.mjs +8 -4
  326. package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
  327. package/dist/types/base/index.js +30 -6
  328. package/dist/types/base/index.js.map +1 -1
  329. package/dist/types/base/index.mjs +8 -4
  330. package/dist/types/base/index.mjs.map +1 -1
  331. package/dist/types/html-copilot-textarea-element.js +17 -2
  332. package/dist/types/html-copilot-textarea-element.js.map +1 -1
  333. package/dist/types/html-copilot-textarea-element.mjs +1 -2
  334. package/dist/types/html-copilot-textarea-element.mjs.map +1 -1
  335. package/dist/types/index.js +37 -10
  336. package/dist/types/index.js.map +1 -1
  337. package/dist/types/index.mjs +18 -11
  338. package/dist/types/index.mjs.map +1 -1
  339. package/package.json +8 -8
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
1
  //# sourceMappingURL=make-system-prompt.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
15
 
3
- //# sourceMappingURL=out.js.map
16
+ // src/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.tsx
17
+ var minimal_chat_gpt_message_exports = {};
18
+ module.exports = __toCommonJS(minimal_chat_gpt_message_exports);
4
19
  //# sourceMappingURL=minimal-chat-gpt-message.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../../src/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.tsx"],"sourcesContent":["export interface MinimalChatGPTMessage {\n role: string;\n content: string;\n name?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
1
  //# sourceMappingURL=minimal-chat-gpt-message.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,6 +1,30 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
20
  // src/types/autosuggestions-config/suggestions-api-config.tsx
21
+ var suggestions_api_config_exports = {};
22
+ __export(suggestions_api_config_exports, {
23
+ defaultSuggestionsApiConfig: () => defaultSuggestionsApiConfig,
24
+ defaultSuggestionsFewShotMessages: () => defaultSuggestionsFewShotMessages,
25
+ defaultSuggestionsMakeSystemPrompt: () => defaultSuggestionsMakeSystemPrompt
26
+ });
27
+ module.exports = __toCommonJS(suggestions_api_config_exports);
4
28
  var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
5
29
  return `You are a versatile writing assistant.
6
30
 
@@ -59,9 +83,10 @@ var defaultSuggestionsApiConfig = {
59
83
  fewShotMessages: defaultSuggestionsFewShotMessages,
60
84
  forwardedParams: void 0
61
85
  };
62
-
63
- exports.defaultSuggestionsApiConfig = defaultSuggestionsApiConfig;
64
- exports.defaultSuggestionsFewShotMessages = defaultSuggestionsFewShotMessages;
65
- exports.defaultSuggestionsMakeSystemPrompt = defaultSuggestionsMakeSystemPrompt;
66
- //# sourceMappingURL=out.js.map
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ defaultSuggestionsApiConfig,
89
+ defaultSuggestionsFewShotMessages,
90
+ defaultSuggestionsMakeSystemPrompt
91
+ });
67
92
  //# sourceMappingURL=suggestions-api-config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/autosuggestions-config/suggestions-api-config.tsx"],"names":[],"mappings":";AASO,IAAM,qCAAuD,CAClE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBlB;AAAA;AAAA;AAGF;AAEO,IAAM,oCAA6D;AAAA,EACxE;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AACF;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB","sourcesContent":["import { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultSuggestionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nYour job is to guess what the user will write next AS BEST YOU CAN.\nOnly guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.\n<TextAfterCursor>\n<TextBeforeCursor>\n<YourSuggestion>\n\nIf we need to add a whitespace character to the suggested text, make sure to explicitly add it in.\n\nThe following external context is also provided. Use it to help you make better suggestions!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n`;\n};\n\nexport const defaultSuggestionsFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content: \"While I was there I also picked up some apples, oranges, and bananas.\",\n },\n {\n role: \"user\",\n content: \"This morning I woke up and went straight to the grocery store.\",\n },\n {\n role: \"assistant\",\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n },\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.\",\n },\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content:\n 'The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;',\n },\n {\n role: \"assistant\",\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n },\n];\n\nexport const defaultSuggestionsApiConfig: SuggestionsApiConfig = {\n makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,\n fewShotMessages: defaultSuggestionsFewShotMessages,\n forwardedParams: undefined,\n};\n"]}
1
+ {"version":3,"sources":["../../../src/types/autosuggestions-config/suggestions-api-config.tsx"],"sourcesContent":["import { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultSuggestionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nYour job is to guess what the user will write next AS BEST YOU CAN.\nOnly guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.\n<TextAfterCursor>\n<TextBeforeCursor>\n<YourSuggestion>\n\nIf we need to add a whitespace character to the suggested text, make sure to explicitly add it in.\n\nThe following external context is also provided. Use it to help you make better suggestions!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n`;\n};\n\nexport const defaultSuggestionsFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content: \"While I was there I also picked up some apples, oranges, and bananas.\",\n },\n {\n role: \"user\",\n content: \"This morning I woke up and went straight to the grocery store.\",\n },\n {\n role: \"assistant\",\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n },\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.\",\n },\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content:\n 'The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;',\n },\n {\n role: \"assistant\",\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n },\n];\n\nexport const defaultSuggestionsApiConfig: SuggestionsApiConfig = {\n makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,\n fewShotMessages: defaultSuggestionsFewShotMessages,\n forwardedParams: undefined,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,qCAAuD,CAClE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBlB;AAAA;AAAA;AAGF;AAEO,IAAM,oCAA6D;AAAA,EACxE;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AACF;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
@@ -1,4 +1,12 @@
1
- export { defaultSuggestionsApiConfig, defaultSuggestionsFewShotMessages, defaultSuggestionsMakeSystemPrompt } from '../../chunk-KDVMG3XF.mjs';
2
- import '../../chunk-MRXNTQOX.mjs';
3
- //# sourceMappingURL=out.js.map
1
+ import {
2
+ defaultSuggestionsApiConfig,
3
+ defaultSuggestionsFewShotMessages,
4
+ defaultSuggestionsMakeSystemPrompt
5
+ } from "../../chunk-KDVMG3XF.mjs";
6
+ import "../../chunk-MRXNTQOX.mjs";
7
+ export {
8
+ defaultSuggestionsApiConfig,
9
+ defaultSuggestionsFewShotMessages,
10
+ defaultSuggestionsMakeSystemPrompt
11
+ };
4
12
  //# sourceMappingURL=suggestions-api-config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
15
 
3
- //# sourceMappingURL=out.js.map
16
+ // src/types/base/autosuggestion-state.ts
17
+ var autosuggestion_state_exports = {};
18
+ module.exports = __toCommonJS(autosuggestion_state_exports);
4
19
  //# sourceMappingURL=autosuggestion-state.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../src/types/base/autosuggestion-state.ts"],"sourcesContent":["import { BasePoint } from \"slate\";\n\nexport interface AutosuggestionState {\n text: string;\n point: BasePoint;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
1
  //# sourceMappingURL=autosuggestion-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
15
 
3
- //# sourceMappingURL=out.js.map
16
+ // src/types/base/autosuggestions-bare-function.ts
17
+ var autosuggestions_bare_function_exports = {};
18
+ module.exports = __toCommonJS(autosuggestions_bare_function_exports);
4
19
  //# sourceMappingURL=autosuggestions-bare-function.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../src/types/base/autosuggestions-bare-function.ts"],"sourcesContent":["import { DocumentPointer } from \"@copilotkit/react-core\";\n\nexport interface InsertionEditorState {\n textBeforeCursor: string;\n textAfterCursor: string;\n}\n\nexport interface EditingEditorState extends InsertionEditorState {\n selectedText: string;\n}\n\nexport type AutosuggestionsBareFunction = (\n editorState: InsertionEditorState,\n abortSignal: AbortSignal,\n) => Promise<string>;\n\nexport type Generator_InsertionOrEditingSuggestion = (\n editorState: EditingEditorState,\n prompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n) => Promise<ReadableStream<string>>;\n\nexport interface InsertionEditorApiConfig {\n insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;\n}\n\nexport interface BaseCopilotTextareaApiConfig extends InsertionEditorApiConfig {\n autosuggestionsFunction: AutosuggestionsBareFunction;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
1
  //# sourceMappingURL=autosuggestions-bare-function.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +1,29 @@
1
- 'use strict';
2
-
3
- var reactCore = require('@copilotkit/react-core');
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
4
19
 
5
20
  // src/types/base/base-autosuggestions-config.tsx
21
+ var base_autosuggestions_config_exports = {};
22
+ __export(base_autosuggestions_config_exports, {
23
+ defaultBaseAutosuggestionsConfig: () => defaultBaseAutosuggestionsConfig
24
+ });
25
+ module.exports = __toCommonJS(base_autosuggestions_config_exports);
26
+ var import_react_core = require("@copilotkit/react-core");
6
27
  var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
7
28
  if (event.key === "k" && event.metaKey) {
8
29
  return true;
@@ -17,14 +38,15 @@ var defaultShouldAcceptAutosuggestionOnKeyPress = (event) => {
17
38
  };
18
39
  var defaultBaseAutosuggestionsConfig = {
19
40
  debounceTime: 250,
20
- contextCategories: reactCore.defaultCopilotContextCategories,
41
+ contextCategories: import_react_core.defaultCopilotContextCategories,
21
42
  disableWhenEmpty: true,
22
43
  disabled: false,
23
44
  temporarilyDisableWhenMovingCursorWithoutChangingText: true,
24
45
  shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,
25
46
  shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress
26
47
  };
27
-
28
- exports.defaultBaseAutosuggestionsConfig = defaultBaseAutosuggestionsConfig;
29
- //# sourceMappingURL=out.js.map
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ defaultBaseAutosuggestionsConfig
51
+ });
30
52
  //# sourceMappingURL=base-autosuggestions-config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/base/base-autosuggestions-config.tsx"],"names":[],"mappings":";AACA,SAAS,uCAAuC;AAyDhD,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO,MAAM,SAAS;AACtC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAcO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,sCAAsC;AAAA,EACtC,sCAAsC;AACxC","sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if command-k, toggle the hovering editor\n if (event.key === \"k\" && event.metaKey) {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n};\n"]}
1
+ {"version":3,"sources":["../../../src/types/base/base-autosuggestions-config.tsx"],"sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if command-k, toggle the hovering editor\n if (event.key === \"k\" && event.metaKey) {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAgD;AAyDhD,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO,MAAM,SAAS;AACtC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAcO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,sCAAsC;AAAA,EACtC,sCAAsC;AACxC;","names":[]}
@@ -1,4 +1,8 @@
1
- export { defaultBaseAutosuggestionsConfig } from '../../chunk-FP2EKU3L.mjs';
2
- import '../../chunk-MRXNTQOX.mjs';
3
- //# sourceMappingURL=out.js.map
1
+ import {
2
+ defaultBaseAutosuggestionsConfig
3
+ } from "../../chunk-FP2EKU3L.mjs";
4
+ import "../../chunk-MRXNTQOX.mjs";
5
+ export {
6
+ defaultBaseAutosuggestionsConfig
7
+ };
4
8
  //# sourceMappingURL=base-autosuggestions-config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
15
 
3
- //# sourceMappingURL=out.js.map
16
+ // src/types/base/base-copilot-textarea-props.tsx
17
+ var base_copilot_textarea_props_exports = {};
18
+ module.exports = __toCommonJS(base_copilot_textarea_props_exports);
4
19
  //# sourceMappingURL=base-copilot-textarea-props.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../src/types/base/base-copilot-textarea-props.tsx"],"sourcesContent":["import { TextareaHTMLAttributes } from \"react\";\nimport { BaseAutosuggestionsConfig } from \".\";\nimport { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\n\n/**\n * `BaseCopilotTextareaProps` defines the properties for the `BaseCopilotTextarea` component.\n *\n * @extends {Omit<TextareaHTMLAttributes<HTMLDivElement>, \"onChange\">}\n *\n * @property {boolean} [disableBranding=false] - Determines whether branding should be disabled. Default is `false`.\n *\n * @property {React.CSSProperties} [placeholderStyle] - Specifies the CSS styles to apply to the placeholder text.\n *\n * @property {React.CSSProperties} [suggestionsStyle] - Specifies the CSS styles to apply to the suggestions list.\n *\n * @property {string} [hoverMenuClassname] - a classname to applly to the editor popover window.\n *\n * @property {string} [value] - The initial value of the textarea. Can be controlled via `onValueChange`.\n *\n * @property {(value: string) => void} [onValueChange] - Callback invoked when the value of the textarea changes.\n *\n * @property {(event: React.ChangeEvent<HTMLTextAreaElement>) => void} [onChange] - Callback invoked when a `change` event is triggered on the textarea element. The event only actually includes the `event.target.value` and `event.currentTarget.value` properties (all that is required in 99% of cases).\n *\n * @property {Partial<BaseAutosuggestionsConfig> & {\n * textareaPurpose: string;\n * }} autosuggestionsConfig - Configuration settings for the autosuggestions feature.\n * Includes a mandatory `textareaPurpose` to guide the autosuggestions.\n */\nexport interface BaseCopilotTextareaProps\n extends Omit<TextareaHTMLAttributes<HTMLDivElement>, \"onChange\"> {\n disableBranding?: boolean;\n placeholderStyle?: React.CSSProperties;\n suggestionsStyle?: React.CSSProperties;\n hoverMenuClassname?: string;\n value?: string;\n onValueChange?: (value: string) => void;\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n baseAutosuggestionsConfig: Partial<BaseAutosuggestionsConfig> & {\n textareaPurpose: string;\n apiConfig: BaseCopilotTextareaApiConfig;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
1
  //# sourceMappingURL=base-copilot-textarea-props.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
15
 
3
- //# sourceMappingURL=out.js.map
16
+ // src/types/base/custom-editor.tsx
17
+ var custom_editor_exports = {};
18
+ module.exports = __toCommonJS(custom_editor_exports);
4
19
  //# sourceMappingURL=custom-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../src/types/base/custom-editor.tsx"],"sourcesContent":["import { BaseEditor } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\nimport { HistoryEditor } from \"slate-history\";\n\nexport type CustomEditor = BaseEditor & ReactEditor & HistoryEditor;\n\nexport type ParagraphElement = {\n type: \"paragraph\";\n children: CustomText[];\n};\n\nexport type SuggestionElement = {\n type: \"suggestion\";\n inline: boolean;\n content: string;\n children: CustomText[];\n};\n\nexport type CustomElement = ParagraphElement | SuggestionElement;\nexport type SuggestionAwareText = { text: string };\nexport type CustomText = SuggestionAwareText;\n\ndeclare module \"slate\" {\n interface CustomTypes {\n Editor: CustomEditor;\n Element: CustomElement;\n Text: CustomText;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,3 +1 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
1
  //# sourceMappingURL=custom-editor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,11 +1,34 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
- require('clsx');
4
- var nanoid = require('nanoid');
5
- require('tailwind-merge');
20
+ // src/types/base/editor-autocomplete-state.ts
21
+ var editor_autocomplete_state_exports = {};
22
+ __export(editor_autocomplete_state_exports, {
23
+ areEqual_autocompleteState: () => areEqual_autocompleteState
24
+ });
25
+ module.exports = __toCommonJS(editor_autocomplete_state_exports);
6
26
 
7
27
  // src/lib/utils.ts
8
- nanoid.customAlphabet(
28
+ var import_clsx = require("clsx");
29
+ var import_nanoid = require("nanoid");
30
+ var import_tailwind_merge = require("tailwind-merge");
31
+ var nanoid = (0, import_nanoid.customAlphabet)(
9
32
  "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
10
33
  7
11
34
  );
@@ -15,7 +38,8 @@ var arraysAreEqual = (arr1, arr2) => arr1.length === arr2.length && arr1.every((
15
38
  function areEqual_autocompleteState(prev, next) {
16
39
  return prev.cursorPoint.offset === next.cursorPoint.offset && arraysAreEqual(prev.cursorPoint.path, next.cursorPoint.path) && prev.textBeforeCursor === next.textBeforeCursor && prev.textAfterCursor === next.textAfterCursor;
17
40
  }
18
-
19
- exports.areEqual_autocompleteState = areEqual_autocompleteState;
20
- //# sourceMappingURL=out.js.map
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ areEqual_autocompleteState
44
+ });
21
45
  //# sourceMappingURL=editor-autocomplete-state.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils.ts","../../../src/types/base/editor-autocomplete-state.ts"],"names":[],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAMjB,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;AA8BO,IAAM,iBAAiB,CAAC,MAAgB,SAC7C,KAAK,WAAW,KAAK,UAAU,KAAK,MAAM,CAAC,OAAO,UAAU,UAAU,KAAK,KAAK,CAAC;;;ACjC5E,SAAS,2BACd,MACA,MACA;AACA,SACE,KAAK,YAAY,WAAW,KAAK,YAAY,UAC7C,eAAe,KAAK,YAAY,MAAM,KAAK,YAAY,IAAI,KAC3D,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,oBAAoB,KAAK;AAElC","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n","import { BasePoint } from \"slate\";\nimport { arraysAreEqual } from \"../../lib/utils\";\n\nexport interface EditorAutocompleteState {\n cursorPoint: BasePoint;\n textBeforeCursor: string;\n textAfterCursor: string;\n}\n\nexport function areEqual_autocompleteState(\n prev: EditorAutocompleteState,\n next: EditorAutocompleteState,\n) {\n return (\n prev.cursorPoint.offset === next.cursorPoint.offset &&\n arraysAreEqual(prev.cursorPoint.path, next.cursorPoint.path) &&\n prev.textBeforeCursor === next.textBeforeCursor &&\n prev.textAfterCursor === next.textAfterCursor\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/types/base/editor-autocomplete-state.ts","../../../src/lib/utils.ts"],"sourcesContent":["import { BasePoint } from \"slate\";\nimport { arraysAreEqual } from \"../../lib/utils\";\n\nexport interface EditorAutocompleteState {\n cursorPoint: BasePoint;\n textBeforeCursor: string;\n textAfterCursor: string;\n}\n\nexport function areEqual_autocompleteState(\n prev: EditorAutocompleteState,\n next: EditorAutocompleteState,\n) {\n return (\n prev.cursorPoint.offset === next.cursorPoint.offset &&\n arraysAreEqual(prev.cursorPoint.path, next.cursorPoint.path) &&\n prev.textBeforeCursor === next.textBeforeCursor &&\n prev.textAfterCursor === next.textAfterCursor\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,oBAA+B;AAC/B,4BAAwB;AAMjB,IAAM,aAAS;AAAA,EACpB;AAAA,EACA;AACF;AA8BO,IAAM,iBAAiB,CAAC,MAAgB,SAC7C,KAAK,WAAW,KAAK,UAAU,KAAK,MAAM,CAAC,OAAO,UAAU,UAAU,KAAK,KAAK,CAAC;;;ADjC5E,SAAS,2BACd,MACA,MACA;AACA,SACE,KAAK,YAAY,WAAW,KAAK,YAAY,UAC7C,eAAe,KAAK,YAAY,MAAM,KAAK,YAAY,IAAI,KAC3D,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,oBAAoB,KAAK;AAElC;","names":[]}
@@ -1,5 +1,9 @@
1
- export { areEqual_autocompleteState } from '../../chunk-JJLQVT7S.mjs';
2
- import '../../chunk-7SUZ6CXM.mjs';
3
- import '../../chunk-MRXNTQOX.mjs';
4
- //# sourceMappingURL=out.js.map
1
+ import {
2
+ areEqual_autocompleteState
3
+ } from "../../chunk-JJLQVT7S.mjs";
4
+ import "../../chunk-7SUZ6CXM.mjs";
5
+ import "../../chunk-MRXNTQOX.mjs";
6
+ export {
7
+ areEqual_autocompleteState
8
+ };
5
9
  //# sourceMappingURL=editor-autocomplete-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +1,31 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
19
 
3
- var reactCore = require('@copilotkit/react-core');
20
+ // src/types/base/index.ts
21
+ var base_exports = {};
22
+ __export(base_exports, {
23
+ defaultBaseAutosuggestionsConfig: () => defaultBaseAutosuggestionsConfig
24
+ });
25
+ module.exports = __toCommonJS(base_exports);
4
26
 
5
27
  // src/types/base/base-autosuggestions-config.tsx
28
+ var import_react_core = require("@copilotkit/react-core");
6
29
  var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
7
30
  if (event.key === "k" && event.metaKey) {
8
31
  return true;
@@ -17,14 +40,15 @@ var defaultShouldAcceptAutosuggestionOnKeyPress = (event) => {
17
40
  };
18
41
  var defaultBaseAutosuggestionsConfig = {
19
42
  debounceTime: 250,
20
- contextCategories: reactCore.defaultCopilotContextCategories,
43
+ contextCategories: import_react_core.defaultCopilotContextCategories,
21
44
  disableWhenEmpty: true,
22
45
  disabled: false,
23
46
  temporarilyDisableWhenMovingCursorWithoutChangingText: true,
24
47
  shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,
25
48
  shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress
26
49
  };
27
-
28
- exports.defaultBaseAutosuggestionsConfig = defaultBaseAutosuggestionsConfig;
29
- //# sourceMappingURL=out.js.map
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ defaultBaseAutosuggestionsConfig
53
+ });
30
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/base/base-autosuggestions-config.tsx"],"names":[],"mappings":";AACA,SAAS,uCAAuC;AAyDhD,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO,MAAM,SAAS;AACtC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAcO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,sCAAsC;AAAA,EACtC,sCAAsC;AACxC","sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if command-k, toggle the hovering editor\n if (event.key === \"k\" && event.metaKey) {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n};\n"]}
1
+ {"version":3,"sources":["../../../src/types/base/index.ts","../../../src/types/base/base-autosuggestions-config.tsx"],"sourcesContent":["export { defaultBaseAutosuggestionsConfig } from \"./base-autosuggestions-config\";\n\nexport type { AutosuggestionsBareFunction } from \"./autosuggestions-bare-function\";\nexport type { BaseAutosuggestionsConfig } from \"./base-autosuggestions-config\";\n\nexport type { BaseCopilotTextareaProps } from \"./base-copilot-textarea-props\";\n","import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @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:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if command-k, toggle the hovering editor\n if (event.key === \"k\" && event.metaKey) {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,wBAAgD;AAyDhD,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO,MAAM,SAAS;AACtC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAcO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,sCAAsC;AAAA,EACtC,sCAAsC;AACxC;","names":[]}
@@ -1,5 +1,9 @@
1
- import '../../chunk-WJHSY5T6.mjs';
2
- export { defaultBaseAutosuggestionsConfig } from '../../chunk-FP2EKU3L.mjs';
3
- import '../../chunk-MRXNTQOX.mjs';
4
- //# sourceMappingURL=out.js.map
1
+ import "../../chunk-WJHSY5T6.mjs";
2
+ import {
3
+ defaultBaseAutosuggestionsConfig
4
+ } from "../../chunk-FP2EKU3L.mjs";
5
+ import "../../chunk-MRXNTQOX.mjs";
6
+ export {
7
+ defaultBaseAutosuggestionsConfig
8
+ };
5
9
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,19 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
15
 
3
- //# sourceMappingURL=out.js.map
16
+ // src/types/html-copilot-textarea-element.ts
17
+ var html_copilot_textarea_element_exports = {};
18
+ module.exports = __toCommonJS(html_copilot_textarea_element_exports);
4
19
  //# sourceMappingURL=html-copilot-textarea-element.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../src/types/html-copilot-textarea-element.ts"],"sourcesContent":["export interface HTMLCopilotTextAreaElement extends HTMLElement {\n value: string;\n focus: () => void;\n blur: () => void;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}