@copilotkit/react-textarea 1.4.5 → 1.4.7

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 (386) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/chunk-23Q6A46J.mjs +103 -0
  3. package/dist/chunk-23Q6A46J.mjs.map +1 -0
  4. package/dist/chunk-2C7O2EVM.mjs +27 -0
  5. package/dist/chunk-2C7O2EVM.mjs.map +1 -0
  6. package/dist/chunk-2QDCE7PD.mjs +32 -0
  7. package/dist/chunk-2QDCE7PD.mjs.map +1 -0
  8. package/dist/chunk-2VMZ5ZWT.mjs +229 -0
  9. package/dist/chunk-2VMZ5ZWT.mjs.map +1 -0
  10. package/dist/chunk-3PQ7GSFE.mjs +17 -0
  11. package/dist/chunk-3PQ7GSFE.mjs.map +1 -0
  12. package/dist/chunk-4CVSOOJY.mjs +30 -0
  13. package/dist/chunk-4CVSOOJY.mjs.map +1 -0
  14. package/dist/chunk-4NHVQZ67.mjs +108 -0
  15. package/dist/chunk-4NHVQZ67.mjs.map +1 -0
  16. package/dist/chunk-4PDYALMP.mjs +52 -0
  17. package/dist/chunk-4PDYALMP.mjs.map +1 -0
  18. package/dist/chunk-4XXU5BSA.mjs +125 -0
  19. package/dist/chunk-4XXU5BSA.mjs.map +1 -0
  20. package/dist/chunk-53RID4IZ.mjs +60 -0
  21. package/dist/chunk-53RID4IZ.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-7L6GIHDM.mjs +39 -0
  25. package/dist/chunk-7L6GIHDM.mjs.map +1 -0
  26. package/dist/chunk-7LSRNPNI.mjs +59 -0
  27. package/dist/chunk-7LSRNPNI.mjs.map +1 -0
  28. package/dist/chunk-ABYCGF77.mjs +31 -0
  29. package/dist/chunk-ABYCGF77.mjs.map +1 -0
  30. package/dist/chunk-AJ5OMEXM.mjs +13 -0
  31. package/dist/chunk-AJ5OMEXM.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-GQN2HYFJ.mjs +22 -0
  45. package/dist/chunk-GQN2HYFJ.mjs.map +1 -0
  46. package/dist/chunk-GUZIMGGZ.mjs +64 -0
  47. package/dist/chunk-GUZIMGGZ.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-HDBI2WN5.mjs +113 -0
  51. package/dist/chunk-HDBI2WN5.mjs.map +1 -0
  52. package/dist/chunk-I72DKFHD.mjs +114 -0
  53. package/dist/chunk-I72DKFHD.mjs.map +1 -0
  54. package/dist/chunk-IU3WTXLQ.mjs +1 -0
  55. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  56. package/dist/chunk-KMVGEY7Q.mjs +51 -0
  57. package/dist/chunk-KMVGEY7Q.mjs.map +1 -0
  58. package/dist/chunk-KNQIEOFP.mjs +19 -0
  59. package/dist/chunk-KNQIEOFP.mjs.map +1 -0
  60. package/dist/chunk-L7VVZH4Q.mjs +1 -0
  61. package/dist/chunk-L7VVZH4Q.mjs.map +1 -0
  62. package/dist/chunk-LQ2OWQU7.mjs +49 -0
  63. package/dist/chunk-LQ2OWQU7.mjs.map +1 -0
  64. package/dist/chunk-LYB4B6MK.mjs +19 -0
  65. package/dist/chunk-LYB4B6MK.mjs.map +1 -0
  66. package/dist/chunk-MCNXIA4Q.mjs +75 -0
  67. package/dist/chunk-MCNXIA4Q.mjs.map +1 -0
  68. package/dist/chunk-MMVDU6DF.mjs +1 -0
  69. package/dist/chunk-MMVDU6DF.mjs.map +1 -0
  70. package/dist/chunk-MRXNTQOX.mjs +59 -0
  71. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  72. package/dist/chunk-PTPNOBEI.mjs +92 -0
  73. package/dist/chunk-PTPNOBEI.mjs.map +1 -0
  74. package/dist/chunk-PZYM7K4Y.mjs +265 -0
  75. package/dist/chunk-PZYM7K4Y.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-RXV67GJN.mjs +168 -0
  81. package/dist/chunk-RXV67GJN.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-VSVQZUPW.mjs +124 -0
  85. package/dist/chunk-VSVQZUPW.mjs.map +1 -0
  86. package/dist/chunk-WADHCMPK.mjs +1 -0
  87. package/dist/chunk-WADHCMPK.mjs.map +1 -0
  88. package/dist/chunk-WGWQRALG.mjs +83 -0
  89. package/dist/chunk-WGWQRALG.mjs.map +1 -0
  90. package/dist/chunk-WJHSY5T6.mjs +1 -0
  91. package/dist/chunk-WJHSY5T6.mjs.map +1 -0
  92. package/dist/chunk-XW3ICO4S.mjs +25 -0
  93. package/dist/chunk-XW3ICO4S.mjs.map +1 -0
  94. package/dist/chunk-YLFAIYRY.mjs +50 -0
  95. package/dist/chunk-YLFAIYRY.mjs.map +1 -0
  96. package/dist/chunk-ZTYA6QOT.mjs +32 -0
  97. package/dist/chunk-ZTYA6QOT.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 +43 -0
  101. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +1795 -0
  102. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -0
  103. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +40 -0
  104. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -0
  105. package/dist/components/base-copilot-textarea/render-element.d.ts +6 -0
  106. package/dist/components/base-copilot-textarea/render-element.js +75 -0
  107. package/dist/components/base-copilot-textarea/render-element.js.map +1 -0
  108. package/dist/components/base-copilot-textarea/render-element.mjs +8 -0
  109. package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -0
  110. package/dist/components/base-copilot-textarea/render-placeholder.d.ts +6 -0
  111. package/dist/components/base-copilot-textarea/render-placeholder.js +72 -0
  112. package/dist/components/base-copilot-textarea/render-placeholder.js.map +1 -0
  113. package/dist/components/base-copilot-textarea/render-placeholder.mjs +8 -0
  114. package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -0
  115. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.ts +8 -0
  116. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +112 -0
  117. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +1 -0
  118. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +9 -0
  119. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -0
  120. package/dist/components/base-copilot-textarea/use-add-branding-css.d.ts +3 -0
  121. package/dist/components/base-copilot-textarea/use-add-branding-css.js +83 -0
  122. package/dist/components/base-copilot-textarea/use-add-branding-css.js.map +1 -0
  123. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +8 -0
  124. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -0
  125. package/dist/components/copilot-textarea/copilot-textarea.css +9 -0
  126. package/dist/components/copilot-textarea/copilot-textarea.css.map +1 -0
  127. package/dist/components/copilot-textarea/copilot-textarea.d.ts +171 -0
  128. package/dist/components/copilot-textarea/copilot-textarea.js +2288 -0
  129. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -0
  130. package/dist/components/copilot-textarea/copilot-textarea.mjs +49 -0
  131. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -0
  132. package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +18 -0
  133. package/dist/components/hovering-toolbar/hovering-editor-provider.js +44 -0
  134. package/dist/components/hovering-toolbar/hovering-editor-provider.js.map +1 -0
  135. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +10 -0
  136. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -0
  137. package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +18 -0
  138. package/dist/components/hovering-toolbar/hovering-toolbar-components.js +174 -0
  139. package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -0
  140. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +16 -0
  141. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -0
  142. package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +12 -0
  143. package/dist/components/hovering-toolbar/hovering-toolbar.js +912 -0
  144. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -0
  145. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +23 -0
  146. package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -0
  147. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +16 -0
  148. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +606 -0
  149. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -0
  150. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +18 -0
  151. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -0
  152. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +14 -0
  153. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +629 -0
  154. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -0
  155. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +19 -0
  156. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -0
  157. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.d.ts +16 -0
  158. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +133 -0
  159. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -0
  160. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +12 -0
  161. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +1 -0
  162. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.d.ts +4 -0
  163. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +629 -0
  164. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -0
  165. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +20 -0
  166. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -0
  167. package/dist/components/index.css +9 -0
  168. package/dist/components/index.css.map +1 -0
  169. package/dist/components/index.d.ts +15 -0
  170. package/dist/components/index.js +2292 -0
  171. package/dist/components/index.js.map +1 -0
  172. package/dist/components/index.mjs +53 -0
  173. package/dist/components/index.mjs.map +1 -0
  174. package/dist/components/manual-ui/chip-with-icon.d.ts +10 -0
  175. package/dist/components/manual-ui/chip-with-icon.js +38 -0
  176. package/dist/components/manual-ui/chip-with-icon.js.map +1 -0
  177. package/dist/components/manual-ui/chip-with-icon.mjs +15 -0
  178. package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -0
  179. package/dist/components/source-search-box/source-search-box.d.ts +16 -0
  180. package/dist/components/source-search-box/source-search-box.js +240 -0
  181. package/dist/components/source-search-box/source-search-box.js.map +1 -0
  182. package/dist/components/source-search-box/source-search-box.mjs +13 -0
  183. package/dist/components/source-search-box/source-search-box.mjs.map +1 -0
  184. package/dist/components/ui/button.d.ts +14 -0
  185. package/dist/components/ui/button.js +114 -0
  186. package/dist/components/ui/button.js.map +1 -0
  187. package/dist/components/ui/button.mjs +11 -0
  188. package/dist/components/ui/button.mjs.map +1 -0
  189. package/dist/components/ui/command.d.ts +53 -0
  190. package/dist/components/ui/command.js +285 -0
  191. package/dist/components/ui/command.js.map +1 -0
  192. package/dist/components/ui/command.mjs +26 -0
  193. package/dist/components/ui/command.mjs.map +1 -0
  194. package/dist/components/ui/dialog.d.ts +19 -0
  195. package/dist/components/ui/dialog.js +183 -0
  196. package/dist/components/ui/dialog.js.map +1 -0
  197. package/dist/components/ui/dialog.mjs +21 -0
  198. package/dist/components/ui/dialog.mjs.map +1 -0
  199. package/dist/components/ui/label.d.ts +8 -0
  200. package/dist/components/ui/label.js +87 -0
  201. package/dist/components/ui/label.js.map +1 -0
  202. package/dist/components/ui/label.mjs +9 -0
  203. package/dist/components/ui/label.mjs.map +1 -0
  204. package/dist/context/index.d.ts +2 -0
  205. package/dist/context/index.js +19 -0
  206. package/dist/context/index.js.map +1 -0
  207. package/dist/context/index.mjs +2 -0
  208. package/dist/context/index.mjs.map +1 -0
  209. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.ts +15 -0
  210. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js +180 -0
  211. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -0
  212. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +11 -0
  213. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -0
  214. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.d.ts +8 -0
  215. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js +194 -0
  216. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js.map +1 -0
  217. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +9 -0
  218. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -0
  219. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.ts +7 -0
  220. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js +180 -0
  221. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js.map +1 -0
  222. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +10 -0
  223. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -0
  224. package/dist/hooks/index.d.ts +2 -0
  225. package/dist/hooks/index.js +19 -0
  226. package/dist/hooks/index.js.map +1 -0
  227. package/dist/hooks/index.mjs +2 -0
  228. package/dist/hooks/index.mjs.map +1 -0
  229. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.ts +22 -0
  230. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +152 -0
  231. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -0
  232. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +9 -0
  233. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -0
  234. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.d.ts +23 -0
  235. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +228 -0
  236. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -0
  237. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +9 -0
  238. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -0
  239. package/dist/hooks/misc/use-autosize-textarea.d.ts +5 -0
  240. package/dist/hooks/misc/use-autosize-textarea.js +37 -0
  241. package/dist/hooks/misc/use-autosize-textarea.js.map +1 -0
  242. package/dist/hooks/misc/use-autosize-textarea.mjs +8 -0
  243. package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -0
  244. package/dist/index.css +644 -0
  245. package/dist/index.css.map +1 -0
  246. package/dist/index.d.ts +15 -0
  247. package/dist/index.js +2297 -0
  248. package/dist/index.js.map +1 -0
  249. package/dist/index.mjs +64 -0
  250. package/dist/index.mjs.map +1 -0
  251. package/dist/lib/debouncer.d.ts +11 -0
  252. package/dist/lib/debouncer.js +76 -0
  253. package/dist/lib/debouncer.js.map +1 -0
  254. package/dist/lib/debouncer.mjs +8 -0
  255. package/dist/lib/debouncer.mjs.map +1 -0
  256. package/dist/lib/editor-to-text.d.ts +7 -0
  257. package/dist/lib/editor-to-text.js +69 -0
  258. package/dist/lib/editor-to-text.js.map +1 -0
  259. package/dist/lib/editor-to-text.mjs +8 -0
  260. package/dist/lib/editor-to-text.mjs.map +1 -0
  261. package/dist/lib/get-text-around-cursor.d.ts +15 -0
  262. package/dist/lib/get-text-around-cursor.js +131 -0
  263. package/dist/lib/get-text-around-cursor.js.map +1 -0
  264. package/dist/lib/get-text-around-cursor.mjs +14 -0
  265. package/dist/lib/get-text-around-cursor.mjs.map +1 -0
  266. package/dist/lib/retry.d.ts +3 -0
  267. package/dist/lib/retry.js +43 -0
  268. package/dist/lib/retry.js.map +1 -0
  269. package/dist/lib/retry.mjs +8 -0
  270. package/dist/lib/retry.mjs.map +1 -0
  271. package/dist/lib/slatejs-edits/add-autocompletions.d.ts +8 -0
  272. package/dist/lib/slatejs-edits/add-autocompletions.js +51 -0
  273. package/dist/lib/slatejs-edits/add-autocompletions.js.map +1 -0
  274. package/dist/lib/slatejs-edits/add-autocompletions.mjs +8 -0
  275. package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -0
  276. package/dist/lib/slatejs-edits/clear-autocompletions.d.ts +8 -0
  277. package/dist/lib/slatejs-edits/clear-autocompletions.js +46 -0
  278. package/dist/lib/slatejs-edits/clear-autocompletions.js.map +1 -0
  279. package/dist/lib/slatejs-edits/clear-autocompletions.mjs +8 -0
  280. package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -0
  281. package/dist/lib/slatejs-edits/replace-text.d.ts +5 -0
  282. package/dist/lib/slatejs-edits/replace-text.js +53 -0
  283. package/dist/lib/slatejs-edits/replace-text.js.map +1 -0
  284. package/dist/lib/slatejs-edits/replace-text.mjs +8 -0
  285. package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -0
  286. package/dist/lib/slatejs-edits/with-partial-history.d.ts +8 -0
  287. package/dist/lib/slatejs-edits/with-partial-history.js +133 -0
  288. package/dist/lib/slatejs-edits/with-partial-history.js.map +1 -0
  289. package/dist/lib/slatejs-edits/with-partial-history.mjs +10 -0
  290. package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -0
  291. package/dist/lib/stream-promise-flatten.d.ts +12 -0
  292. package/dist/lib/stream-promise-flatten.js +72 -0
  293. package/dist/lib/stream-promise-flatten.js.map +1 -0
  294. package/dist/lib/stream-promise-flatten.mjs +8 -0
  295. package/dist/lib/stream-promise-flatten.mjs.map +1 -0
  296. package/dist/lib/utils.d.ts +9 -0
  297. package/dist/lib/utils.js +94 -0
  298. package/dist/lib/utils.js.map +1 -0
  299. package/dist/lib/utils.mjs +16 -0
  300. package/dist/lib/utils.mjs.map +1 -0
  301. package/dist/lib/utils.test.d.ts +2 -0
  302. package/dist/lib/utils.test.js +9 -0
  303. package/dist/lib/utils.test.js.map +1 -0
  304. package/dist/lib/utils.test.mjs +7 -0
  305. package/dist/lib/utils.test.mjs.map +1 -0
  306. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +23 -0
  307. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js +19 -0
  308. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js.map +1 -0
  309. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +1 -0
  310. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -0
  311. package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +20 -0
  312. package/dist/types/autosuggestions-config/autosuggestions-config.js +287 -0
  313. package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -0
  314. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +13 -0
  315. package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -0
  316. package/dist/types/autosuggestions-config/editing-api-config.d.ts +15 -0
  317. package/dist/types/autosuggestions-config/editing-api-config.js +108 -0
  318. package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -0
  319. package/dist/types/autosuggestions-config/editing-api-config.mjs +12 -0
  320. package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -0
  321. package/dist/types/autosuggestions-config/index.d.ts +10 -0
  322. package/dist/types/autosuggestions-config/index.js +287 -0
  323. package/dist/types/autosuggestions-config/index.js.map +1 -0
  324. package/dist/types/autosuggestions-config/index.mjs +14 -0
  325. package/dist/types/autosuggestions-config/index.mjs.map +1 -0
  326. package/dist/types/autosuggestions-config/insertions-api-config.d.ts +15 -0
  327. package/dist/types/autosuggestions-config/insertions-api-config.js +101 -0
  328. package/dist/types/autosuggestions-config/insertions-api-config.js.map +1 -0
  329. package/dist/types/autosuggestions-config/insertions-api-config.mjs +12 -0
  330. package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -0
  331. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +3 -0
  332. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js +19 -0
  333. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js.map +1 -0
  334. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +1 -0
  335. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -0
  336. package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +14 -0
  337. package/dist/types/autosuggestions-config/suggestions-api-config.js +90 -0
  338. package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -0
  339. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +12 -0
  340. package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -0
  341. package/dist/types/base/autosuggestion-state.d.ts +8 -0
  342. package/dist/types/base/autosuggestion-state.js +19 -0
  343. package/dist/types/base/autosuggestion-state.js.map +1 -0
  344. package/dist/types/base/autosuggestion-state.mjs +1 -0
  345. package/dist/types/base/autosuggestion-state.mjs.map +1 -0
  346. package/dist/types/base/autosuggestions-bare-function.d.ts +19 -0
  347. package/dist/types/base/autosuggestions-bare-function.js +19 -0
  348. package/dist/types/base/autosuggestions-bare-function.js.map +1 -0
  349. package/dist/types/base/autosuggestions-bare-function.mjs +1 -0
  350. package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -0
  351. package/dist/types/base/base-autosuggestions-config.d.ts +83 -0
  352. package/dist/types/base/base-autosuggestions-config.js +54 -0
  353. package/dist/types/base/base-autosuggestions-config.js.map +1 -0
  354. package/dist/types/base/base-autosuggestions-config.mjs +8 -0
  355. package/dist/types/base/base-autosuggestions-config.mjs.map +1 -0
  356. package/dist/types/base/base-copilot-textarea-props.d.ts +5 -0
  357. package/dist/types/base/base-copilot-textarea-props.js +19 -0
  358. package/dist/types/base/base-copilot-textarea-props.js.map +1 -0
  359. package/dist/types/base/base-copilot-textarea-props.mjs +1 -0
  360. package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -0
  361. package/dist/types/base/custom-editor.d.ts +29 -0
  362. package/dist/types/base/custom-editor.js +19 -0
  363. package/dist/types/base/custom-editor.js.map +1 -0
  364. package/dist/types/base/custom-editor.mjs +1 -0
  365. package/dist/types/base/custom-editor.mjs.map +1 -0
  366. package/dist/types/base/editor-autocomplete-state.d.ts +10 -0
  367. package/dist/types/base/editor-autocomplete-state.js +40 -0
  368. package/dist/types/base/editor-autocomplete-state.js.map +1 -0
  369. package/dist/types/base/editor-autocomplete-state.mjs +9 -0
  370. package/dist/types/base/editor-autocomplete-state.mjs.map +1 -0
  371. package/dist/types/base/index.d.ts +54 -0
  372. package/dist/types/base/index.js +56 -0
  373. package/dist/types/base/index.js.map +1 -0
  374. package/dist/types/base/index.mjs +9 -0
  375. package/dist/types/base/index.mjs.map +1 -0
  376. package/dist/types/html-copilot-textarea-element.d.ts +7 -0
  377. package/dist/types/html-copilot-textarea-element.js +19 -0
  378. package/dist/types/html-copilot-textarea-element.js.map +1 -0
  379. package/dist/types/html-copilot-textarea-element.mjs +2 -0
  380. package/dist/types/html-copilot-textarea-element.mjs.map +1 -0
  381. package/dist/types/index.d.ts +13 -0
  382. package/dist/types/index.js +289 -0
  383. package/dist/types/index.js.map +1 -0
  384. package/dist/types/index.mjs +19 -0
  385. package/dist/types/index.mjs.map +1 -0
  386. package/package.json +7 -7
