@intlayer/design-system 5.6.0 → 5.7.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 (394) hide show
  1. package/dist/.vite/manifest.json +88 -560
  2. package/dist/components/Command/index.d.ts +5 -5
  3. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +2 -27
  4. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  5. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +1 -1
  6. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  7. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +1 -26
  8. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  9. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +2 -0
  10. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
  11. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +2 -0
  12. package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  13. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +9 -28
  14. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  15. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +8 -27
  16. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  17. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.cjs +1 -1
  18. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs +1 -1
  19. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +10 -26
  20. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  21. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +9 -25
  22. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  23. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.cjs +1 -1
  24. package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs +1 -1
  25. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +2 -2
  26. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
  27. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +7 -20
  28. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  29. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +6 -19
  30. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  31. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -2
  32. package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
  33. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +2 -2
  34. package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +2 -2
  35. package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -2
  36. package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -2
  37. package/dist/components/Form/elements/FormElementWrapper.cjs +1 -1
  38. package/dist/components/Form/elements/FormElementWrapper.mjs +1 -1
  39. package/dist/components/IDE/CodeContext.cjs +2 -2
  40. package/dist/components/IDE/CodeContext.mjs +2 -2
  41. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +2 -2
  42. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -2
  43. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +2 -2
  44. package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +2 -2
  45. package/dist/components/Modal/Modal.cjs +3 -3
  46. package/dist/components/Modal/Modal.mjs +3 -3
  47. package/dist/components/Navbar/MobileNavbar.cjs +2 -2
  48. package/dist/components/Navbar/MobileNavbar.mjs +2 -2
  49. package/dist/components/Navbar/index.cjs +3 -3
  50. package/dist/components/Navbar/index.mjs +3 -3
  51. package/dist/components/Pattern/GridPattern.cjs +45 -48
  52. package/dist/components/Pattern/GridPattern.cjs.map +1 -1
  53. package/dist/components/Pattern/GridPattern.d.ts.map +1 -1
  54. package/dist/components/Pattern/GridPattern.mjs +45 -48
  55. package/dist/components/Pattern/GridPattern.mjs.map +1 -1
  56. package/dist/components/SwitchSelector/index.cjs +2 -2
  57. package/dist/components/SwitchSelector/index.mjs +2 -2
  58. package/dist/components/TabSelector/TabSelector.cjs +2 -2
  59. package/dist/components/TabSelector/TabSelector.mjs +2 -2
  60. package/dist/components/TextArea/AutocompleteTextArea.cjs +90 -13
  61. package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
  62. package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
  63. package/dist/components/TextArea/AutocompleteTextArea.mjs +92 -15
  64. package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  65. package/dist/components/index.cjs +0 -38
  66. package/dist/components/index.cjs.map +1 -1
  67. package/dist/components/index.d.ts +0 -2
  68. package/dist/components/index.d.ts.map +1 -1
  69. package/dist/components/index.mjs +0 -38
  70. package/dist/components/index.mjs.map +1 -1
  71. package/dist/hooks/index.cjs +8 -1
  72. package/dist/hooks/index.cjs.map +1 -1
  73. package/dist/hooks/index.d.ts +2 -0
  74. package/dist/hooks/index.d.ts.map +1 -1
  75. package/dist/hooks/index.mjs +9 -2
  76. package/dist/hooks/index.mjs.map +1 -1
  77. package/dist/hooks/intlayerAPIHooks.cjs +29 -31
  78. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  79. package/dist/hooks/intlayerAPIHooks.d.ts +678 -10
  80. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  81. package/dist/hooks/intlayerAPIHooks.mjs +29 -31
  82. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  83. package/dist/hooks/useAsync/useAsync.cjs +0 -1
  84. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  85. package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
  86. package/dist/hooks/useAsync/useAsync.mjs +0 -1
  87. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  88. package/dist/hooks/useAuth/index.cjs +9 -0
  89. package/dist/{components/Auth/AuthenticationBarrier → hooks/useAuth}/index.cjs.map +1 -1
  90. package/dist/hooks/useAuth/index.d.ts +4 -0
  91. package/dist/hooks/useAuth/index.d.ts.map +1 -0
  92. package/dist/hooks/useAuth/index.mjs +9 -0
  93. package/dist/{components/Auth/ExternalsLoginButtons → hooks/useAuth}/index.mjs.map +1 -1
  94. package/dist/hooks/useAuth/useAuth.cjs +25 -0
  95. package/dist/hooks/useAuth/useAuth.cjs.map +1 -0
  96. package/dist/{components/Auth/useAuth/index.d.ts → hooks/useAuth/useAuth.d.ts} +3 -13
  97. package/dist/hooks/useAuth/useAuth.d.ts.map +1 -0
  98. package/dist/{components/Auth/useAuth/index.mjs → hooks/useAuth/useAuth.mjs} +2 -8
  99. package/dist/hooks/useAuth/useAuth.mjs.map +1 -0
  100. package/dist/{components/Auth → hooks}/useAuth/useOAuth2.cjs +3 -3
  101. package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -0
  102. package/dist/{components/Auth → hooks}/useAuth/useOAuth2.d.ts +1 -1
  103. package/dist/hooks/useAuth/useOAuth2.d.ts.map +1 -0
  104. package/dist/{components/Auth → hooks}/useAuth/useOAuth2.mjs +4 -4
  105. package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -0
  106. package/dist/{components/Auth → hooks}/useAuth/useSession.cjs +6 -25
  107. package/dist/hooks/useAuth/useSession.cjs.map +1 -0
  108. package/dist/{components/Auth → hooks}/useAuth/useSession.d.ts +3 -3
  109. package/dist/hooks/useAuth/useSession.d.ts.map +1 -0
  110. package/dist/hooks/useAuth/useSession.mjs +47 -0
  111. package/dist/hooks/useAuth/useSession.mjs.map +1 -0
  112. package/dist/hooks/useIntlayerAPI.cjs +5 -4
  113. package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
  114. package/dist/hooks/useIntlayerAPI.mjs +5 -4
  115. package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
  116. package/dist/{components/Auth → hooks}/useUser/index.cjs +7 -5
  117. package/dist/hooks/useUser/index.cjs.map +1 -0
  118. package/dist/hooks/useUser/index.d.ts +8 -0
  119. package/dist/hooks/useUser/index.d.ts.map +1 -0
  120. package/dist/{components/Auth → hooks}/useUser/index.mjs +6 -4
  121. package/dist/hooks/useUser/index.mjs.map +1 -0
  122. package/dist/{schemas-itjzX6bG.js → schemas-BIuxHDyZ.js} +3 -7
  123. package/dist/{schemas-itjzX6bG.js.map → schemas-BIuxHDyZ.js.map} +1 -1
  124. package/dist/{schemas-DlCjM5d_.cjs → schemas-Q6C7ZNs3.cjs} +3 -7
  125. package/dist/{schemas-DlCjM5d_.cjs.map → schemas-Q6C7ZNs3.cjs.map} +1 -1
  126. package/dist/tailwind.css +1 -1
  127. package/package.json +17 -17
  128. package/dist/components/Auth/AuthModal/index.cjs +0 -106
  129. package/dist/components/Auth/AuthModal/index.cjs.map +0 -1
  130. package/dist/components/Auth/AuthModal/index.d.ts +0 -20
  131. package/dist/components/Auth/AuthModal/index.d.ts.map +0 -1
  132. package/dist/components/Auth/AuthModal/index.mjs +0 -106
  133. package/dist/components/Auth/AuthModal/index.mjs.map +0 -1
  134. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs +0 -36
  135. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.cjs.map +0 -1
  136. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.d.ts +0 -5
  137. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.d.ts.map +0 -1
  138. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs +0 -36
  139. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierClient.mjs.map +0 -1
  140. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs +0 -22
  141. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.cjs.map +0 -1
  142. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts +0 -8
  143. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.d.ts.map +0 -1
  144. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs +0 -22
  145. package/dist/components/Auth/AuthenticationBarrier/AuthenticationBarrierServer.mjs.map +0 -1
  146. package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs +0 -15
  147. package/dist/components/Auth/AuthenticationBarrier/accessValidation.cjs.map +0 -1
  148. package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts +0 -4
  149. package/dist/components/Auth/AuthenticationBarrier/accessValidation.d.ts.map +0 -1
  150. package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs +0 -15
  151. package/dist/components/Auth/AuthenticationBarrier/accessValidation.mjs.map +0 -1
  152. package/dist/components/Auth/AuthenticationBarrier/index.cjs +0 -7
  153. package/dist/components/Auth/AuthenticationBarrier/index.d.ts +0 -23
  154. package/dist/components/Auth/AuthenticationBarrier/index.d.ts.map +0 -1
  155. package/dist/components/Auth/AuthenticationBarrier/index.mjs +0 -7
  156. package/dist/components/Auth/AuthenticationBarrier/index.mjs.map +0 -1
  157. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs +0 -95
  158. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.cjs.map +0 -1
  159. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts +0 -9
  160. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.d.ts.map +0 -1
  161. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs +0 -95
  162. package/dist/components/Auth/ChangePasswordForm/ChangePasswordForm.mjs.map +0 -1
  163. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs +0 -138
  164. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.cjs.map +0 -1
  165. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts +0 -278
  166. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.d.ts.map +0 -1
  167. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs +0 -138
  168. package/dist/components/Auth/ChangePasswordForm/changePasswordForm.content.mjs.map +0 -1
  169. package/dist/components/Auth/ChangePasswordForm/index.cjs +0 -7
  170. package/dist/components/Auth/ChangePasswordForm/index.cjs.map +0 -1
  171. package/dist/components/Auth/ChangePasswordForm/index.d.ts +0 -3
  172. package/dist/components/Auth/ChangePasswordForm/index.d.ts.map +0 -1
  173. package/dist/components/Auth/ChangePasswordForm/index.mjs +0 -7
  174. package/dist/components/Auth/ChangePasswordForm/index.mjs.map +0 -1
  175. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs +0 -34
  176. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.cjs.map +0 -1
  177. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.cjs +0 -131
  178. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.cjs.map +0 -1
  179. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts +0 -271
  180. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.d.ts.map +0 -1
  181. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs +0 -131
  182. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.content.mjs.map +0 -1
  183. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts +0 -8
  184. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.d.ts.map +0 -1
  185. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs +0 -34
  186. package/dist/components/Auth/ChangePasswordForm/useChangePasswordSchema.mjs.map +0 -1
  187. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs +0 -81
  188. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.cjs.map +0 -1
  189. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts +0 -9
  190. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.d.ts.map +0 -1
  191. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs +0 -81
  192. package/dist/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.mjs.map +0 -1
  193. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs +0 -106
  194. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.cjs.map +0 -1
  195. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts +0 -210
  196. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.d.ts.map +0 -1
  197. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs +0 -106
  198. package/dist/components/Auth/DefineNewPasswordForm/defineNewPasswordForm.content.mjs.map +0 -1
  199. package/dist/components/Auth/DefineNewPasswordForm/index.cjs +0 -7
  200. package/dist/components/Auth/DefineNewPasswordForm/index.cjs.map +0 -1
  201. package/dist/components/Auth/DefineNewPasswordForm/index.d.ts +0 -3
  202. package/dist/components/Auth/DefineNewPasswordForm/index.d.ts.map +0 -1
  203. package/dist/components/Auth/DefineNewPasswordForm/index.mjs +0 -7
  204. package/dist/components/Auth/DefineNewPasswordForm/index.mjs.map +0 -1
  205. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs +0 -29
  206. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.cjs.map +0 -1
  207. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs +0 -101
  208. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.cjs.map +0 -1
  209. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts +0 -205
  210. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.d.ts.map +0 -1
  211. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs +0 -101
  212. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.content.mjs.map +0 -1
  213. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts +0 -7
  214. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.d.ts.map +0 -1
  215. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs +0 -29
  216. package/dist/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.mjs.map +0 -1
  217. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +0 -81
  218. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +0 -1
  219. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts +0 -9
  220. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.d.ts.map +0 -1
  221. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +0 -81
  222. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +0 -1
  223. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.cjs +0 -15
  224. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.cjs.map +0 -1
  225. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.d.ts +0 -3
  226. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.d.ts.map +0 -1
  227. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.mjs +0 -15
  228. package/dist/components/Auth/ExternalsLoginButtons/assets/GithubLogo.mjs.map +0 -1
  229. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs +0 -23
  230. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.cjs.map +0 -1
  231. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.d.ts +0 -3
  232. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.d.ts.map +0 -1
  233. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs +0 -23
  234. package/dist/components/Auth/ExternalsLoginButtons/assets/GoogleLogo.mjs.map +0 -1
  235. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs +0 -90
  236. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.cjs.map +0 -1
  237. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts +0 -176
  238. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.d.ts.map +0 -1
  239. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs +0 -90
  240. package/dist/components/Auth/ExternalsLoginButtons/externalsLoginButtons.content.mjs.map +0 -1
  241. package/dist/components/Auth/ExternalsLoginButtons/index.cjs +0 -7
  242. package/dist/components/Auth/ExternalsLoginButtons/index.cjs.map +0 -1
  243. package/dist/components/Auth/ExternalsLoginButtons/index.d.ts +0 -2
  244. package/dist/components/Auth/ExternalsLoginButtons/index.d.ts.map +0 -1
  245. package/dist/components/Auth/ExternalsLoginButtons/index.mjs +0 -7
  246. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs +0 -113
  247. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.cjs.map +0 -1
  248. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts +0 -11
  249. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.d.ts.map +0 -1
  250. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs +0 -113
  251. package/dist/components/Auth/ResetPasswordForm/ResetPasswordForm.mjs.map +0 -1
  252. package/dist/components/Auth/ResetPasswordForm/index.cjs +0 -7
  253. package/dist/components/Auth/ResetPasswordForm/index.cjs.map +0 -1
  254. package/dist/components/Auth/ResetPasswordForm/index.d.ts +0 -3
  255. package/dist/components/Auth/ResetPasswordForm/index.d.ts.map +0 -1
  256. package/dist/components/Auth/ResetPasswordForm/index.mjs +0 -7
  257. package/dist/components/Auth/ResetPasswordForm/index.mjs.map +0 -1
  258. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.cjs +0 -123
  259. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.cjs.map +0 -1
  260. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts +0 -245
  261. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.d.ts.map +0 -1
  262. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.mjs +0 -123
  263. package/dist/components/Auth/ResetPasswordForm/resetPasswordContent.content.mjs.map +0 -1
  264. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs +0 -15
  265. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.cjs.map +0 -1
  266. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.cjs +0 -56
  267. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.cjs.map +0 -1
  268. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts +0 -106
  269. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.d.ts.map +0 -1
  270. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs +0 -56
  271. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.content.mjs.map +0 -1
  272. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts +0 -6
  273. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.d.ts.map +0 -1
  274. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs +0 -15
  275. package/dist/components/Auth/ResetPasswordForm/useResetPasswordSchema.mjs.map +0 -1
  276. package/dist/components/Auth/SignInForm/SignInForm.cjs +0 -105
  277. package/dist/components/Auth/SignInForm/SignInForm.cjs.map +0 -1
  278. package/dist/components/Auth/SignInForm/SignInForm.d.ts +0 -11
  279. package/dist/components/Auth/SignInForm/SignInForm.d.ts.map +0 -1
  280. package/dist/components/Auth/SignInForm/SignInForm.mjs +0 -105
  281. package/dist/components/Auth/SignInForm/SignInForm.mjs.map +0 -1
  282. package/dist/components/Auth/SignInForm/index.cjs +0 -7
  283. package/dist/components/Auth/SignInForm/index.cjs.map +0 -1
  284. package/dist/components/Auth/SignInForm/index.d.ts +0 -3
  285. package/dist/components/Auth/SignInForm/index.d.ts.map +0 -1
  286. package/dist/components/Auth/SignInForm/index.mjs +0 -7
  287. package/dist/components/Auth/SignInForm/index.mjs.map +0 -1
  288. package/dist/components/Auth/SignInForm/signIn.content.cjs +0 -217
  289. package/dist/components/Auth/SignInForm/signIn.content.cjs.map +0 -1
  290. package/dist/components/Auth/SignInForm/signIn.content.d.ts +0 -447
  291. package/dist/components/Auth/SignInForm/signIn.content.d.ts.map +0 -1
  292. package/dist/components/Auth/SignInForm/signIn.content.mjs +0 -217
  293. package/dist/components/Auth/SignInForm/signIn.content.mjs.map +0 -1
  294. package/dist/components/Auth/SignInForm/useSignInSchema.cjs +0 -23
  295. package/dist/components/Auth/SignInForm/useSignInSchema.cjs.map +0 -1
  296. package/dist/components/Auth/SignInForm/useSignInSchema.content.cjs +0 -71
  297. package/dist/components/Auth/SignInForm/useSignInSchema.content.cjs.map +0 -1
  298. package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts +0 -139
  299. package/dist/components/Auth/SignInForm/useSignInSchema.content.d.ts.map +0 -1
  300. package/dist/components/Auth/SignInForm/useSignInSchema.content.mjs +0 -71
  301. package/dist/components/Auth/SignInForm/useSignInSchema.content.mjs.map +0 -1
  302. package/dist/components/Auth/SignInForm/useSignInSchema.d.ts +0 -7
  303. package/dist/components/Auth/SignInForm/useSignInSchema.d.ts.map +0 -1
  304. package/dist/components/Auth/SignInForm/useSignInSchema.mjs +0 -23
  305. package/dist/components/Auth/SignInForm/useSignInSchema.mjs.map +0 -1
  306. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +0 -98
  307. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +0 -1
  308. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts +0 -10
  309. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +0 -1
  310. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +0 -98
  311. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +0 -1
  312. package/dist/components/Auth/SignUpForm/index.cjs +0 -7
  313. package/dist/components/Auth/SignUpForm/index.cjs.map +0 -1
  314. package/dist/components/Auth/SignUpForm/index.d.ts +0 -3
  315. package/dist/components/Auth/SignUpForm/index.d.ts.map +0 -1
  316. package/dist/components/Auth/SignUpForm/index.mjs +0 -7
  317. package/dist/components/Auth/SignUpForm/index.mjs.map +0 -1
  318. package/dist/components/Auth/SignUpForm/signUpForm.content.cjs +0 -184
  319. package/dist/components/Auth/SignUpForm/signUpForm.content.cjs.map +0 -1
  320. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +0 -380
  321. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts.map +0 -1
  322. package/dist/components/Auth/SignUpForm/signUpForm.content.mjs +0 -185
  323. package/dist/components/Auth/SignUpForm/signUpForm.content.mjs.map +0 -1
  324. package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs +0 -33
  325. package/dist/components/Auth/SignUpForm/useSignUpSchema.cjs.map +0 -1
  326. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.cjs +0 -116
  327. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.cjs.map +0 -1
  328. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts +0 -238
  329. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.d.ts.map +0 -1
  330. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.mjs +0 -116
  331. package/dist/components/Auth/SignUpForm/useSignUpSchema.content.mjs.map +0 -1
  332. package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts +0 -8
  333. package/dist/components/Auth/SignUpForm/useSignUpSchema.d.ts.map +0 -1
  334. package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs +0 -33
  335. package/dist/components/Auth/SignUpForm/useSignUpSchema.mjs.map +0 -1
  336. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +0 -79
  337. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +0 -1
  338. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts +0 -10
  339. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +0 -1
  340. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +0 -79
  341. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +0 -1
  342. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.cjs +0 -8
  343. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.cjs.map +0 -1
  344. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.d.ts +0 -4
  345. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.d.ts.map +0 -1
  346. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.mjs +0 -8
  347. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.mjs.map +0 -1
  348. package/dist/components/Auth/VerifyEmailForm/index.cjs +0 -5
  349. package/dist/components/Auth/VerifyEmailForm/index.cjs.map +0 -1
  350. package/dist/components/Auth/VerifyEmailForm/index.content.cjs +0 -73
  351. package/dist/components/Auth/VerifyEmailForm/index.content.cjs.map +0 -1
  352. package/dist/components/Auth/VerifyEmailForm/index.content.d.ts +0 -143
  353. package/dist/components/Auth/VerifyEmailForm/index.content.d.ts.map +0 -1
  354. package/dist/components/Auth/VerifyEmailForm/index.content.mjs +0 -74
  355. package/dist/components/Auth/VerifyEmailForm/index.content.mjs.map +0 -1
  356. package/dist/components/Auth/VerifyEmailForm/index.d.ts +0 -2
  357. package/dist/components/Auth/VerifyEmailForm/index.d.ts.map +0 -1
  358. package/dist/components/Auth/VerifyEmailForm/index.mjs +0 -5
  359. package/dist/components/Auth/VerifyEmailForm/index.mjs.map +0 -1
  360. package/dist/components/Auth/index.cjs +0 -39
  361. package/dist/components/Auth/index.cjs.map +0 -1
  362. package/dist/components/Auth/index.d.ts +0 -12
  363. package/dist/components/Auth/index.d.ts.map +0 -1
  364. package/dist/components/Auth/index.mjs +0 -39
  365. package/dist/components/Auth/index.mjs.map +0 -1
  366. package/dist/components/Auth/useAuth/index.cjs +0 -31
  367. package/dist/components/Auth/useAuth/index.cjs.map +0 -1
  368. package/dist/components/Auth/useAuth/index.d.ts.map +0 -1
  369. package/dist/components/Auth/useAuth/index.mjs.map +0 -1
  370. package/dist/components/Auth/useAuth/useCSRF.cjs +0 -27
  371. package/dist/components/Auth/useAuth/useCSRF.cjs.map +0 -1
  372. package/dist/components/Auth/useAuth/useCSRF.d.ts +0 -6
  373. package/dist/components/Auth/useAuth/useCSRF.d.ts.map +0 -1
  374. package/dist/components/Auth/useAuth/useCSRF.mjs +0 -27
  375. package/dist/components/Auth/useAuth/useCSRF.mjs.map +0 -1
  376. package/dist/components/Auth/useAuth/useOAuth2.cjs.map +0 -1
  377. package/dist/components/Auth/useAuth/useOAuth2.d.ts.map +0 -1
  378. package/dist/components/Auth/useAuth/useOAuth2.mjs.map +0 -1
  379. package/dist/components/Auth/useAuth/useSession.cjs.map +0 -1
  380. package/dist/components/Auth/useAuth/useSession.d.ts.map +0 -1
  381. package/dist/components/Auth/useAuth/useSession.mjs +0 -66
  382. package/dist/components/Auth/useAuth/useSession.mjs.map +0 -1
  383. package/dist/components/Auth/useUser/index.cjs.map +0 -1
  384. package/dist/components/Auth/useUser/index.d.ts +0 -8
  385. package/dist/components/Auth/useUser/index.d.ts.map +0 -1
  386. package/dist/components/Auth/useUser/index.mjs.map +0 -1
  387. package/dist/components/ProfileDropDown/index.cjs +0 -25
  388. package/dist/components/ProfileDropDown/index.cjs.map +0 -1
  389. package/dist/components/ProfileDropDown/index.d.ts +0 -6
  390. package/dist/components/ProfileDropDown/index.d.ts.map +0 -1
  391. package/dist/components/ProfileDropDown/index.mjs +0 -25
  392. package/dist/components/ProfileDropDown/index.mjs.map +0 -1
  393. package/dist/hooks/useIntlayerAPI.d.ts +0 -103
  394. package/dist/hooks/useIntlayerAPI.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GridPattern.cjs","sources":["../../../src/components/Pattern/GridPattern.tsx"],"sourcesContent":["import { type FC, type SVGProps, useId } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype GridPatternProps = {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n squares?: [x: number, y: number][];\n strokeDasharray?: number;\n} & SVGProps<SVGSVGElement>;\n\nexport const GridPattern: FC<GridPatternProps> = ({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n squares,\n className,\n ...props\n}) => {\n const id = useId();\n\n return (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n );\n};\n"],"names":["useId","jsxs","cn","jsx","x","y"],"mappings":";;;;;AAYO,MAAM,cAAoC,CAAC;AAAA,EAChD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,KAAKA,aAAAA,MAAM;AAGf,SAAAC,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,WAAWC,SAAA;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,+BAAC,QACC,EAAA,UAAAA,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,cAAa;AAAA,YACb;AAAA,YACA;AAAA,YAEA,UAAAA,2BAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAG,OAAO,MAAM,OAAO,KAAK;AAAA,gBAC5B,MAAK;AAAA,gBACL;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GAEJ;AAAA,QACAA,2BAAAA,IAAC,QAAK,EAAA,OAAM,QAAO,QAAO,QAAO,aAAa,GAAG,MAAM,QAAQ,EAAE,IAAK,CAAA;AAAA,QACrE,WACCA,2BAAA,IAAC,OAAI,EAAA,GAAM,GAAM,WAAU,oBACxB,UAAA,QAAQ,IAAI,CAAC,CAACC,IAAGC,EAAC,MACjBF,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,aAAY;AAAA,YAEZ,OAAO,QAAQ;AAAA,YACf,QAAQ,SAAS;AAAA,YACjB,GAAGC,KAAI,QAAQ;AAAA,YACf,GAAGC,KAAI,SAAS;AAAA,UAAA;AAAA,UAJX,GAAGD,EAAC,IAAIC,EAAC;AAAA,QAAA,CAMjB,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;;"}
