@copilotkit/react-textarea 1.3.7 → 1.3.8

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 (38) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{chunk-2WEVAO3P.mjs → chunk-2FAXLWPD.mjs} +3 -3
  3. package/dist/{chunk-XBU5TSXH.mjs → chunk-BG4GF6PP.mjs} +4 -4
  4. package/dist/chunk-BG4GF6PP.mjs.map +1 -0
  5. package/dist/{chunk-SDHH6DI6.mjs → chunk-GUZIMGGZ.mjs} +2 -1
  6. package/dist/chunk-GUZIMGGZ.mjs.map +1 -0
  7. package/dist/{chunk-HL7EF7KA.mjs → chunk-ZTYA6QOT.mjs} +2 -2
  8. package/dist/components/copilot-textarea/copilot-textarea.js +4 -3
  9. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  10. package/dist/components/copilot-textarea/copilot-textarea.mjs +4 -4
  11. package/dist/components/index.js +4 -3
  12. package/dist/components/index.js.map +1 -1
  13. package/dist/components/index.mjs +4 -4
  14. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +3 -3
  15. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -1
  16. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +1 -1
  17. package/dist/index.js +4 -3
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +4 -4
  20. package/dist/types/autosuggestions-config/autosuggestions-config.js +1 -0
  21. package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
  22. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +2 -2
  23. package/dist/types/autosuggestions-config/index.js +1 -0
  24. package/dist/types/autosuggestions-config/index.js.map +1 -1
  25. package/dist/types/autosuggestions-config/index.mjs +2 -2
  26. package/dist/types/autosuggestions-config/suggestions-api-config.js +1 -0
  27. package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -1
  28. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +1 -1
  29. package/dist/types/index.js +1 -0
  30. package/dist/types/index.js.map +1 -1
  31. package/dist/types/index.mjs +2 -2
  32. package/package.json +7 -7
  33. package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +8 -5
  34. package/src/types/autosuggestions-config/suggestions-api-config.tsx +1 -0
  35. package/dist/chunk-SDHH6DI6.mjs.map +0 -1
  36. package/dist/chunk-XBU5TSXH.mjs.map +0 -1
  37. /package/dist/{chunk-2WEVAO3P.mjs.map → chunk-2FAXLWPD.mjs.map} +0 -0
  38. /package/dist/{chunk-HL7EF7KA.mjs.map → chunk-ZTYA6QOT.mjs.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  CopilotTextarea
3
- } from "../../chunk-2WEVAO3P.mjs";
3
+ } from "../../chunk-2FAXLWPD.mjs";
4
4
  import "../../chunk-VPGMB7K3.mjs";
5
- import "../../chunk-XBU5TSXH.mjs";
5
+ import "../../chunk-BG4GF6PP.mjs";
6
6
  import "../../chunk-RUV6NBIF.mjs";
7
- import "../../chunk-HL7EF7KA.mjs";
7
+ import "../../chunk-ZTYA6QOT.mjs";
8
8
  import "../../chunk-EJGGLWWR.mjs";
9
9
  import "../../chunk-MCNXIA4Q.mjs";
10
- import "../../chunk-SDHH6DI6.mjs";
10
+ import "../../chunk-GUZIMGGZ.mjs";
11
11
  import "../../chunk-J62KUPFZ.mjs";
12
12
  import "../../chunk-2C7O2EVM.mjs";
13
13
  import "../../chunk-GQN2HYFJ.mjs";
@@ -1828,10 +1828,10 @@ function useMakeStandardAutosuggestionFunction(textareaPurpose, contextCategorie
1828
1828
  )
1829
1829
  }),
1830
1830
  ...apiConfig.fewShotMessages,
1831
- new import_runtime_client_gql.TextMessage({
1831
+ editorState2.textAfterCursor != "" ? new import_runtime_client_gql.TextMessage({
1832
1832
  role: import_runtime_client_gql.Role.User,
1833
1833
  content: editorState2.textAfterCursor
1834
- }),
1834
+ }) : null,
1835
1835
  new import_runtime_client_gql.TextMessage({
1836
1836
  role: import_runtime_client_gql.Role.User,
1837
1837
  content: `<TextAfterCursor>${editorState2.textAfterCursor}</TextAfterCursor>`
@@ -1840,7 +1840,7 @@ function useMakeStandardAutosuggestionFunction(textareaPurpose, contextCategorie
1840
1840
  role: import_runtime_client_gql.Role.User,
1841
1841
  content: `<TextBeforeCursor>${editorState2.textBeforeCursor}</TextBeforeCursor>`
1842
1842
  })
1843
- ];
1843
+ ].filter(Boolean);
1844
1844
  const runtimeClient = new import_runtime_client_gql.CopilotRuntimeClient({
1845
1845
  url,
1846
1846
  publicApiKey,
@@ -1903,6 +1903,7 @@ The user will provide both the text before and after the cursor. You should use
1903
1903
  <YourSuggestion>
1904
1904
 
1905
1905
  If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
1906
+ Refrain from adding <YourSuggestion> tags when responding
1906
1907
 
1907
1908
  The following external context is also provided. Use it to help you make better suggestions!!!
1908
1909
  \`\`\`