@@ -0,0 +1,70 @@
1
+ import {
2
+ defaultShouldSave,
3
+ withPartialHistory
4
+ } from "./chunk-4NHVQZ67.mjs";
5
+
6
+ // src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx
7
+ import { useMemo } from "react";
8
+ import { createEditor, Element } from "slate";
9
+ import { withReact } from "slate-react";
10
+ var shouldSave = (op, prev) => {
11
+ const excludedNodeType = "suggestion";
12
+ if (op.type === "insert_node" && Element.isElement(op.node) && op.node.type === excludedNodeType) {
13
+ return false;
14
+ }
15
+ if (op.type === "remove_node" && Element.isElement(op.node) && op.node.type === excludedNodeType) {
16
+ return false;
17
+ }
18
+ if (op.type === "set_node" && "type" in op.newProperties && op.newProperties.type === excludedNodeType) {
19
+ return false;
20
+ }
21
+ if (op.type == "set_node" && "type" in op.properties && op.properties.type === excludedNodeType) {
22
+ return false;
23
+ }
24
+ if (op.type === "merge_node" && "type" in op.properties && op.properties.type === excludedNodeType) {
25
+ return false;
26
+ }
27
+ if (op.type === "split_node" && "type" in op.properties && op.properties.type === excludedNodeType) {
28
+ return false;
29
+ }
30
+ return defaultShouldSave(op, prev);
31
+ };
32
+ function useCopilotTextareaEditor() {
33
+ const editor = useMemo(() => {
34
+ const editor2 = withPartialHistory(withReact(createEditor()), shouldSave);
35
+ const { isVoid } = editor2;
36
+ editor2.isVoid = (element) => {
37
+ switch (element.type) {
38
+ case "suggestion":
39
+ return true;
40
+ default:
41
+ return isVoid(element);
42
+ }
43
+ };
44
+ const { markableVoid } = editor2;
45
+ editor2.markableVoid = (element) => {
46
+ switch (element.type) {
47
+ case "suggestion":
48
+ return true;
49
+ default:
50
+ return markableVoid(element);
51
+ }
52
+ };
53
+ const { isInline } = editor2;
54
+ editor2.isInline = (element) => {
55
+ switch (element.type) {
56
+ case "suggestion":
57
+ return element.inline;
58
+ default:
59
+ return isInline(element);
60
+ }
61
+ };
62
+ return editor2;
63
+ }, []);
64
+ return editor;
65
+ }
66
+
67
+ export {
68
+ useCopilotTextareaEditor
69
+ };
70
+ //# sourceMappingURL=chunk-DRV2FOHZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { createEditor, Element } from \"slate\";\nimport { withReact } from \"slate-react\";\nimport {\n defaultShouldSave,\n ShouldSaveToHistory,\n withPartialHistory,\n} from \"../../lib/slatejs-edits/with-partial-history\";\nimport { CustomEditor } from \"../../types/base/custom-editor\";\n\nconst shouldSave: ShouldSaveToHistory = (op, prev) => {\n const excludedNodeType = \"suggestion\";\n // Check if the operation involves the suggestion inline node type\n if (\n op.type === \"insert_node\" &&\n Element.isElement(op.node) &&\n op.node.type === excludedNodeType\n ) {\n return false;\n }\n\n if (\n op.type === \"remove_node\" &&\n Element.isElement(op.node) &&\n op.node.type === excludedNodeType\n ) {\n return false;\n }\n\n if (\n op.type === \"set_node\" &&\n \"type\" in op.newProperties &&\n op.newProperties.type === excludedNodeType\n ) {\n return false;\n }\n\n if (op.type == \"set_node\" && \"type\" in op.properties && op.properties.type === excludedNodeType) {\n return false;\n }\n\n if (\n op.type === \"merge_node\" &&\n \"type\" in op.properties &&\n op.properties.type === excludedNodeType\n ) {\n return false;\n }\n\n if (\n op.type === \"split_node\" &&\n \"type\" in op.properties &&\n op.properties.type === excludedNodeType\n ) {\n return false;\n }\n\n // Otherwise, save the operation to history\n return defaultShouldSave(op, prev);\n};\n\nexport function useCopilotTextareaEditor(): CustomEditor {\n const editor = useMemo(() => {\n const editor = withPartialHistory(withReact(createEditor()), shouldSave);\n\n const { isVoid } = editor;\n editor.isVoid = (element) => {\n switch (element.type) {\n case \"suggestion\":\n return true;\n default:\n return isVoid(element);\n }\n };\n\n const { markableVoid } = editor;\n editor.markableVoid = (element) => {\n switch (element.type) {\n case \"suggestion\":\n return true;\n default:\n return markableVoid(element);\n }\n };\n\n const { isInline } = editor;\n editor.isInline = (element) => {\n switch (element.type) {\n case \"suggestion\":\n return element.inline;\n default:\n return isInline(element);\n }\n };\n\n return editor;\n }, []);\n\n return editor;\n}\n"],"mappings":";;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,cAAc,eAAe;AACtC,SAAS,iBAAiB;AAQ1B,IAAM,aAAkC,CAAC,IAAI,SAAS;AACpD,QAAM,mBAAmB;AAEzB,MACE,GAAG,SAAS,iBACZ,QAAQ,UAAU,GAAG,IAAI,KACzB,GAAG,KAAK,SAAS,kBACjB;AACA,WAAO;AAAA,EACT;AAEA,MACE,GAAG,SAAS,iBACZ,QAAQ,UAAU,GAAG,IAAI,KACzB,GAAG,KAAK,SAAS,kBACjB;AACA,WAAO;AAAA,EACT;AAEA,MACE,GAAG,SAAS,cACZ,UAAU,GAAG,iBACb,GAAG,cAAc,SAAS,kBAC1B;AACA,WAAO;AAAA,EACT;AAEA,MAAI,GAAG,QAAQ,cAAc,UAAU,GAAG,cAAc,GAAG,WAAW,SAAS,kBAAkB;AAC/F,WAAO;AAAA,EACT;AAEA,MACE,GAAG,SAAS,gBACZ,UAAU,GAAG,cACb,GAAG,WAAW,SAAS,kBACvB;AACA,WAAO;AAAA,EACT;AAEA,MACE,GAAG,SAAS,gBACZ,UAAU,GAAG,cACb,GAAG,WAAW,SAAS,kBACvB;AACA,WAAO;AAAA,EACT;AAGA,SAAO,kBAAkB,IAAI,IAAI;AACnC;AAEO,SAAS,2BAAyC;AACvD,QAAM,SAAS,QAAQ,MAAM;AAC3B,UAAMA,UAAS,mBAAmB,UAAU,aAAa,CAAC,GAAG,UAAU;AAEvE,UAAM,EAAE,OAAO,IAAIA;AACnB,IAAAA,QAAO,SAAS,CAAC,YAAY;AAC3B,cAAQ,QAAQ,MAAM;AAAA,QACpB,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO,OAAO,OAAO;AAAA,MACzB;AAAA,IACF;AAEA,UAAM,EAAE,aAAa,IAAIA;AACzB,IAAAA,QAAO,eAAe,CAAC,YAAY;AACjC,cAAQ,QAAQ,MAAM;AAAA,QACpB,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO,aAAa,OAAO;AAAA,MAC/B;AAAA,IACF;AAEA,UAAM,EAAE,SAAS,IAAIA;AACrB,IAAAA,QAAO,WAAW,CAAC,YAAY;AAC7B,cAAQ,QAAQ,MAAM;AAAA,QACpB,KAAK;AACH,iBAAO,QAAQ;AAAA,QACjB;AACE,iBAAO,SAAS,OAAO;AAAA,MAC3B;AAAA,IACF;AAEA,WAAOA;AAAA,EACT,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;","names":["editor"]}
@@ -0,0 +1,104 @@
1
+ // src/lib/get-text-around-cursor.ts
2
+ import { Editor, Path, Range, Text, Element, Point } from "slate";
3
+ function getTextAroundCollapsedCursor(editor) {
4
+ const { selection } = editor;
5
+ if (!selection || !Range.isCollapsed(selection)) {
6
+ return null;
7
+ }
8
+ const cursorPoint = selection.anchor;
9
+ const beforeRange = {
10
+ anchor: Editor.start(editor, []),
11
+ focus: cursorPoint
12
+ };
13
+ const afterRange = {
14
+ anchor: cursorPoint,
15
+ focus: Editor.end(editor, [])
16
+ };
17
+ const before = extractTextWithNewlines(editor, beforeRange);
18
+ const after = extractTextWithNewlines(editor, afterRange);
19
+ return {
20
+ cursorPoint,
21
+ textBeforeCursor: before,
22
+ textAfterCursor: after
23
+ };
24
+ }
25
+ function getTextAroundSelection(editor) {
26
+ const { selection } = editor;
27
+ if (!selection) {
28
+ return null;
29
+ }
30
+ const wellOrderedSelection = wellOrderedRange(selection);
31
+ const beforeRange = {
32
+ anchor: Editor.start(editor, []),
33
+ focus: wellOrderedSelection.anchor
34
+ };
35
+ const afterRange = {
36
+ anchor: wellOrderedSelection.focus,
37
+ focus: Editor.end(editor, [])
38
+ };
39
+ const before = extractTextWithNewlines(editor, beforeRange);
40
+ const after = extractTextWithNewlines(editor, afterRange);
41
+ const selectedText = extractTextWithNewlines(editor, wellOrderedSelection);
42
+ return {
43
+ selection: wellOrderedSelection,
44
+ textBeforeCursor: before,
45
+ selectedText,
46
+ textAfterCursor: after
47
+ };
48
+ }
49
+ function getFullEditorTextWithNewlines(editor) {
50
+ const fullDocumentRange = {
51
+ anchor: Editor.start(editor, []),
52
+ focus: Editor.end(editor, [])
53
+ };
54
+ return extractTextWithNewlines(editor, fullDocumentRange);
55
+ }
56
+ function extractTextWithNewlines(editor, range) {
57
+ const voids = false;
58
+ const [start, end] = Range.edges(range);
59
+ let text = "";
60
+ let lastBlock = null;
61
+ for (const [node, path] of Editor.nodes(editor, {
62
+ at: range,
63
+ match: Text.isText,
64
+ voids
65
+ })) {
66
+ let t = node.text;
67
+ const [block] = Editor.above(editor, {
68
+ at: path,
69
+ match: (n) => Element.isElement(n) && n.type === "paragraph"
70
+ }) || [null];
71
+ if (lastBlock !== block && block) {
72
+ if (lastBlock) {
73
+ text += "\n";
74
+ }
75
+ lastBlock = block;
76
+ }
77
+ if (Path.equals(path, end.path)) {
78
+ t = t.slice(0, end.offset);
79
+ }
80
+ if (Path.equals(path, start.path)) {
81
+ t = t.slice(start.offset);
82
+ }
83
+ text += t;
84
+ }
85
+ return text;
86
+ }
87
+ function wellOrderedRange(range) {
88
+ const { anchor, focus } = range;
89
+ if (Point.isBefore(anchor, focus)) {
90
+ return range;
91
+ }
92
+ return {
93
+ anchor: focus,
94
+ focus: anchor
95
+ };
96
+ }
97
+
98
+ export {
99
+ getTextAroundCollapsedCursor,
100
+ getTextAroundSelection,
101
+ getFullEditorTextWithNewlines,
102
+ extractTextWithNewlines
103
+ };
104
+ //# sourceMappingURL=chunk-ECR45NSD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/get-text-around-cursor.ts"],"sourcesContent":["import { Editor, Node, Path, Range, Text, Element, BasePoint, BaseRange, Point } from \"slate\";\nimport { EditorAutocompleteState } from \"../types/base/editor-autocomplete-state\";\n\nexport interface EditorTextState {\n selection: BaseRange;\n\n textBeforeCursor: string;\n selectedText: string;\n textAfterCursor: string;\n}\n\nexport function getTextAroundCollapsedCursor(editor: Editor): EditorAutocompleteState | null {\n const { selection } = editor;\n if (!selection || !Range.isCollapsed(selection)) {\n return null;\n }\n\n const cursorPoint = selection.anchor;\n\n // Create two ranges: one before the anchor and one after\n const beforeRange: Range = {\n anchor: Editor.start(editor, []),\n focus: cursorPoint,\n };\n const afterRange: Range = {\n anchor: cursorPoint,\n focus: Editor.end(editor, []),\n };\n\n // Extract text for these ranges\n const before = extractTextWithNewlines(editor, beforeRange);\n const after = extractTextWithNewlines(editor, afterRange);\n\n return {\n cursorPoint: cursorPoint,\n textBeforeCursor: before,\n textAfterCursor: after,\n };\n}\n\nexport function getTextAroundSelection(editor: Editor): EditorTextState | null {\n const { selection } = editor;\n if (!selection) {\n return null;\n }\n\n const wellOrderedSelection = wellOrderedRange(selection);\n\n // Create two ranges: one before the anchor and one after\n const beforeRange: Range = {\n anchor: Editor.start(editor, []),\n focus: wellOrderedSelection.anchor,\n };\n const afterRange: Range = {\n anchor: wellOrderedSelection.focus,\n focus: Editor.end(editor, []),\n };\n\n // Extract text for these ranges\n const before = extractTextWithNewlines(editor, beforeRange);\n const after = extractTextWithNewlines(editor, afterRange);\n const selectedText = extractTextWithNewlines(editor, wellOrderedSelection);\n\n return {\n selection: wellOrderedSelection,\n textBeforeCursor: before,\n selectedText,\n textAfterCursor: after,\n };\n}\n\nexport function getFullEditorTextWithNewlines(editor: Editor): string {\n const fullDocumentRange: Range = {\n anchor: Editor.start(editor, []),\n focus: Editor.end(editor, []),\n };\n return extractTextWithNewlines(editor, fullDocumentRange);\n}\n\n// Helper function to extract text with newlines\nexport function extractTextWithNewlines(editor: Editor, range: Range): string {\n const voids = false;\n const [start, end] = Range.edges(range);\n let text = \"\";\n let lastBlock: Node | null = null;\n\n for (const [node, path] of Editor.nodes(editor, {\n at: range,\n match: Text.isText,\n voids,\n })) {\n let t = node.text;\n\n // Determine the parent block of the current text node\n const [block] = Editor.above(editor, {\n at: path,\n match: (n) => Element.isElement(n) && n.type === \"paragraph\",\n }) || [null];\n\n // If we encounter a new block, prepend a newline\n if (lastBlock !== block && block) {\n // check that lastBlock is not null to avoid adding a newline at the beginning\n if (lastBlock) {\n text += \"\\n\";\n }\n lastBlock = block;\n }\n\n if (Path.equals(path, end.path)) {\n t = t.slice(0, end.offset);\n }\n\n if (Path.equals(path, start.path)) {\n t = t.slice(start.offset);\n }\n\n text += t;\n }\n\n return text;\n}\n\nfunction wellOrderedRange(range: BaseRange): BaseRange {\n const { anchor, focus } = range;\n // if anchor is before focus, return range as is\n if (Point.isBefore(anchor, focus)) {\n return range;\n }\n\n // if focus is before anchor, return range with anchor and focus swapped\n return {\n anchor: focus,\n focus: anchor,\n };\n}\n"],"mappings":";AAAA,SAAS,QAAc,MAAM,OAAO,MAAM,SAA+B,aAAa;AAW/E,SAAS,6BAA6B,QAAgD;AAC3F,QAAM,EAAE,UAAU,IAAI;AACtB,MAAI,CAAC,aAAa,CAAC,MAAM,YAAY,SAAS,GAAG;AAC/C,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,UAAU;AAG9B,QAAM,cAAqB;AAAA,IACzB,QAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC;AAAA,IAC/B,OAAO;AAAA,EACT;AACA,QAAM,aAAoB;AAAA,IACxB,QAAQ;AAAA,IACR,OAAO,OAAO,IAAI,QAAQ,CAAC,CAAC;AAAA,EAC9B;AAGA,QAAM,SAAS,wBAAwB,QAAQ,WAAW;AAC1D,QAAM,QAAQ,wBAAwB,QAAQ,UAAU;AAExD,SAAO;AAAA,IACL;AAAA,IACA,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,EACnB;AACF;AAEO,SAAS,uBAAuB,QAAwC;AAC7E,QAAM,EAAE,UAAU,IAAI;AACtB,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,EACT;AAEA,QAAM,uBAAuB,iBAAiB,SAAS;AAGvD,QAAM,cAAqB;AAAA,IACzB,QAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC;AAAA,IAC/B,OAAO,qBAAqB;AAAA,EAC9B;AACA,QAAM,aAAoB;AAAA,IACxB,QAAQ,qBAAqB;AAAA,IAC7B,OAAO,OAAO,IAAI,QAAQ,CAAC,CAAC;AAAA,EAC9B;AAGA,QAAM,SAAS,wBAAwB,QAAQ,WAAW;AAC1D,QAAM,QAAQ,wBAAwB,QAAQ,UAAU;AACxD,QAAM,eAAe,wBAAwB,QAAQ,oBAAoB;AAEzE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB;AAAA,IACA,iBAAiB;AAAA,EACnB;AACF;AAEO,SAAS,8BAA8B,QAAwB;AACpE,QAAM,oBAA2B;AAAA,IAC/B,QAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC;AAAA,IAC/B,OAAO,OAAO,IAAI,QAAQ,CAAC,CAAC;AAAA,EAC9B;AACA,SAAO,wBAAwB,QAAQ,iBAAiB;AAC1D;AAGO,SAAS,wBAAwB,QAAgB,OAAsB;AAC5E,QAAM,QAAQ;AACd,QAAM,CAAC,OAAO,GAAG,IAAI,MAAM,MAAM,KAAK;AACtC,MAAI,OAAO;AACX,MAAI,YAAyB;AAE7B,aAAW,CAAC,MAAM,IAAI,KAAK,OAAO,MAAM,QAAQ;AAAA,IAC9C,IAAI;AAAA,IACJ,OAAO,KAAK;AAAA,IACZ;AAAA,EACF,CAAC,GAAG;AACF,QAAI,IAAI,KAAK;AAGb,UAAM,CAAC,KAAK,IAAI,OAAO,MAAM,QAAQ;AAAA,MACnC,IAAI;AAAA,MACJ,OAAO,CAAC,MAAM,QAAQ,UAAU,CAAC,KAAK,EAAE,SAAS;AAAA,IACnD,CAAC,KAAK,CAAC,IAAI;AAGX,QAAI,cAAc,SAAS,OAAO;AAEhC,UAAI,WAAW;AACb,gBAAQ;AAAA,MACV;AACA,kBAAY;AAAA,IACd;AAEA,QAAI,KAAK,OAAO,MAAM,IAAI,IAAI,GAAG;AAC/B,UAAI,EAAE,MAAM,GAAG,IAAI,MAAM;AAAA,IAC3B;AAEA,QAAI,KAAK,OAAO,MAAM,MAAM,IAAI,GAAG;AACjC,UAAI,EAAE,MAAM,MAAM,MAAM;AAAA,IAC1B;AAEA,YAAQ;AAAA,EACV;AAEA,SAAO;AACT;AAEA,SAAS,iBAAiB,OAA6B;AACrD,QAAM,EAAE,QAAQ,MAAM,IAAI;AAE1B,MAAI,MAAM,SAAS,QAAQ,KAAK,GAAG;AACjC,WAAO;AAAA,EACT;AAGA,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AACF;","names":[]}
@@ -0,0 +1,82 @@
1
+ // src/types/autosuggestions-config/editing-api-config.tsx
2
+ import { Role, TextMessage } from "@copilotkit/runtime-client-gql";
3
+ var defaultEditingMakeSystemPrompt = (textareaPurpose, contextString) => {
4
+ return `You are a versatile writing assistant helping the user edit a portion of their text.
5
+
6
+ The user is writing some text.
7
+ The purpose is: "${textareaPurpose}"
8
+
9
+ The following external context is also provided. Use it when relevant.
10
+ \`\`\`
11
+ ${contextString}
12
+ \`\`\`
13
+
14
+ The user has provided you with a PROMPT for EDITING a PORTION of the text.
15
+ Your job is to come up with a new EDITED version OF THE SEGMENT IN QUESTION - AS BEST YOU CAN.
16
+ Only rewrite the portion of the text that the user has marked as "TextToEdit"!!!
17
+
18
+ Adjust yourself to the user's style and implied intent.
19
+
20
+ The conversation will be structured as follows:
21
+ <TextBeforeCursor>
22
+ <TextToEdit>
23
+ <TextAfterCursor>
24
+ <EditingPrompt>
25
+
26
+ <YourEditSuggestion>
27
+ `;
28
+ };
29
+ var defaultEditingFewShotMessages = [
30
+ new TextMessage({
31
+ role: Role.User,
32
+ content: "<TextBeforeCursor>This morning I woke up and went straight to the grocery store. </TextBeforeCursor>"
33
+ }),
34
+ new TextMessage({
35
+ role: Role.User,
36
+ content: "<TextToEdit>While I was there I picked up some apples, oranges, and bananas. </TextToEdit>"
37
+ }),
38
+ new TextMessage({
39
+ role: Role.User,
40
+ content: "<TextAfterCursor>The grocery store was having a sale on fruit, so I decided to stock up.</TextAfterCursor>"
41
+ }),
42
+ new TextMessage({
43
+ role: Role.User,
44
+ content: "<EditingPrompt>I also bought a big watermelon</EditingPrompt>"
45
+ }),
46
+ new TextMessage({
47
+ role: Role.Assistant,
48
+ content: "While I was there I picked up some apples, oranges, and bananas, and a big watermelon."
49
+ }),
50
+ new TextMessage({
51
+ role: Role.User,
52
+ content: "<TextBeforeCursor>Yesterday, I spent the afternoon working on my new project.</TextBeforeCursor>"
53
+ }),
54
+ new TextMessage({
55
+ role: Role.User,
56
+ content: "<TextToEdit>It's quite challenging and requires a lot of focus.</TextToEdit>"
57
+ }),
58
+ new TextMessage({
59
+ role: Role.User,
60
+ content: "<TextAfterCursor>I'm really excited about the potential outcomes of this project.</TextAfterCursor>"
61
+ }),
62
+ new TextMessage({
63
+ role: Role.User,
64
+ content: "<EditingPrompt>emphasize the complexity and my enthusiasm for the project</EditingPrompt>"
65
+ }),
66
+ new TextMessage({
67
+ role: Role.Assistant,
68
+ content: "It's a highly complex task that demands intense concentration, but I'm incredibly enthusiastic about the promising prospects of this project."
69
+ })
70
+ ];
71
+ var defaultEditingApiConfig = {
72
+ makeSystemPrompt: defaultEditingMakeSystemPrompt,
73
+ fewShotMessages: defaultEditingFewShotMessages,
74
+ forwardedParams: void 0
75
+ };
76
+
77
+ export {
78
+ defaultEditingMakeSystemPrompt,
79
+ defaultEditingFewShotMessages,
80
+ defaultEditingApiConfig
81
+ };
82
+ //# sourceMappingURL=chunk-EJGGLWWR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/autosuggestions-config/editing-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface EditingApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultEditingMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant helping the user edit a portion of their text.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe following external context is also provided. Use it when relevant.\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThe user has provided you with a PROMPT for EDITING a PORTION of the text. \nYour job is to come up with a new EDITED version OF THE SEGMENT IN QUESTION - AS BEST YOU CAN.\nOnly rewrite the portion of the text that the user has marked as \"TextToEdit\"!!!\n\nAdjust yourself to the user's style and implied intent.\n\nThe conversation will be structured as follows:\n<TextBeforeCursor>\n<TextToEdit>\n<TextAfterCursor>\n<EditingPrompt>\n\n<YourEditSuggestion>\n`;\n};\n\nexport const defaultEditingFewShotMessages: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextBeforeCursor>This morning I woke up and went straight to the grocery store. </TextBeforeCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextToEdit>While I was there I picked up some apples, oranges, and bananas. </TextToEdit>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>The grocery store was having a sale on fruit, so I decided to stock up.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"<EditingPrompt>I also bought a big watermelon</EditingPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \"While I was there I picked up some apples, oranges, and bananas, and a big watermelon.\",\n }),\n\n new TextMessage({\n role: Role.User,\n content:\n \"<TextBeforeCursor>Yesterday, I spent the afternoon working on my new project.</TextBeforeCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"<TextToEdit>It's quite challenging and requires a lot of focus.</TextToEdit>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>I'm really excited about the potential outcomes of this project.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<EditingPrompt>emphasize the complexity and my enthusiasm for the project</EditingPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \"It's a highly complex task that demands intense concentration, but I'm incredibly enthusiastic about the promising prospects of this project.\",\n }),\n];\n\nexport const defaultEditingApiConfig: EditingApiConfig = {\n makeSystemPrompt: defaultEditingMakeSystemPrompt,\n fewShotMessages: defaultEditingFewShotMessages,\n forwardedParams: undefined,\n};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AASpC,IAAM,iCAAmD,CAC9D,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA,EAIlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBF;AAEO,IAAM,gCAA2C;AAAA,EACtD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EAED,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,0BAA4C;AAAA,EACvD,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
@@ -0,0 +1,22 @@
1
+ // src/lib/slatejs-edits/clear-autocompletions.ts
2
+ import { Element, Node, Transforms } from "slate";
3
+ function clearAutocompletionsFromEditor(editor) {
4
+ const paths = [];
5
+ for (const [node, path] of Node.nodes(editor)) {
6
+ if (Element.isElement(node) && node.type === "suggestion") {
7
+ paths.push(path);
8
+ }
9
+ }
10
+ for (const path of paths) {
11
+ try {
12
+ Transforms.removeNodes(editor, { at: path });
13
+ } catch (e) {
14
+ console.log("CopilotTextarea.clearAutocompletionsFromEditor: error removing node", e);
15
+ }
16
+ }
17
+ }
18
+
19
+ export {
20
+ clearAutocompletionsFromEditor
21
+ };
22
+ //# sourceMappingURL=chunk-GQN2HYFJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/slatejs-edits/clear-autocompletions.ts"],"sourcesContent":["import { Element, Node, Path, Transforms } from \"slate\";\nimport { CustomEditor } from \"../../types/base/custom-editor\";\n\nexport function clearAutocompletionsFromEditor(editor: CustomEditor) {\n // clear previous suggestion\n const paths: Path[] = [];\n for (const [node, path] of Node.nodes(editor)) {\n if (Element.isElement(node) && node.type === \"suggestion\") {\n paths.push(path);\n }\n }\n for (const path of paths) {\n try {\n Transforms.removeNodes(editor, { at: path });\n } catch (e) {\n console.log(\"CopilotTextarea.clearAutocompletionsFromEditor: error removing node\", e);\n }\n }\n}\n"],"mappings":";AAAA,SAAS,SAAS,MAAY,kBAAkB;AAGzC,SAAS,+BAA+B,QAAsB;AAEnE,QAAM,QAAgB,CAAC;AACvB,aAAW,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM,MAAM,GAAG;AAC7C,QAAI,QAAQ,UAAU,IAAI,KAAK,KAAK,SAAS,cAAc;AACzD,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,aAAW,QAAQ,OAAO;AACxB,QAAI;AACF,iBAAW,YAAY,QAAQ,EAAE,IAAI,KAAK,CAAC;AAAA,IAC7C,SAAS,GAAP;AACA,cAAQ,IAAI,uEAAuE,CAAC;AAAA,IACtF;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,64 @@
1
+ // src/types/autosuggestions-config/suggestions-api-config.tsx
2
+ import { Role, TextMessage } from "@copilotkit/runtime-client-gql";
3
+ var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
4
+ return `You are a versatile writing assistant.
5
+
6
+ The user is writing some text.
7
+ The purpose is: "${textareaPurpose}"
8
+
9
+ Your job is to guess what the user will write next AS BEST YOU CAN.
10
+ Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
11
+
12
+ Adjust yourself to the user's style and implied intent.
13
+
14
+ The 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.
15
+ <TextAfterCursor>
16
+ <TextBeforeCursor>
17
+ <YourSuggestion>
18
+
19
+ If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
20
+ Refrain from adding <YourSuggestion> tags when responding
21
+
22
+ The following external context is also provided. Use it to help you make better suggestions!!!
23
+ \`\`\`
24
+ ${contextString}
25
+ \`\`\`
26
+ `;
27
+ };
28
+ var defaultSuggestionsFewShotMessages = [
29
+ new TextMessage({
30
+ role: Role.User,
31
+ content: "<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>"
32
+ }),
33
+ new TextMessage({
34
+ role: Role.User,
35
+ content: "This morning I woke up and went straight to the grocery store."
36
+ }),
37
+ new TextMessage({
38
+ role: Role.Assistant,
39
+ content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
40
+ }),
41
+ new TextMessage({
42
+ role: Role.User,
43
+ content: "<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>"
44
+ }),
45
+ new TextMessage({
46
+ role: Role.User,
47
+ content: `<TextBeforeCursor>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;</TextBeforeCursor>`
48
+ }),
49
+ new TextMessage({
50
+ role: Role.Assistant,
51
+ content: ` (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"; `
52
+ })
53
+ ];
54
+ var defaultSuggestionsApiConfig = {
55
+ makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
56
+ fewShotMessages: defaultSuggestionsFewShotMessages
57
+ };
58
+
59
+ export {
60
+ defaultSuggestionsMakeSystemPrompt,
61
+ defaultSuggestionsFewShotMessages,
62
+ defaultSuggestionsApiConfig
63
+ };
64
+ //# sourceMappingURL=chunk-GUZIMGGZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/autosuggestions-config/suggestions-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n maxTokens?: number;\n stop?: string[];\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.\nRefrain from adding <YourSuggestion> tags when responding\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: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"This morning I woke up and went straight to the grocery store.\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n '<TextBeforeCursor>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;</TextBeforeCursor>',\n }),\n new TextMessage({\n role: 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};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AAUpC,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;AAAA,EAiBlB;AAAA;AAAA;AAGF;AAEO,IAAM,oCAA+C;AAAA,EAC1D,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-H4VKQGVU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,113 @@
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "./chunk-MRXNTQOX.mjs";
6
+
7
+ // src/components/hovering-toolbar/hovering-toolbar-components.tsx
8
+ import { css, cx } from "@emotion/css";
9
+ import React from "react";
10
+ import ReactDOM from "react-dom";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var Button = React.forwardRef(
13
+ (_a, ref) => {
14
+ var _b = _a, {
15
+ className,
16
+ active,
17
+ reversed
18
+ } = _b, props = __objRest(_b, [
19
+ "className",
20
+ "active",
21
+ "reversed"
22
+ ]);
23
+ return /* @__PURE__ */ jsx(
24
+ "span",
25
+ __spreadProps(__spreadValues({}, props), {
26
+ ref,
27
+ className: cx(
28
+ className,
29
+ css`
30
+ cursor: pointer;
31
+ color: ${reversed ? active ? "white" : "#aaa" : active ? "black" : "#ccc"};
32
+ `
33
+ )
34
+ })
35
+ );
36
+ }
37
+ );
38
+ var Icon = React.forwardRef(
39
+ (_a, ref) => {
40
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
41
+ return /* @__PURE__ */ jsx(
42
+ "span",
43
+ __spreadProps(__spreadValues({}, props), {
44
+ ref,
45
+ className: cx(
46
+ "material-icons",
47
+ className,
48
+ css`
49
+ font-size: 18px;
50
+ vertical-align: text-bottom;
51
+ `
52
+ )
53
+ })
54
+ );
55
+ }
56
+ );
57
+ var Menu = React.forwardRef(
58
+ (_a, ref) => {
59
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
60
+ return /* @__PURE__ */ jsx(
61
+ "div",
62
+ __spreadProps(__spreadValues({}, props), {
63
+ "data-testid": "menu",
64
+ ref,
65
+ className: cx(
66
+ className,
67
+ css`
68
+ & > * {
69
+ display: inline-block;
70
+ }
71
+
72
+ & > * + * {
73
+ margin-left: 15px;
74
+ }
75
+ `
76
+ )
77
+ })
78
+ );
79
+ }
80
+ );
81
+ var Portal = ({ children }) => {
82
+ return typeof document === "object" ? ReactDOM.createPortal(children, document.body) : null;
83
+ };
84
+ var Toolbar = React.forwardRef(
85
+ (_a, ref) => {
86
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
87
+ return /* @__PURE__ */ jsx(
88
+ Menu,
89
+ __spreadProps(__spreadValues({}, props), {
90
+ ref,
91
+ className: cx(
92
+ className,
93
+ css`
94
+ position: relative;
95
+ padding: 1px 18px 17px;
96
+ margin: 0 -20px;
97
+ border-bottom: 2px solid #eee;
98
+ margin-bottom: 20px;
99
+ `
100
+ )
101
+ })
102
+ );
103
+ }
104
+ );
105
+
106
+ export {
107
+ Button,
108
+ Icon,
109
+ Menu,
110
+ Portal,
111
+ Toolbar
112
+ };
113
+ //# sourceMappingURL=chunk-HDBI2WN5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/hovering-toolbar/hovering-toolbar-components.tsx"],"sourcesContent":["import { css, cx } from \"@emotion/css\";\nimport React, { PropsWithChildren, Ref } from \"react\";\nimport ReactDOM from \"react-dom\";\n\ninterface BaseProps {\n className: string;\n [key: string]: unknown;\n}\n\nexport const Button = React.forwardRef(\n (\n {\n className,\n active,\n reversed,\n ...props\n }: PropsWithChildren<\n {\n active: boolean;\n reversed: boolean;\n } & BaseProps\n >,\n ref: Ref<HTMLSpanElement | null>,\n ) => (\n <span\n {...props}\n ref={ref as Ref<HTMLSpanElement>}\n className={cx(\n className,\n css`\n cursor: pointer;\n color: ${reversed ? (active ? \"white\" : \"#aaa\") : active ? \"black\" : \"#ccc\"};\n `,\n )}\n />\n ),\n);\n\nexport const Icon = React.forwardRef(\n ({ className, ...props }: PropsWithChildren<BaseProps>, ref: Ref<HTMLSpanElement | null>) => (\n <span\n {...props}\n ref={ref as Ref<HTMLSpanElement>}\n className={cx(\n \"material-icons\",\n className,\n css`\n font-size: 18px;\n vertical-align: text-bottom;\n `,\n )}\n />\n ),\n);\n\nexport const Menu = React.forwardRef(\n ({ className, ...props }: PropsWithChildren<BaseProps>, ref: Ref<HTMLDivElement | null>) => {\n return (\n <div\n {...props}\n data-testid=\"menu\"\n ref={ref as Ref<HTMLDivElement>}\n className={cx(\n className,\n css`\n & > * {\n display: inline-block;\n }\n\n & > * + * {\n margin-left: 15px;\n }\n `,\n )}\n />\n );\n },\n);\nexport const Portal = ({ children }: { children: React.ReactNode }) => {\n return typeof document === \"object\" ? ReactDOM.createPortal(children, document.body) : null;\n};\n\nexport const Toolbar = React.forwardRef(\n ({ className, ...props }: PropsWithChildren<BaseProps>, ref?: Ref<HTMLDivElement>) => (\n <Menu\n {...props}\n ref={ref}\n className={cx(\n className,\n css`\n position: relative;\n padding: 1px 18px 17px;\n margin: 0 -20px;\n border-bottom: 2px solid #eee;\n margin-bottom: 20px;\n `,\n )}\n />\n ),\n);\n"],"mappings":";;;;;;;AAAA,SAAS,KAAK,UAAU;AACxB,OAAO,WAAuC;AAC9C,OAAO,cAAc;AAsBjB;AAfG,IAAM,SAAS,MAAM;AAAA,EAC1B,CACE,IAWA,QACA;AAZA,iBACE;AAAA;AAAA,MACA;AAAA,MACA;AAAA,IAdN,IAWI,IAIK,kBAJL,IAIK;AAAA,MAHH;AAAA,MACA;AAAA,MACA;AAAA;AAUF;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA;AAAA,mBAEW,WAAY,SAAS,UAAU,SAAU,SAAS,UAAU;AAAA;AAAA,QAEzE;AAAA;AAAA,IACF;AAAA;AAEJ;AAEO,IAAM,OAAO,MAAM;AAAA,EACxB,CAAC,IAAuD,QAAkC;AAAzF,iBAAE,YAvCL,IAuCG,IAAgB,kBAAhB,IAAgB,CAAd;AACD;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA;AAAA;AAAA;AAAA,QAIF;AAAA;AAAA,IACF;AAAA;AAEJ;AAEO,IAAM,OAAO,MAAM;AAAA,EACxB,CAAC,IAAuD,QAAoC;AAA3F,iBAAE,YAxDL,IAwDG,IAAgB,kBAAhB,IAAgB,CAAd;AACD,WACE;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC,eAAY;AAAA,QACZ;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AACO,IAAM,SAAS,CAAC,EAAE,SAAS,MAAqC;AACrE,SAAO,OAAO,aAAa,WAAW,SAAS,aAAa,UAAU,SAAS,IAAI,IAAI;AACzF;AAEO,IAAM,UAAU,MAAM;AAAA,EAC3B,CAAC,IAAuD,QAA2B;AAAlF,iBAAE,YAnFL,IAmFG,IAAgB,kBAAhB,IAAgB,CAAd;AACD;AAAA,MAAC;AAAA,uCACK,QADL;AAAA,QAEC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOF;AAAA;AAAA,IACF;AAAA;AAEJ;","names":[]}
@@ -0,0 +1,114 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-YLFAIYRY.mjs";
4
+ import {
5
+ __objRest,
6
+ __spreadProps,
7
+ __spreadValues
8
+ } from "./chunk-MRXNTQOX.mjs";
9
+
10
+ // src/components/ui/dialog.tsx
11
+ import * as React from "react";
12
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
13
+ import { X } from "lucide-react";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ var Dialog = DialogPrimitive.Root;
16
+ var DialogTrigger = DialogPrimitive.Trigger;
17
+ var DialogPortal = (_a) => {
18
+ var _b = _a, {
19
+ className,
20
+ children
21
+ } = _b, props = __objRest(_b, [
22
+ "className",
23
+ "children"
24
+ ]);
25
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx("div", { className: cn(className), children }) }));
26
+ };
27
+ DialogPortal.displayName = DialogPrimitive.Portal.displayName;
28
+ var DialogOverlay = React.forwardRef((_a, ref) => {
29
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
30
+ return /* @__PURE__ */ jsx(
31
+ DialogPrimitive.Overlay,
32
+ __spreadValues({
33
+ ref,
34
+ className: cn(
35
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
36
+ className
37
+ )
38
+ }, props)
39
+ );
40
+ });
41
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
42
+ var DialogContent = React.forwardRef((_a, ref) => {
43
+ var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
44
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [
45
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
46
+ /* @__PURE__ */ jsxs(
47
+ DialogPrimitive.Content,
48
+ __spreadProps(__spreadValues({
49
+ ref,
50
+ className: cn(
51
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
52
+ className
53
+ )
54
+ }, props), {
55
+ children: [
56
+ children,
57
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
58
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
59
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
60
+ ] })
61
+ ]
62
+ })
63
+ )
64
+ ] });
65
+ });
66
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
67
+ var DialogHeader = (_a) => {
68
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
69
+ return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className) }, props));
70
+ };
71
+ DialogHeader.displayName = "DialogHeader";
72
+ var DialogFooter = (_a) => {
73
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
74
+ return /* @__PURE__ */ jsx(
75
+ "div",
76
+ __spreadValues({
77
+ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
78
+ }, props)
79
+ );
80
+ };
81
+ DialogFooter.displayName = "DialogFooter";
82
+ var DialogTitle = React.forwardRef((_a, ref) => {
83
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
84
+ return /* @__PURE__ */ jsx(
85
+ DialogPrimitive.Title,
86
+ __spreadValues({
87
+ ref,
88
+ className: cn("text-lg font-semibold leading-none tracking-tight", className)
89
+ }, props)
90
+ );
91
+ });
92
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
93
+ var DialogDescription = React.forwardRef((_a, ref) => {
94
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
95
+ return /* @__PURE__ */ jsx(
96
+ DialogPrimitive.Description,
97
+ __spreadValues({
98
+ ref,
99
+ className: cn("text-sm text-muted-foreground", className)
100
+ }, props)
101
+ );
102
+ });
103
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
104
+
105
+ export {
106
+ Dialog,
107
+ DialogTrigger,
108
+ DialogContent,
109
+ DialogHeader,
110
+ DialogFooter,
111
+ DialogTitle,
112
+ DialogDescription
113
+ };
114
+ //# sourceMappingURL=chunk-I72DKFHD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({\n className,\n children,\n ...props\n}: DialogPrimitive.DialogPortalProps & { className?: string }) => (\n <DialogPrimitive.Portal {...props}>\n <div className={cn(className)}>{children}</div>\n </DialogPrimitive.Portal>\n);\n\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;;;AAAA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,SAAS;AAcd,cAoCE,YApCF;AAVJ,IAAM,SAAyB;AAE/B,IAAM,gBAAgC;AAEtC,IAAM,eAAe,CAAC,OAIyC;AAJzC,eACpB;AAAA;AAAA,IACA;AAAA,EAZF,IAUsB,IAGjB,kBAHiB,IAGjB;AAAA,IAFH;AAAA,IACA;AAAA;AAGA,6BAAiB,wBAAhB,iCAA2B,QAA3B,EACC,8BAAC,SAAI,WAAW,GAAG,SAAS,GAAI,UAAS,IAC3C;AAAA;AAGF,aAAa,cAA8B,uBAAO;AAElD,IAAM,gBAAsB,iBAG1B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAzBL,IAyBG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI;AAAA,EACN;AAAA,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,gBAAsB,iBAG1B,CAAC,IAAmC,QAAK;AAAxC,eAAE,aAAW,SAxChB,IAwCG,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACd,8BAAC,gBACC;AAAA,wBAAC,iBAAc;AAAA,IACf;AAAA,MAAiB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,SACI,QANL;AAAA,QAQE;AAAA;AAAA,UACD,qBAAiB,uBAAhB,EAAsB,WAAU,iRAC/B;AAAA,gCAAC,KAAE,WAAU,WAAU;AAAA,YACvB,oBAAC,UAAK,WAAU,WAAU,mBAAK;AAAA,aACjC;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAAA,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,eAAe,CAAC,OAA+D;AAA/D,eAAE,YA7DxB,IA6DsB,IAAgB,kBAAhB,IAAgB,CAAd;AACtB,6BAAC,wBAAI,WAAW,GAAG,sDAAsD,SAAS,KAAO,MAAO;AAAA;AAElG,aAAa,cAAc;AAE3B,IAAM,eAAe,CAAC,OAA+D;AAA/D,eAAE,YAlExB,IAkEsB,IAAgB,kBAAhB,IAAgB,CAAd;AACtB;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,iEAAiE,SAAS;AAAA,OACpF;AAAA,EACN;AAAA;AAEF,aAAa,cAAc;AAE3B,IAAM,cAAoB,iBAGxB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YA7EL,IA6EG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,OACxE;AAAA,EACN;AAAA,CACD;AACD,YAAY,cAA8B,sBAAM;AAEhD,IAAM,oBAA0B,iBAG9B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAzFL,IAyFG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,OACpD;AAAA,EACN;AAAA,CACD;AACD,kBAAkB,cAA8B,4BAAY;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-IU3WTXLQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}