1
+ {"version":3,"file":"GridPattern.cjs","sources":["../../../src/components/Pattern/GridPattern.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype GridPatternProps = {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n squares?: [x: number, y: number][];\n strokeDasharray?: number;\n} & SVGProps<SVGSVGElement>;\n\nconst id = 'grid-pattern';\n\nexport const GridPattern: FC<GridPatternProps> = ({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n squares,\n className,\n ...props\n}) => (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n);\n"],"names":["jsxs","cn","jsx","x","y"],"mappings":";;;;AAYA,MAAM,KAAK;AAEJ,MAAM,cAAoC,CAAC;AAAA,EAChD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,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,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAE5B,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAsD5C,CAAC"}
1
+ {"version":3,"file":"GridPattern.d.ts","sourceRoot":"","sources":["../../../src/components/Pattern/GridPattern.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1C,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAI5B,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAkD5C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useId } from "react";
3
2
  import { cn } from "../../utils/cn.mjs";
3
+ const id = "grid-pattern";
4
4
  const GridPattern = ({
5
5
  width = 40,
6
6
  height = 40,
@@ -10,53 +10,50 @@ const GridPattern = ({
10
10
  squares,
11
11
  className,
12
12
  ...props
13
- }) => {
14
- const id = useId();
15
- return /* @__PURE__ */ jsxs(
16
- "svg",
17
- {
18
- "aria-hidden": "true",
19
- className: cn(
20
- "fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full",
21
- className
22
- ),
23
- ...props,
24
- children: [
25
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
26
- "pattern",
27
- {
28
- id,
29
- width,
30
- height,
31
- patternUnits: "userSpaceOnUse",
32
- x,
33
- y,
34
- children: /* @__PURE__ */ jsx(
35
- "path",
36
- {
37
- d: `M.5 ${height}V.5H${width}`,
38
- fill: "none",
39
- strokeDasharray
40
- }
41
- )
42
- }
43
- ) }),
44
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", strokeWidth: 0, fill: `url(#${id})` }),
45
- squares && /* @__PURE__ */ jsx("svg", { x, y, className: "overflow-visible", children: squares.map(([x2, y2]) => /* @__PURE__ */ jsx(
46
- "rect",
47
- {
48
- strokeWidth: "0",
49
- width: width - 1,
50
- height: height - 1,
51
- x: x2 * width + 1,
52
- y: y2 * height + 1
53
- },
54
- `${x2}-${y2}`
55
- )) })
56
- ]
57
- }
58
- );
59
- };
13
+ }) => /* @__PURE__ */ jsxs(
14
+ "svg",
15
+ {
16
+ "aria-hidden": "true",
17
+ className: cn(
18
+ "fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full",
19
+ className
20
+ ),
21
+ ...props,
22
+ children: [
23
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
24
+ "pattern",
25
+ {
26
+ id,
27
+ width,
28
+ height,
29
+ patternUnits: "userSpaceOnUse",
30
+ x,
31
+ y,
32
+ children: /* @__PURE__ */ jsx(
33
+ "path",
34
+ {
35
+ d: `M.5 ${height}V.5H${width}`,
36
+ fill: "none",
37
+ strokeDasharray
38
+ }
39
+ )
40
+ }
41
+ ) }),
42
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", strokeWidth: 0, fill: `url(#${id})` }),
43
+ squares && /* @__PURE__ */ jsx("svg", { x, y, className: "overflow-visible", children: squares.map(([x2, y2]) => /* @__PURE__ */ jsx(
44
+ "rect",
45
+ {
46
+ strokeWidth: "0",
47
+ width: width - 1,
48
+ height: height - 1,
49
+ x: x2 * width + 1,
50
+ y: y2 * height + 1
51
+ },
52
+ `${x2}-${y2}`
53
+ )) })
54
+ ]
55
+ }
56
+ );
60
57
  export {
61
58
  GridPattern
62
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GridPattern.mjs","sources":["../../../src/components/Pattern/GridPattern.tsx"],"sourcesContent":["import { type FC, type SVGProps, useId } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype GridPatternProps = {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n squares?: [x: number, y: number][];\n strokeDasharray?: number;\n} & SVGProps<SVGSVGElement>;\n\nexport const GridPattern: FC<GridPatternProps> = ({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n squares,\n className,\n ...props\n}) => {\n const id = useId();\n\n return (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n );\n};\n"],"names":["x","y"],"mappings":";;;AAYO,MAAM,cAAoC,CAAC;AAAA,EAChD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,KAAK,MAAM;AAGf,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,QACC,EAAA,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,cAAa;AAAA,YACb;AAAA,YACA;AAAA,YAEA,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAG,OAAO,MAAM,OAAO,KAAK;AAAA,gBAC5B,MAAK;AAAA,gBACL;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GAEJ;AAAA,QACA,oBAAC,QAAK,EAAA,OAAM,QAAO,QAAO,QAAO,aAAa,GAAG,MAAM,QAAQ,EAAE,IAAK,CAAA;AAAA,QACrE,WACC,oBAAC,OAAI,EAAA,GAAM,GAAM,WAAU,oBACxB,UAAA,QAAQ,IAAI,CAAC,CAACA,IAAGC,EAAC,MACjB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,aAAY;AAAA,YAEZ,OAAO,QAAQ;AAAA,YACf,QAAQ,SAAS;AAAA,YACjB,GAAGD,KAAI,QAAQ;AAAA,YACf,GAAGC,KAAI,SAAS;AAAA,UAAA;AAAA,UAJX,GAAGD,EAAC,IAAIC,EAAC;AAAA,QAAA,CAMjB,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
1
+ {"version":3,"file":"GridPattern.mjs","sources":["../../../src/components/Pattern/GridPattern.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype GridPatternProps = {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n squares?: [x: number, y: number][];\n strokeDasharray?: number;\n} & SVGProps<SVGSVGElement>;\n\nconst id = 'grid-pattern';\n\nexport const GridPattern: FC<GridPatternProps> = ({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n squares,\n className,\n ...props\n}) => (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30 pointer-events-none absolute inset-0 h-full max-h-full w-full',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n);\n"],"names":["x","y"],"mappings":";;AAYA,MAAM,KAAK;AAEJ,MAAM,cAAoC,CAAC;AAAA,EAChD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,eAAY;AAAA,IACZ,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ,UAAA;AAAA,MAAA,oBAAC,QACC,EAAA,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,cAAa;AAAA,UACb;AAAA,UACA;AAAA,UAEA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,GAAG,OAAO,MAAM,OAAO,KAAK;AAAA,cAC5B,MAAK;AAAA,cACL;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA,GAEJ;AAAA,MACA,oBAAC,QAAK,EAAA,OAAM,QAAO,QAAO,QAAO,aAAa,GAAG,MAAM,QAAQ,EAAE,IAAK,CAAA;AAAA,MACrE,WACC,oBAAC,OAAI,EAAA,GAAM,GAAM,WAAU,oBACxB,UAAA,QAAQ,IAAI,CAAC,CAACA,IAAGC,EAAC,MACjB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,aAAY;AAAA,UAEZ,OAAO,QAAQ;AAAA,UACf,QAAQ,SAAS;AAAA,UACjB,GAAGD,KAAI,QAAQ;AAAA,UACf,GAAGC,KAAI,SAAS;AAAA,QAAA;AAAA,QAJX,GAAGD,EAAC,IAAIC,EAAC;AAAA,MAAA,CAMjB,EACH,CAAA;AAAA,IAAA;AAAA,EAAA;AAEJ;"}
@@ -5,10 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
5
5
  const ReactExports = require("react");
6
6
  const classVarianceAuthority = require("class-variance-authority");
7
7
  require("@intlayer/editor-react");
8
+ require("../Toaster/Toast.cjs");
9
+ require("../../hooks/useAsync/useAsyncStateStore.cjs");
8
10
  require("@intlayer/api");
9
11
  require("@intlayer/config/built");
10
- require("../../hooks/useAsync/useAsyncStateStore.cjs");
11
- require("../Toaster/Toast.cjs");
12
12
  require("deepmerge");
13
13
  const hooks_useItemSelector = require("../../hooks/useItemSelector.cjs");
14
14
  require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
@@ -3,10 +3,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState, useRef, useEffect, createElement } from "react";
4
4
  import { cva } from "class-variance-authority";
5
5
  import "@intlayer/editor-react";
6
+ import "../Toaster/Toast.mjs";
7
+ import "../../hooks/useAsync/useAsyncStateStore.mjs";
6
8
  import "@intlayer/api";
7
9
  import "@intlayer/config/built";
8
- import "../../hooks/useAsync/useAsyncStateStore.mjs";
9
- import "../Toaster/Toast.mjs";
10
10
  import "deepmerge";
11
11
  import { useItemSelector } from "../../hooks/useItemSelector.mjs";
12
12
  import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
@@ -5,10 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
5
5
  const classVarianceAuthority = require("class-variance-authority");
6
6
  const ReactExports = require("react");
7
7
  require("@intlayer/editor-react");
8
+ require("../Toaster/Toast.cjs");
9
+ require("../../hooks/useAsync/useAsyncStateStore.cjs");
8
10
  require("@intlayer/api");
9
11
  require("@intlayer/config/built");
10
- require("../../hooks/useAsync/useAsyncStateStore.cjs");
11
- require("../Toaster/Toast.cjs");
12
12
  require("deepmerge");
13
13
  const hooks_useItemSelector = require("../../hooks/useItemSelector.cjs");
14
14
  require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
@@ -3,10 +3,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { cva } from "class-variance-authority";
4
4
  import { useRef, cloneElement } from "react";
5
5
  import "@intlayer/editor-react";
6
+ import "../Toaster/Toast.mjs";
7
+ import "../../hooks/useAsync/useAsyncStateStore.mjs";
6
8
  import "@intlayer/api";
7
9
  import "@intlayer/config/built";
8
- import "../../hooks/useAsync/useAsyncStateStore.mjs";
9
- import "../Toaster/Toast.mjs";
10
10
  import "deepmerge";
11
11
  import { useItemSelector } from "../../hooks/useItemSelector.mjs";
12
12
  import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
@@ -6,6 +6,8 @@ const editorReact = require("@intlayer/editor-react");
6
6
  const ReactExports = require("react");
7
7
  const hooks_intlayerAPIHooks = require("../../hooks/intlayerAPIHooks.cjs");
8
8
  require("../../hooks/useAsync/useAsyncStateStore.cjs");
9
+ require("@intlayer/api");
10
+ require("@intlayer/config/built");
9
11
  require("deepmerge");
10
12
  require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
11
13
  const components_TextArea_AutoSizeTextArea = require("./AutoSizeTextArea.cjs");
@@ -30,6 +32,11 @@ const AutoCompleteTextarea = ({
30
32
  const [isTyped, setIsTyped] = ReactExports.useState(false);
31
33
  const [text, setText] = ReactExports.useState(defaultValue);
32
34
  const [suggestion, setSuggestion] = ReactExports.useState("");
35
+ const textareaRef = ReactExports.useRef(null);
36
+ const placeholderRef = ReactExports.useRef(null);
37
+ const ghostLayerRef = ReactExports.useRef(null);
38
+ const [suggestionPosition, setSuggestionPosition] = ReactExports.useState(null);
39
+ const [cursorAtFetch, setCursorAtFetch] = ReactExports.useState(-1);
33
40
  const debouncedText = useDebounce(text, 200);
34
41
  ReactExports.useEffect(() => {
35
42
  if (typeof props.value === "undefined") return;
@@ -40,18 +47,33 @@ const AutoCompleteTextarea = ({
40
47
  if (!isTyped) return;
41
48
  const fetchSuggestion = async () => {
42
49
  try {
50
+ const cursor = textareaRef.current?.selectionStart ?? debouncedText.length;
51
+ const before = debouncedText.slice(0, cursor);
52
+ const after = debouncedText.slice(cursor);
53
+ const numLines = 5;
54
+ const beforeLines = before.split("\n");
55
+ const contextBeforeLines = beforeLines.slice(
56
+ Math.max(0, beforeLines.length - numLines - 1),
57
+ -1
58
+ );
59
+ const contextBefore = contextBeforeLines.join("\n");
60
+ const currentLine = beforeLines[beforeLines.length - 1] ?? "";
61
+ const afterLines = after.split("\n");
62
+ const contextAfter = afterLines.slice(1, numLines + 1).join("\n");
43
63
  const response = await autocomplete({
44
- text: debouncedText,
45
- openAiApiKey: configuration.editor.openAiApiKey,
46
- model: configuration.editor.openAiApiModel,
47
- temperature: configuration.editor.openAiApiTemperature
64
+ text: before,
65
+ contextBefore,
66
+ currentLine,
67
+ contextAfter,
68
+ aiOptions: {
69
+ apiKey: configuration.editor.openAiApiKey,
70
+ model: configuration.editor.openAiApiModel,
71
+ temperature: configuration.editor.openAiApiTemperature
72
+ }
48
73
  });
49
74
  const autocompletion = response?.data?.autocompletion ?? "";
50
- if (autocompletion.startsWith(debouncedText)) {
51
- const remaining = autocompletion.slice(debouncedText.length);
52
- return setSuggestion(remaining);
53
- }
54
- return setSuggestion(autocompletion);
75
+ setSuggestion(autocompletion);
76
+ setCursorAtFetch(cursor);
55
77
  } catch (err) {
56
78
  console.error("Autocomplete error:", err);
57
79
  }
@@ -62,31 +84,79 @@ const AutoCompleteTextarea = ({
62
84
  } else {
63
85
  setSuggestion("");
64
86
  }
65
- }, [debouncedText, isActive]);
87
+ }, [debouncedText, isActive, autocomplete, configuration]);
88
+ ReactExports.useEffect(() => {
89
+ if (!suggestion || cursorAtFetch === -1 || !placeholderRef.current || !ghostLayerRef.current) {
90
+ setSuggestionPosition(null);
91
+ return;
92
+ }
93
+ const rect = placeholderRef.current.getBoundingClientRect();
94
+ const parentRect = ghostLayerRef.current.getBoundingClientRect();
95
+ setSuggestionPosition({
96
+ left: rect.left - parentRect.left,
97
+ top: rect.top - parentRect.top
98
+ });
99
+ }, [suggestion, cursorAtFetch, text]);
66
100
  const acceptSuggestion = () => {
67
- setText((prevText) => prevText + suggestion);
101
+ const currentCursor = textareaRef.current?.selectionStart ?? cursorAtFetch;
102
+ if (currentCursor !== cursorAtFetch) return;
103
+ const newText = text.slice(0, currentCursor) + suggestion + text.slice(currentCursor);
104
+ setText(newText);
68
105
  setSuggestion("");
106
+ setCursorAtFetch(-1);
107
+ setTimeout(() => {
108
+ textareaRef.current?.focus();
109
+ const newCursorPos = currentCursor + suggestion.length;
110
+ textareaRef.current?.setSelectionRange(newCursorPos, newCursorPos);
111
+ }, 0);
69
112
  };
70
113
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
71
114
  /* @__PURE__ */ jsxRuntime.jsxs(
72
115
  "div",
73
116
  {
117
+ ref: ghostLayerRef,
74
118
  className: "pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]",
75
119
  "aria-hidden": "true",
76
120
  children: [
77
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "align-text-top text-transparent", children: text }),
78
- (suggestion || suggestionProp) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-neutral ml-3 align-text-top", children: suggestionProp ?? suggestion })
121
+ suggestion && cursorAtFetch !== -1 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
122
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "align-text-top text-transparent", children: text.slice(0, cursorAtFetch) }),
123
+ /* @__PURE__ */ jsxRuntime.jsx(
124
+ "span",
125
+ {
126
+ ref: placeholderRef,
127
+ style: { visibility: "hidden" },
128
+ "aria-hidden": "true",
129
+ children: suggestion
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "align-text-top text-transparent", children: text.slice(cursorAtFetch) })
133
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "align-text-top text-transparent", children: text }),
134
+ suggestionProp && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-neutral align-text-top", children: suggestionProp })
79
135
  ]
80
136
  }
81
137
  ),
138
+ suggestion && suggestionPosition && /* @__PURE__ */ jsxRuntime.jsx(
139
+ "div",
140
+ {
141
+ className: "pointer-events-none text-neutral whitespace-pre-wrap break-words text-base leading-[1.45rem] md:text-sm md:leading-[1.23rem]",
142
+ style: {
143
+ position: "absolute",
144
+ left: suggestionPosition.left,
145
+ top: suggestionPosition.top
146
+ },
147
+ children: suggestion
148
+ }
149
+ ),
82
150
  /* @__PURE__ */ jsxRuntime.jsx(
83
151
  components_TextArea_AutoSizeTextArea.AutoSizedTextArea,
84
152
  {
85
153
  ...props,
154
+ ref: textareaRef,
86
155
  value: text,
87
156
  onChange: (e) => {
88
157
  setIsTyped(true);
89
158
  setText(e.target.value);
159
+ setSuggestion("");
90
160
  props.onChange?.(e);
91
161
  },
92
162
  onKeyDown: (e) => {
@@ -95,6 +165,13 @@ const AutoCompleteTextarea = ({
95
165
  acceptSuggestion();
96
166
  }
97
167
  props.onKeyDown?.(e);
168
+ },
169
+ onSelect: (e) => {
170
+ if (suggestion && e.target.selectionStart !== cursorAtFetch) {
171
+ setSuggestion("");
172
+ setCursorAtFetch(-1);
173
+ }
174
+ props.onSelect?.(e);
98
175
  }
99
176
  }
100
177
  )
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteTextArea.cjs","sources":["../../../src/components/TextArea/AutocompleteTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { type FC, useState, useEffect } from 'react';\nimport { useAutocomplete } from '../../hooks';\nimport {\n type AutoSizedTextAreaProps,\n AutoSizedTextArea,\n} from './AutoSizeTextArea';\n\nexport const useDebounce = <T,>(value: T, delay: number): T => {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n // Cleanup the timer if value changes before 'delay' ms\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n};\n\nexport type AutocompleteTextAreaProps = AutoSizedTextAreaProps & {\n isActive?: boolean;\n suggestion?: string;\n};\n\nexport const AutoCompleteTextarea: FC<AutocompleteTextAreaProps> = ({\n isActive = true,\n suggestion: suggestionProp,\n ...props\n}) => {\n const defaultValue = String(props.value ?? props.defaultValue ?? '');\n const { autocomplete } = useAutocomplete();\n const configuration = useConfiguration();\n const [isTyped, setIsTyped] = useState(false);\n const [text, setText] = useState(defaultValue);\n const [suggestion, setSuggestion] = useState('');\n\n // Only update this “debouncedText” after the user stops typing for 500ms\n const debouncedText = useDebounce(text, 200);\n\n useEffect(() => {\n if (typeof props.value === 'undefined') return;\n setText(defaultValue);\n }, [props.value, props.defaultValue]);\n\n useEffect(() => {\n if (!isActive) return;\n if (!isTyped) return;\n\n const fetchSuggestion = async () => {\n try {\n const response = await autocomplete({\n text: debouncedText,\n openAiApiKey: configuration.editor.openAiApiKey,\n model: configuration.editor.openAiApiModel,\n temperature: configuration.editor.openAiApiTemperature,\n });\n // e.g. response.data.autocompletion = \"Hello World\"\n const autocompletion = response?.data?.autocompletion ?? '';\n\n // If the suggested text starts with what the user typed,\n // we only store the *remaining* part as the suggestion\n // so that we can render \"ghost\" text appropriately.\n if (autocompletion.startsWith(debouncedText)) {\n const remaining = autocompletion.slice(debouncedText.length);\n return setSuggestion(remaining);\n }\n\n return setSuggestion(autocompletion);\n } catch (err) {\n console.error('Autocomplete error:', err);\n }\n };\n\n if (debouncedText.length > 3) {\n // Only fetch if user typed more than 3 chars and has paused\n setSuggestion('');\n fetchSuggestion();\n } else {\n // If typed less than threshold, clear the suggestion\n setSuggestion('');\n }\n }, [debouncedText, isActive]);\n\n const acceptSuggestion = () => {\n // Merge the typed text with the suggestion\n setText((prevText) => prevText + suggestion);\n setSuggestion('');\n };\n\n return (\n <div className=\"relative w-full\">\n {/*\n --- Background/Ghost layer ---\n Mirrors user's typed text and shows suggestion as ghosted/gray\n */}\n <div\n className=\"pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]\"\n aria-hidden=\"true\"\n >\n <span className=\"align-text-top text-transparent\">{text}</span>\n {(suggestion || suggestionProp) && (\n <span className=\"text-neutral ml-3 align-text-top\">\n {suggestionProp ?? suggestion}\n </span>\n )}\n </div>\n {/*\n --- Actual editable textarea ---\n Must share the same styling (font size, line-height, etc.) so\n text lines up exactly underneath the background layer.\n */}\n <AutoSizedTextArea\n {...props}\n value={text}\n onChange={(e) => {\n setIsTyped(true);\n setText(e.target.value);\n props.onChange?.(e);\n }}\n onKeyDown={(e) => {\n // If user presses Tab and we have a suggestion, accept it\n if (e.key === 'Tab' && suggestion) {\n e.preventDefault();\n acceptSuggestion();\n }\n props.onKeyDown?.(e);\n }}\n />\n </div>\n );\n};\n"],"names":["useState","useEffect","useAutocomplete","useConfiguration","jsxs","jsx","AutoSizedTextArea"],"mappings":";;;;;;;;;;;AAUa,MAAA,cAAc,CAAK,OAAU,UAAqB;AAC7D,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,aAAAA,SAAY,KAAK;AAE7DC,eAAAA,UAAU,MAAM;AACR,UAAA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AAA;AAAA,IAE5C;AAEI,QAAA,cAAc,SAAS,GAAG;AAE5B,oBAAc,EAAE;AACA,sBAAA;AAAA,IAAA,OACX;AAEL,oBAAc,EAAE;AAAA,IAAA;AAAA,EAClB,GACC,CAAC,eAAe,QAAQ,CAAC;AAE5B,QAAM,mBAAmB,MAAM;AAErB,YAAA,CAAC,aAAa,WAAW,UAAU;AAC3C,kBAAc,EAAE;AAAA,EAClB;AAGE,SAAAG,2BAAA,KAAC,OAAI,EAAA,WAAU,mBAKb,UAAA;AAAA,IAAAA,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAY;AAAA,QAEZ,UAAA;AAAA,UAACC,2BAAA,IAAA,QAAA,EAAK,WAAU,mCAAmC,UAAK,MAAA;AAAA,WACtD,cAAc,mBACdA,2BAAAA,IAAC,UAAK,WAAU,oCACb,4BAAkB,WACrB,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,IAMAA,2BAAA;AAAA,MAACC,qCAAA;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ,OAAO;AAAA,QACP,UAAU,CAAC,MAAM;AACf,qBAAW,IAAI;AACP,kBAAA,EAAE,OAAO,KAAK;AACtB,gBAAM,WAAW,CAAC;AAAA,QACpB;AAAA,QACA,WAAW,CAAC,MAAM;AAEZ,cAAA,EAAE,QAAQ,SAAS,YAAY;AACjC,cAAE,eAAe;AACA,6BAAA;AAAA,UAAA;AAEnB,gBAAM,YAAY,CAAC;AAAA,QAAA;AAAA,MACrB;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;;;"}
1
+ {"version":3,"file":"AutocompleteTextArea.cjs","sources":["../../../src/components/TextArea/AutocompleteTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { type FC, useEffect, useRef, useState } from 'react';\nimport { useAutocomplete } from '../../hooks';\nimport {\n type AutoSizedTextAreaProps,\n AutoSizedTextArea,\n} from './AutoSizeTextArea';\n\nexport const useDebounce = <T,>(value: T, delay: number): T => {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n // Cleanup the timer if value changes before 'delay' ms\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n};\n\nexport type AutocompleteTextAreaProps = AutoSizedTextAreaProps & {\n isActive?: boolean;\n suggestion?: string;\n};\n\nexport const AutoCompleteTextarea: FC<AutocompleteTextAreaProps> = ({\n isActive = true,\n suggestion: suggestionProp,\n ...props\n}) => {\n const defaultValue = String(props.value ?? props.defaultValue ?? '');\n const { autocomplete } = useAutocomplete();\n const configuration = useConfiguration();\n const [isTyped, setIsTyped] = useState(false);\n const [text, setText] = useState(defaultValue);\n const [suggestion, setSuggestion] = useState('');\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const placeholderRef = useRef<HTMLSpanElement>(null);\n const ghostLayerRef = useRef<HTMLDivElement>(null);\n const [suggestionPosition, setSuggestionPosition] = useState<{\n left: number;\n top: number;\n } | null>(null);\n const [cursorAtFetch, setCursorAtFetch] = useState(-1);\n\n // Only update this “debouncedText” after the user stops typing for 200ms\n const debouncedText = useDebounce(text, 200);\n\n useEffect(() => {\n if (typeof props.value === 'undefined') return;\n setText(defaultValue);\n }, [props.value, props.defaultValue]);\n\n useEffect(() => {\n if (!isActive) return;\n if (!isTyped) return;\n\n const fetchSuggestion = async () => {\n try {\n const cursor =\n textareaRef.current?.selectionStart ?? debouncedText.length;\n const before = debouncedText.slice(0, cursor);\n const after = debouncedText.slice(cursor);\n const numLines = 5;\n const beforeLines = before.split('\\n');\n const contextBeforeLines = beforeLines.slice(\n Math.max(0, beforeLines.length - numLines - 1),\n -1\n );\n const contextBefore = contextBeforeLines.join('\\n');\n const currentLine = beforeLines[beforeLines.length - 1] ?? '';\n const afterLines = after.split('\\n');\n const contextAfter = afterLines.slice(1, numLines + 1).join('\\n');\n\n const response = await autocomplete({\n text: before,\n contextBefore,\n currentLine,\n contextAfter,\n aiOptions: {\n apiKey: configuration.editor.openAiApiKey,\n model: configuration.editor.openAiApiModel,\n temperature: configuration.editor.openAiApiTemperature,\n },\n });\n const autocompletion = response?.data?.autocompletion ?? '';\n\n setSuggestion(autocompletion);\n setCursorAtFetch(cursor);\n } catch (err) {\n console.error('Autocomplete error:', err);\n }\n };\n\n if (debouncedText.length > 3) {\n // Only fetch if user typed more than 3 chars and has paused\n setSuggestion('');\n fetchSuggestion();\n } else {\n // If typed less than threshold, clear the suggestion\n setSuggestion('');\n }\n }, [debouncedText, isActive, autocomplete, configuration]);\n\n useEffect(() => {\n if (\n !suggestion ||\n cursorAtFetch === -1 ||\n !placeholderRef.current ||\n !ghostLayerRef.current\n ) {\n setSuggestionPosition(null);\n return;\n }\n\n const rect = placeholderRef.current.getBoundingClientRect();\n const parentRect = ghostLayerRef.current.getBoundingClientRect();\n setSuggestionPosition({\n left: rect.left - parentRect.left,\n top: rect.top - parentRect.top,\n });\n }, [suggestion, cursorAtFetch, text]);\n\n const acceptSuggestion = () => {\n const currentCursor = textareaRef.current?.selectionStart ?? cursorAtFetch;\n if (currentCursor !== cursorAtFetch) return;\n const newText =\n text.slice(0, currentCursor) + suggestion + text.slice(currentCursor);\n setText(newText);\n setSuggestion('');\n setCursorAtFetch(-1);\n setTimeout(() => {\n textareaRef.current?.focus();\n const newCursorPos = currentCursor + suggestion.length;\n textareaRef.current?.setSelectionRange(newCursorPos, newCursorPos);\n }, 0);\n };\n\n return (\n <div className=\"relative w-full\">\n <div\n ref={ghostLayerRef}\n className=\"pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]\"\n aria-hidden=\"true\"\n >\n {suggestion && cursorAtFetch !== -1 ? (\n <>\n <span className=\"align-text-top text-transparent\">\n {text.slice(0, cursorAtFetch)}\n </span>\n <span\n ref={placeholderRef}\n style={{ visibility: 'hidden' }}\n aria-hidden=\"true\"\n >\n {suggestion}\n </span>\n <span className=\"align-text-top text-transparent\">\n {text.slice(cursorAtFetch)}\n </span>\n </>\n ) : (\n <span className=\"align-text-top text-transparent\">{text}</span>\n )}\n {suggestionProp && (\n <span className=\"text-neutral align-text-top\">{suggestionProp}</span>\n )}\n </div>\n {suggestion && suggestionPosition && (\n <div\n className=\"pointer-events-none text-neutral whitespace-pre-wrap break-words text-base leading-[1.45rem] md:text-sm md:leading-[1.23rem]\"\n style={{\n position: 'absolute',\n left: suggestionPosition.left,\n top: suggestionPosition.top,\n }}\n >\n {suggestion}\n </div>\n )}\n <AutoSizedTextArea\n {...props}\n ref={textareaRef}\n value={text}\n onChange={(e) => {\n setIsTyped(true);\n setText(e.target.value);\n setSuggestion('');\n props.onChange?.(e);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Tab' && suggestion) {\n e.preventDefault();\n acceptSuggestion();\n }\n props.onKeyDown?.(e);\n }}\n onSelect={(e) => {\n if (\n suggestion &&\n (e.target as HTMLTextAreaElement).selectionStart !== cursorAtFetch\n ) {\n setSuggestion('');\n setCursorAtFetch(-1);\n }\n props.onSelect?.(e);\n }}\n />\n </div>\n );\n};\n"],"names":["useState","useEffect","useAutocomplete","useConfiguration","useRef","jsxs","Fragment","jsx","AutoSizedTextArea"],"mappings":";;;;;;;;;;;;;AAUa,MAAA,cAAc,CAAK,OAAU,UAAqB;AAC7D,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,aAAAA,SAAY,KAAK;AAE7DC,eAAAA,UAAU,MAAM;AACR,UAAA,QAAQ,WAAW,MAAM;AAC7B,wBAAkB,KAAK;AAAA,OACtB,KAAK;AAGD,WAAA,MAAM,aAAa,KAAK;AAAA,EAAA,GAC9B,CAAC,OAAO,KAAK,CAAC;AAEV,SAAA;AACT;AAOO,MAAM,uBAAsD,CAAC;AAAA,EAClE,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,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wBAAc,EAAE;AAChB,gBAAM,WAAW,CAAC;AAAA,QACpB;AAAA,QACA,WAAW,CAAC,MAAM;AACZ,cAAA,EAAE,QAAQ,SAAS,YAAY;AACjC,cAAE,eAAe;AACA,6BAAA;AAAA,UAAA;AAEnB,gBAAM,YAAY,CAAC;AAAA,QACrB;AAAA,QACA,UAAU,CAAC,MAAM;AACf,cACE,cACC,EAAE,OAA+B,mBAAmB,eACrD;AACA,0BAAc,EAAE;AAChB,6BAAiB,EAAE;AAAA,UAAA;AAErB,gBAAM,WAAW,CAAC;AAAA,QAAA;AAAA,MACpB;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteTextArea.d.ts","sourceRoot":"","sources":["../../../src/components/TextArea/AutocompleteTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAErD,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,WAAW,GAAI,CAAC,EAAG,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,CAazD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,GAAG;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA0G9D,CAAC"}
1
+ {"version":3,"file":"AutocompleteTextArea.d.ts","sourceRoot":"","sources":["../../../src/components/TextArea/AutocompleteTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAE7D,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,WAAW,GAAI,CAAC,EAAG,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,CAazD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,GAAG;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAyL9D,CAAC"}
@@ -1,9 +1,11 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
3
  import { useConfiguration } from "@intlayer/editor-react";
4
- import { useState, useEffect } from "react";
4
+ import { useState, useEffect, useRef } from "react";
5
5
  import { useAutocomplete } from "../../hooks/intlayerAPIHooks.mjs";
6
6
  import "../../hooks/useAsync/useAsyncStateStore.mjs";
7
+ import "@intlayer/api";
8
+ import "@intlayer/config/built";
7
9
  import "deepmerge";
8
10
  import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
9
11
  import { AutoSizedTextArea } from "./AutoSizeTextArea.mjs";
@@ -28,6 +30,11 @@ const AutoCompleteTextarea = ({
28
30
  const [isTyped, setIsTyped] = useState(false);
29
31
  const [text, setText] = useState(defaultValue);
30
32
  const [suggestion, setSuggestion] = useState("");
33
+ const textareaRef = useRef(null);
34
+ const placeholderRef = useRef(null);
35
+ const ghostLayerRef = useRef(null);
36
+ const [suggestionPosition, setSuggestionPosition] = useState(null);
37
+ const [cursorAtFetch, setCursorAtFetch] = useState(-1);
31
38
  const debouncedText = useDebounce(text, 200);
32
39
  useEffect(() => {
33
40
  if (typeof props.value === "undefined") return;
@@ -38,18 +45,33 @@ const AutoCompleteTextarea = ({
38
45
  if (!isTyped) return;
39
46
  const fetchSuggestion = async () => {
40
47
  try {
48
+ const cursor = textareaRef.current?.selectionStart ?? debouncedText.length;
49
+ const before = debouncedText.slice(0, cursor);
50
+ const after = debouncedText.slice(cursor);
51
+ const numLines = 5;
52
+ const beforeLines = before.split("\n");
53
+ const contextBeforeLines = beforeLines.slice(
54
+ Math.max(0, beforeLines.length - numLines - 1),
55
+ -1
56
+ );
57
+ const contextBefore = contextBeforeLines.join("\n");
58
+ const currentLine = beforeLines[beforeLines.length - 1] ?? "";
59
+ const afterLines = after.split("\n");
60
+ const contextAfter = afterLines.slice(1, numLines + 1).join("\n");
41
61
  const response = await autocomplete({
42
- text: debouncedText,
43
- openAiApiKey: configuration.editor.openAiApiKey,
44
- model: configuration.editor.openAiApiModel,
45
- temperature: configuration.editor.openAiApiTemperature
62
+ text: before,
63
+ contextBefore,
64
+ currentLine,
65
+ contextAfter,
66
+ aiOptions: {
67
+ apiKey: configuration.editor.openAiApiKey,
68
+ model: configuration.editor.openAiApiModel,
69
+ temperature: configuration.editor.openAiApiTemperature
70
+ }
46
71
  });
47
72
  const autocompletion = response?.data?.autocompletion ?? "";
48
- if (autocompletion.startsWith(debouncedText)) {
49
- const remaining = autocompletion.slice(debouncedText.length);
50
- return setSuggestion(remaining);
51
- }
52
- return setSuggestion(autocompletion);
73
+ setSuggestion(autocompletion);
74
+ setCursorAtFetch(cursor);
53
75
  } catch (err) {
54
76
  console.error("Autocomplete error:", err);
55
77
  }
@@ -60,31 +82,79 @@ const AutoCompleteTextarea = ({
60
82
  } else {
61
83
  setSuggestion("");
62
84
  }
63
- }, [debouncedText, isActive]);
85
+ }, [debouncedText, isActive, autocomplete, configuration]);
86
+ useEffect(() => {
87
+ if (!suggestion || cursorAtFetch === -1 || !placeholderRef.current || !ghostLayerRef.current) {
88
+ setSuggestionPosition(null);
89
+ return;
90
+ }
91
+ const rect = placeholderRef.current.getBoundingClientRect();
92
+ const parentRect = ghostLayerRef.current.getBoundingClientRect();
93
+ setSuggestionPosition({
94
+ left: rect.left - parentRect.left,
95
+ top: rect.top - parentRect.top
96
+ });
97
+ }, [suggestion, cursorAtFetch, text]);
64
98
  const acceptSuggestion = () => {
65
- setText((prevText) => prevText + suggestion);
99
+ const currentCursor = textareaRef.current?.selectionStart ?? cursorAtFetch;
100
+ if (currentCursor !== cursorAtFetch) return;
101
+ const newText = text.slice(0, currentCursor) + suggestion + text.slice(currentCursor);
102
+ setText(newText);
66
103
  setSuggestion("");
104
+ setCursorAtFetch(-1);
105
+ setTimeout(() => {
106
+ textareaRef.current?.focus();
107
+ const newCursorPos = currentCursor + suggestion.length;
108
+ textareaRef.current?.setSelectionRange(newCursorPos, newCursorPos);
109
+ }, 0);
67
110
  };
68
111
  return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
69
112
  /* @__PURE__ */ jsxs(
70
113
  "div",
71
114
  {
115
+ ref: ghostLayerRef,
72
116
  className: "pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]",
73
117
  "aria-hidden": "true",
74
118
  children: [
75
- /* @__PURE__ */ jsx("span", { className: "align-text-top text-transparent", children: text }),
76
- (suggestion || suggestionProp) && /* @__PURE__ */ jsx("span", { className: "text-neutral ml-3 align-text-top", children: suggestionProp ?? suggestion })
119
+ suggestion && cursorAtFetch !== -1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
120
+ /* @__PURE__ */ jsx("span", { className: "align-text-top text-transparent", children: text.slice(0, cursorAtFetch) }),
121
+ /* @__PURE__ */ jsx(
122
+ "span",
123
+ {
124
+ ref: placeholderRef,
125
+ style: { visibility: "hidden" },
126
+ "aria-hidden": "true",
127
+ children: suggestion
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx("span", { className: "align-text-top text-transparent", children: text.slice(cursorAtFetch) })
131
+ ] }) : /* @__PURE__ */ jsx("span", { className: "align-text-top text-transparent", children: text }),
132
+ suggestionProp && /* @__PURE__ */ jsx("span", { className: "text-neutral align-text-top", children: suggestionProp })
77
133
  ]
78
134
  }
79
135
  ),
136
+ suggestion && suggestionPosition && /* @__PURE__ */ jsx(
137
+ "div",
138
+ {
139
+ className: "pointer-events-none text-neutral whitespace-pre-wrap break-words text-base leading-[1.45rem] md:text-sm md:leading-[1.23rem]",
140
+ style: {
141
+ position: "absolute",
142
+ left: suggestionPosition.left,
143
+ top: suggestionPosition.top
144
+ },
145
+ children: suggestion
146
+ }
147
+ ),
80
148
  /* @__PURE__ */ jsx(
81
149
  AutoSizedTextArea,
82
150
  {
83
151
  ...props,
152
+ ref: textareaRef,
84
153
  value: text,
85
154
  onChange: (e) => {
86
155
  setIsTyped(true);
87
156
  setText(e.target.value);
157
+ setSuggestion("");
88
158
  props.onChange?.(e);
89
159
  },
90
160
  onKeyDown: (e) => {
@@ -93,6 +163,13 @@ const AutoCompleteTextarea = ({
93
163
  acceptSuggestion();
94
164
  }
95
165
  props.onKeyDown?.(e);
166
+ },
167
+ onSelect: (e) => {
168
+ if (suggestion && e.target.selectionStart !== cursorAtFetch) {
169
+ setSuggestion("");
170
+ setCursorAtFetch(-1);
171
+ }
172
+ props.onSelect?.(e);
96
173
  }
97
174
  }
98
175
  )
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteTextArea.mjs","sources":["../../../src/components/TextArea/AutocompleteTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { type FC, useState, useEffect } from 'react';\nimport { useAutocomplete } from '../../hooks';\nimport {\n type AutoSizedTextAreaProps,\n AutoSizedTextArea,\n} from './AutoSizeTextArea';\n\nexport const useDebounce = <T,>(value: T, delay: number): T => {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n // Cleanup the timer if value changes before 'delay' ms\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n};\n\nexport type AutocompleteTextAreaProps = AutoSizedTextAreaProps & {\n isActive?: boolean;\n suggestion?: string;\n};\n\nexport const AutoCompleteTextarea: FC<AutocompleteTextAreaProps> = ({\n isActive = true,\n suggestion: suggestionProp,\n ...props\n}) => {\n const defaultValue = String(props.value ?? props.defaultValue ?? '');\n const { autocomplete } = useAutocomplete();\n const configuration = useConfiguration();\n const [isTyped, setIsTyped] = useState(false);\n const [text, setText] = useState(defaultValue);\n const [suggestion, setSuggestion] = useState('');\n\n // Only update this “debouncedText” after the user stops typing for 500ms\n const debouncedText = useDebounce(text, 200);\n\n useEffect(() => {\n if (typeof props.value === 'undefined') return;\n setText(defaultValue);\n }, [props.value, props.defaultValue]);\n\n useEffect(() => {\n if (!isActive) return;\n if (!isTyped) return;\n\n const fetchSuggestion = async () => {\n try {\n const response = await autocomplete({\n text: debouncedText,\n openAiApiKey: configuration.editor.openAiApiKey,\n model: configuration.editor.openAiApiModel,\n temperature: configuration.editor.openAiApiTemperature,\n });\n // e.g. response.data.autocompletion = \"Hello World\"\n const autocompletion = response?.data?.autocompletion ?? '';\n\n // If the suggested text starts with what the user typed,\n // we only store the *remaining* part as the suggestion\n // so that we can render \"ghost\" text appropriately.\n if (autocompletion.startsWith(debouncedText)) {\n const remaining = autocompletion.slice(debouncedText.length);\n return setSuggestion(remaining);\n }\n\n return setSuggestion(autocompletion);\n } catch (err) {\n console.error('Autocomplete error:', err);\n }\n };\n\n if (debouncedText.length > 3) {\n // Only fetch if user typed more than 3 chars and has paused\n setSuggestion('');\n fetchSuggestion();\n } else {\n // If typed less than threshold, clear the suggestion\n setSuggestion('');\n }\n }, [debouncedText, isActive]);\n\n const acceptSuggestion = () => {\n // Merge the typed text with the suggestion\n setText((prevText) => prevText + suggestion);\n setSuggestion('');\n };\n\n return (\n <div className=\"relative w-full\">\n {/*\n --- Background/Ghost layer ---\n Mirrors user's typed text and shows suggestion as ghosted/gray\n */}\n <div\n className=\"pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]\"\n aria-hidden=\"true\"\n >\n <span className=\"align-text-top text-transparent\">{text}</span>\n {(suggestion || suggestionProp) && (\n <span className=\"text-neutral ml-3 align-text-top\">\n {suggestionProp ?? suggestion}\n </span>\n )}\n </div>\n {/*\n --- Actual editable textarea ---\n Must share the same styling (font size, line-height, etc.) so\n text lines up exactly underneath the background layer.\n */}\n <AutoSizedTextArea\n {...props}\n value={text}\n onChange={(e) => {\n setIsTyped(true);\n setText(e.target.value);\n props.onChange?.(e);\n }}\n onKeyDown={(e) => {\n // If user presses Tab and we have a suggestion, accept it\n if (e.key === 'Tab' && suggestion) {\n e.preventDefault();\n acceptSuggestion();\n }\n props.onKeyDown?.(e);\n }}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAUa,MAAA,cAAc,CAAK,OAAU,UAAqB;AAC7D,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAY,KAAK;AAE7D,YAAU,MAAM;AACR,UAAA,QAAQ,WAAW,MAAM;AAC7B,wBAAkB,KAAK;AAAA,OACtB,KAAK;AAGD,WAAA,MAAM,aAAa,KAAK;AAAA,EAAA,GAC9B,CAAC,OAAO,KAAK,CAAC;AAEV,SAAA;AACT;AAOO,MAAM,uBAAsD,CAAC;AAAA,EAClE,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,OAAO,MAAM,SAAS,MAAM,gBAAgB,EAAE;AAC7D,QAAA,EAAE,aAAa,IAAI,gBAAgB;AACzC,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,YAAY;AAC7C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,EAAE;AAGzC,QAAA,gBAAgB,YAAY,MAAM,GAAG;AAE3C,YAAU,MAAM;AACV,QAAA,OAAO,MAAM,UAAU,YAAa;AACxC,YAAQ,YAAY;AAAA,KACnB,CAAC,MAAM,OAAO,MAAM,YAAY,CAAC;AAEpC,YAAU,MAAM;AACd,QAAI,CAAC,SAAU;AACf,QAAI,CAAC,QAAS;AAEd,UAAM,kBAAkB,YAAY;AAC9B,UAAA;AACI,cAAA,WAAW,MAAM,aAAa;AAAA,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;AAEnB,gBAAM,YAAY,CAAC;AAAA,QAAA;AAAA,MACrB;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"AutocompleteTextArea.mjs","sources":["../../../src/components/TextArea/AutocompleteTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport { type FC, useEffect, useRef, useState } from 'react';\nimport { useAutocomplete } from '../../hooks';\nimport {\n type AutoSizedTextAreaProps,\n AutoSizedTextArea,\n} from './AutoSizeTextArea';\n\nexport const useDebounce = <T,>(value: T, delay: number): T => {\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n // Cleanup the timer if value changes before 'delay' ms\n return () => clearTimeout(timer);\n }, [value, delay]);\n\n return debouncedValue;\n};\n\nexport type AutocompleteTextAreaProps = AutoSizedTextAreaProps & {\n isActive?: boolean;\n suggestion?: string;\n};\n\nexport const AutoCompleteTextarea: FC<AutocompleteTextAreaProps> = ({\n isActive = true,\n suggestion: suggestionProp,\n ...props\n}) => {\n const defaultValue = String(props.value ?? props.defaultValue ?? '');\n const { autocomplete } = useAutocomplete();\n const configuration = useConfiguration();\n const [isTyped, setIsTyped] = useState(false);\n const [text, setText] = useState(defaultValue);\n const [suggestion, setSuggestion] = useState('');\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const placeholderRef = useRef<HTMLSpanElement>(null);\n const ghostLayerRef = useRef<HTMLDivElement>(null);\n const [suggestionPosition, setSuggestionPosition] = useState<{\n left: number;\n top: number;\n } | null>(null);\n const [cursorAtFetch, setCursorAtFetch] = useState(-1);\n\n // Only update this “debouncedText” after the user stops typing for 200ms\n const debouncedText = useDebounce(text, 200);\n\n useEffect(() => {\n if (typeof props.value === 'undefined') return;\n setText(defaultValue);\n }, [props.value, props.defaultValue]);\n\n useEffect(() => {\n if (!isActive) return;\n if (!isTyped) return;\n\n const fetchSuggestion = async () => {\n try {\n const cursor =\n textareaRef.current?.selectionStart ?? debouncedText.length;\n const before = debouncedText.slice(0, cursor);\n const after = debouncedText.slice(cursor);\n const numLines = 5;\n const beforeLines = before.split('\\n');\n const contextBeforeLines = beforeLines.slice(\n Math.max(0, beforeLines.length - numLines - 1),\n -1\n );\n const contextBefore = contextBeforeLines.join('\\n');\n const currentLine = beforeLines[beforeLines.length - 1] ?? '';\n const afterLines = after.split('\\n');\n const contextAfter = afterLines.slice(1, numLines + 1).join('\\n');\n\n const response = await autocomplete({\n text: before,\n contextBefore,\n currentLine,\n contextAfter,\n aiOptions: {\n apiKey: configuration.editor.openAiApiKey,\n model: configuration.editor.openAiApiModel,\n temperature: configuration.editor.openAiApiTemperature,\n },\n });\n const autocompletion = response?.data?.autocompletion ?? '';\n\n setSuggestion(autocompletion);\n setCursorAtFetch(cursor);\n } catch (err) {\n console.error('Autocomplete error:', err);\n }\n };\n\n if (debouncedText.length > 3) {\n // Only fetch if user typed more than 3 chars and has paused\n setSuggestion('');\n fetchSuggestion();\n } else {\n // If typed less than threshold, clear the suggestion\n setSuggestion('');\n }\n }, [debouncedText, isActive, autocomplete, configuration]);\n\n useEffect(() => {\n if (\n !suggestion ||\n cursorAtFetch === -1 ||\n !placeholderRef.current ||\n !ghostLayerRef.current\n ) {\n setSuggestionPosition(null);\n return;\n }\n\n const rect = placeholderRef.current.getBoundingClientRect();\n const parentRect = ghostLayerRef.current.getBoundingClientRect();\n setSuggestionPosition({\n left: rect.left - parentRect.left,\n top: rect.top - parentRect.top,\n });\n }, [suggestion, cursorAtFetch, text]);\n\n const acceptSuggestion = () => {\n const currentCursor = textareaRef.current?.selectionStart ?? cursorAtFetch;\n if (currentCursor !== cursorAtFetch) return;\n const newText =\n text.slice(0, currentCursor) + suggestion + text.slice(currentCursor);\n setText(newText);\n setSuggestion('');\n setCursorAtFetch(-1);\n setTimeout(() => {\n textareaRef.current?.focus();\n const newCursorPos = currentCursor + suggestion.length;\n textareaRef.current?.setSelectionRange(newCursorPos, newCursorPos);\n }, 0);\n };\n\n return (\n <div className=\"relative w-full\">\n <div\n ref={ghostLayerRef}\n className=\"pointer-events-none absolute inset-0 whitespace-pre-wrap break-words px-1 py-3 text-base leading-[1.45rem] md:py-1 md:text-sm md:leading-[1.23rem]\"\n aria-hidden=\"true\"\n >\n {suggestion && cursorAtFetch !== -1 ? (\n <>\n <span className=\"align-text-top text-transparent\">\n {text.slice(0, cursorAtFetch)}\n </span>\n <span\n ref={placeholderRef}\n style={{ visibility: 'hidden' }}\n aria-hidden=\"true\"\n >\n {suggestion}\n </span>\n <span className=\"align-text-top text-transparent\">\n {text.slice(cursorAtFetch)}\n </span>\n </>\n ) : (\n <span className=\"align-text-top text-transparent\">{text}</span>\n )}\n {suggestionProp && (\n <span className=\"text-neutral align-text-top\">{suggestionProp}</span>\n )}\n </div>\n {suggestion && suggestionPosition && (\n <div\n className=\"pointer-events-none text-neutral whitespace-pre-wrap break-words text-base leading-[1.45rem] md:text-sm md:leading-[1.23rem]\"\n style={{\n position: 'absolute',\n left: suggestionPosition.left,\n top: suggestionPosition.top,\n }}\n >\n {suggestion}\n </div>\n )}\n <AutoSizedTextArea\n {...props}\n ref={textareaRef}\n value={text}\n onChange={(e) => {\n setIsTyped(true);\n setText(e.target.value);\n setSuggestion('');\n props.onChange?.(e);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Tab' && suggestion) {\n e.preventDefault();\n acceptSuggestion();\n }\n props.onKeyDown?.(e);\n }}\n onSelect={(e) => {\n if (\n suggestion &&\n (e.target as HTMLTextAreaElement).selectionStart !== cursorAtFetch\n ) {\n setSuggestion('');\n setCursorAtFetch(-1);\n }\n props.onSelect?.(e);\n }}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAUa,MAAA,cAAc,CAAK,OAAU,UAAqB;AAC7D,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAY,KAAK;AAE7D,YAAU,MAAM;AACR,UAAA,QAAQ,WAAW,MAAM;A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