@copilotkit/react-textarea 1.10.7-next.0 → 1.50.0-beta.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 (95) hide show
  1. package/CHANGELOG.md +0 -8
  2. package/dist/{chunk-HDBI2WN5.mjs → chunk-2IWVZ4PP.mjs} +17 -27
  3. package/dist/chunk-2IWVZ4PP.mjs.map +1 -0
  4. package/dist/{chunk-XW3ICO4S.mjs → chunk-3QJOFG3V.mjs} +1 -1
  5. package/dist/chunk-3QJOFG3V.mjs.map +1 -0
  6. package/dist/{chunk-HBWBHJ64.mjs → chunk-4VCJHANC.mjs} +9 -9
  7. package/dist/{chunk-7WVURIB7.mjs → chunk-5NZNJCP2.mjs} +21 -21
  8. package/dist/{chunk-2DF2AVDU.mjs → chunk-66KFI242.mjs} +2 -2
  9. package/dist/{chunk-C3PMJNQA.mjs → chunk-7VADGLV2.mjs} +6 -6
  10. package/dist/{chunk-RXV67GJN.mjs → chunk-DL3JWL2E.mjs} +4 -2
  11. package/dist/chunk-DL3JWL2E.mjs.map +1 -0
  12. package/dist/{chunk-7L6GIHDM.mjs → chunk-F2ULK22F.mjs} +1 -1
  13. package/dist/chunk-F2ULK22F.mjs.map +1 -0
  14. package/dist/{chunk-6SGWO63I.mjs → chunk-ISKK3RIW.mjs} +4 -4
  15. package/dist/chunk-JD7BAH7U.mjs +1 -0
  16. package/dist/{chunk-LQ2OWQU7.mjs → chunk-JLOABKLH.mjs} +2 -2
  17. package/dist/{chunk-LQ2OWQU7.mjs.map → chunk-JLOABKLH.mjs.map} +1 -1
  18. package/dist/{chunk-3PQ7GSFE.mjs → chunk-NAFNY4FL.mjs} +1 -1
  19. package/dist/chunk-NAFNY4FL.mjs.map +1 -0
  20. package/dist/{chunk-F6GMWOLE.mjs → chunk-ZQSEYPNN.mjs} +6 -25
  21. package/dist/chunk-ZQSEYPNN.mjs.map +1 -0
  22. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +17 -27
  23. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  24. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +21 -21
  25. package/dist/components/base-copilot-textarea/render-element.d.ts +3 -2
  26. package/dist/components/base-copilot-textarea/render-element.js.map +1 -1
  27. package/dist/components/base-copilot-textarea/render-element.mjs +1 -1
  28. package/dist/components/base-copilot-textarea/render-placeholder.d.ts +3 -2
  29. package/dist/components/base-copilot-textarea/render-placeholder.js.map +1 -1
  30. package/dist/components/base-copilot-textarea/render-placeholder.mjs +1 -1
  31. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +1 -1
  32. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +1 -1
  33. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +1 -1
  34. package/dist/components/copilot-textarea/copilot-textarea.js +24 -48
  35. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  36. package/dist/components/copilot-textarea/copilot-textarea.mjs +75 -28
  37. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
  38. package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +1 -1
  39. package/dist/components/hovering-toolbar/hovering-toolbar-components.js +16 -26
  40. package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -1
  41. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +1 -1
  42. package/dist/components/hovering-toolbar/hovering-toolbar.js +16 -26
  43. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  44. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +8 -8
  45. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  46. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +5 -5
  47. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  48. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +6 -6
  49. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  50. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +6 -6
  51. package/dist/components/index.d.ts +2 -11
  52. package/dist/components/index.js +25 -531
  53. package/dist/components/index.js.map +1 -1
  54. package/dist/components/index.mjs +23 -35
  55. package/dist/components/ui/command.d.ts +1 -1
  56. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +4 -20
  57. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -1
  58. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +1 -1
  59. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +3 -1
  60. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -1
  61. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +1 -1
  62. package/dist/hooks/misc/use-autosize-textarea.d.ts +1 -1
  63. package/dist/hooks/misc/use-autosize-textarea.js.map +1 -1
  64. package/dist/hooks/misc/use-autosize-textarea.mjs +1 -1
  65. package/dist/index.d.ts +0 -1
  66. package/dist/index.js +76 -368
  67. package/dist/index.js.map +1 -1
  68. package/dist/index.mjs +27 -34
  69. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +2 -2
  70. package/dist/types/autosuggestions-config/index.mjs +2 -2
  71. package/dist/types/index.mjs +3 -3
  72. package/package.json +22 -22
  73. package/src/components/base-copilot-textarea/render-element.tsx +2 -1
  74. package/src/components/base-copilot-textarea/render-placeholder.tsx +2 -1
  75. package/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx +1 -1
  76. package/src/components/hovering-toolbar/hovering-toolbar-components.tsx +28 -40
  77. package/src/components/index.ts +0 -3
  78. package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +24 -22
  79. package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +2 -1
  80. package/src/hooks/misc/use-autosize-textarea.tsx +1 -1
  81. package/dist/chunk-3PQ7GSFE.mjs.map +0 -1
  82. package/dist/chunk-7L6GIHDM.mjs.map +0 -1
  83. package/dist/chunk-F6GMWOLE.mjs.map +0 -1
  84. package/dist/chunk-HDBI2WN5.mjs.map +0 -1
  85. package/dist/chunk-MMVDU6DF.mjs +0 -1
  86. package/dist/chunk-NZIHZWRU.mjs +0 -60
  87. package/dist/chunk-NZIHZWRU.mjs.map +0 -1
  88. package/dist/chunk-RXV67GJN.mjs.map +0 -1
  89. package/dist/chunk-XW3ICO4S.mjs.map +0 -1
  90. /package/dist/{chunk-HBWBHJ64.mjs.map → chunk-4VCJHANC.mjs.map} +0 -0
  91. /package/dist/{chunk-7WVURIB7.mjs.map → chunk-5NZNJCP2.mjs.map} +0 -0
  92. /package/dist/{chunk-2DF2AVDU.mjs.map → chunk-66KFI242.mjs.map} +0 -0
  93. /package/dist/{chunk-C3PMJNQA.mjs.map → chunk-7VADGLV2.mjs.map} +0 -0
  94. /package/dist/{chunk-6SGWO63I.mjs.map → chunk-ISKK3RIW.mjs.map} +0 -0
  95. /package/dist/{chunk-MMVDU6DF.mjs.map → chunk-JD7BAH7U.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,63 +1,56 @@
1
1
  "use client";
2
2
  import "./chunk-DE5K76I2.mjs";
3
- import "./chunk-WADHCMPK.mjs";
4
- import "./chunk-IU3WTXLQ.mjs";
5
- import "./chunk-MMVDU6DF.mjs";
6
- import {
7
- CopilotTextarea
8
- } from "./chunk-NZIHZWRU.mjs";
9
- import "./chunk-F6GMWOLE.mjs";
10
- import "./chunk-RXV67GJN.mjs";
11
3
  import "./chunk-RUV6NBIF.mjs";
12
4
  import {
13
5
  defaultAutosuggestionsConfig
14
- } from "./chunk-6SGWO63I.mjs";
15
- import "./chunk-MCNXIA4Q.mjs";
6
+ } from "./chunk-ISKK3RIW.mjs";
16
7
  import "./chunk-QFXR6DOA.mjs";
17
8
  import "./chunk-EJGGLWWR.mjs";
9
+ import "./chunk-MCNXIA4Q.mjs";
10
+ import "./chunk-WADHCMPK.mjs";
11
+ import "./chunk-H4VKQGVU.mjs";
12
+ import "./chunk-IU3WTXLQ.mjs";
13
+ import "./chunk-JD7BAH7U.mjs";
18
14
  import {
19
15
  BaseCopilotTextarea
20
- } from "./chunk-7WVURIB7.mjs";
21
- import "./chunk-2C7O2EVM.mjs";
16
+ } from "./chunk-5NZNJCP2.mjs";
22
17
  import "./chunk-GQN2HYFJ.mjs";
23
- import "./chunk-23Q6A46J.mjs";
24
- import "./chunk-AJ5OMEXM.mjs";
25
- import "./chunk-DRV2FOHZ.mjs";
26
- import "./chunk-4NHVQZ67.mjs";
27
- import "./chunk-QJNFNPWH.mjs";
28
- import "./chunk-5UNJXFUO.mjs";
29
- import "./chunk-7LSRNPNI.mjs";
30
- import "./chunk-C3PMJNQA.mjs";
18
+ import "./chunk-7VADGLV2.mjs";
31
19
  import "./chunk-L7VVZH4Q.mjs";
32
- import "./chunk-2DF2AVDU.mjs";
33
- import "./chunk-HBWBHJ64.mjs";
20
+ import "./chunk-66KFI242.mjs";
21
+ import "./chunk-4VCJHANC.mjs";
34
22
  import "./chunk-KMVGEY7Q.mjs";
35
- import "./chunk-3PQ7GSFE.mjs";
36
- import "./chunk-D47EKHIF.mjs";
37
- import "./chunk-LYB4B6MK.mjs";
38
- import "./chunk-HDBI2WN5.mjs";
23
+ import "./chunk-2IWVZ4PP.mjs";
39
24
  import "./chunk-WGWQRALG.mjs";
25
+ import "./chunk-4PDYALMP.mjs";
40
26
  import "./chunk-VSVQZUPW.mjs";
41
27
  import "./chunk-I72DKFHD.mjs";
42
- import "./chunk-4PDYALMP.mjs";
28
+ import "./chunk-D47EKHIF.mjs";
29
+ import "./chunk-2C7O2EVM.mjs";
30
+ import "./chunk-NAFNY4FL.mjs";
31
+ import "./chunk-F2ULK22F.mjs";
32
+ import "./chunk-3QJOFG3V.mjs";
33
+ import "./chunk-JLOABKLH.mjs";
34
+ import "./chunk-7LSRNPNI.mjs";
35
+ import "./chunk-LYB4B6MK.mjs";
43
36
  import "./chunk-2QDCE7PD.mjs";
44
- import "./chunk-YLFAIYRY.mjs";
45
37
  import "./chunk-WJHSY5T6.mjs";
46
38
  import {
47
39
  defaultBaseAutosuggestionsConfig
48
40
  } from "./chunk-F6RLSVG3.mjs";
49
- import "./chunk-7L6GIHDM.mjs";
50
- import "./chunk-XW3ICO4S.mjs";
51
- import "./chunk-LQ2OWQU7.mjs";
52
- import "./chunk-H4VKQGVU.mjs";
41
+ import "./chunk-23Q6A46J.mjs";
42
+ import "./chunk-AJ5OMEXM.mjs";
43
+ import "./chunk-YLFAIYRY.mjs";
44
+ import "./chunk-DRV2FOHZ.mjs";
45
+ import "./chunk-4NHVQZ67.mjs";
46
+ import "./chunk-QJNFNPWH.mjs";
47
+ import "./chunk-5UNJXFUO.mjs";
53
48
  import "./chunk-DFTV4TST.mjs";
54
49
  import "./chunk-T6MTDQZ7.mjs";
55
50
  import "./chunk-ECR45NSD.mjs";
56
- import "./chunk-KNQIEOFP.mjs";
57
51
  import "./chunk-MRXNTQOX.mjs";
58
52
  export {
59
53
  BaseCopilotTextarea,
60
- CopilotTextarea,
61
54
  defaultAutosuggestionsConfig,
62
55
  defaultBaseAutosuggestionsConfig
63
56
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  defaultAutosuggestionsConfig
3
- } from "../../chunk-6SGWO63I.mjs";
4
- import "../../chunk-MCNXIA4Q.mjs";
3
+ } from "../../chunk-ISKK3RIW.mjs";
5
4
  import "../../chunk-QFXR6DOA.mjs";
6
5
  import "../../chunk-EJGGLWWR.mjs";
6
+ import "../../chunk-MCNXIA4Q.mjs";
7
7
  import "../../chunk-WJHSY5T6.mjs";
8
8
  import "../../chunk-F6RLSVG3.mjs";
9
9
  import "../../chunk-MRXNTQOX.mjs";
@@ -1,10 +1,10 @@
1
1
  import "../../chunk-RUV6NBIF.mjs";
2
2
  import {
3
3
  defaultAutosuggestionsConfig
4
- } from "../../chunk-6SGWO63I.mjs";
5
- import "../../chunk-MCNXIA4Q.mjs";
4
+ } from "../../chunk-ISKK3RIW.mjs";
6
5
  import "../../chunk-QFXR6DOA.mjs";
7
6
  import "../../chunk-EJGGLWWR.mjs";
7
+ import "../../chunk-MCNXIA4Q.mjs";
8
8
  import "../../chunk-WJHSY5T6.mjs";
9
9
  import "../../chunk-F6RLSVG3.mjs";
10
10
  import "../../chunk-MRXNTQOX.mjs";
@@ -1,12 +1,12 @@
1
1
  import "../chunk-DE5K76I2.mjs";
2
- import "../chunk-WADHCMPK.mjs";
3
2
  import "../chunk-RUV6NBIF.mjs";
4
3
  import {
5
4
  defaultAutosuggestionsConfig
6
- } from "../chunk-6SGWO63I.mjs";
7
- import "../chunk-MCNXIA4Q.mjs";
5
+ } from "../chunk-ISKK3RIW.mjs";
8
6
  import "../chunk-QFXR6DOA.mjs";
9
7
  import "../chunk-EJGGLWWR.mjs";
8
+ import "../chunk-MCNXIA4Q.mjs";
9
+ import "../chunk-WADHCMPK.mjs";
10
10
  import "../chunk-WJHSY5T6.mjs";
11
11
  import {
12
12
  defaultBaseAutosuggestionsConfig
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.10.7-next.0",
12
+ "version": "1.50.0-beta.0",
13
13
  "sideEffects": [
14
14
  "**/*.css"
15
15
  ],
@@ -25,6 +25,15 @@
25
25
  },
26
26
  "types": "./dist/index.d.ts",
27
27
  "license": "MIT",
28
+ "scripts": {
29
+ "build": "tsup --clean",
30
+ "dev": "tsup --watch --no-splitting",
31
+ "test": "jest",
32
+ "check-types": "tsc --noEmit",
33
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf .next",
34
+ "link:global": "pnpm link --global",
35
+ "unlink:global": "pnpm unlink --global"
36
+ },
28
37
  "peerDependencies": {
29
38
  "react": "^18 || ^19 || ^19.0.0-rc",
30
39
  "react-dom": "^18 || ^19 || ^19.0.0-rc"
@@ -32,24 +41,27 @@
32
41
  "devDependencies": {
33
42
  "@types/jest": "^29.5.4",
34
43
  "@types/lodash.merge": "^4.6.7",
35
- "@types/react": "^18.2.5",
36
- "@types/react-dom": "^18.2.4",
44
+ "@types/react": "^19.1.0",
45
+ "@types/react-dom": "^19.0.2",
37
46
  "@types/react-syntax-highlighter": "^15.5.7",
38
47
  "eslint": "^8.56.0",
48
+ "eslint-config-custom": "workspace:*",
39
49
  "jest": "^29.6.4",
40
50
  "postcss": "^8.4.20",
41
51
  "postcss-prefix-selector": "^1.16.1",
42
52
  "react": "^18.2.0",
43
53
  "react-dom": "^18.2.0",
54
+ "tailwind-config": "workspace:*",
44
55
  "tailwindcss": "^3.3.0",
45
56
  "ts-jest": "^29.1.1",
57
+ "tsconfig": "workspace:*",
46
58
  "tsup": "^6.7.0",
47
- "typescript": "^5.2.3",
48
- "eslint-config-custom": "1.4.6",
49
- "tailwind-config": "1.4.6",
50
- "tsconfig": "1.4.6"
59
+ "typescript": "^5.2.3"
51
60
  },
52
61
  "dependencies": {
62
+ "@copilotkit/react-core": "workspace:*",
63
+ "@copilotkit/runtime-client-gql": "workspace:*",
64
+ "@copilotkit/shared": "workspace:*",
53
65
  "@emotion/css": "^11.11.2",
54
66
  "@emotion/react": "^11.11.1",
55
67
  "@emotion/styled": "^11.11.0",
@@ -67,10 +79,7 @@
67
79
  "slate": "^0.94.1",
68
80
  "slate-history": "^0.93.0",
69
81
  "slate-react": "^0.98.1",
70
- "tailwind-merge": "^1.13.2",
71
- "@copilotkit/react-core": "1.10.7-next.0",
72
- "@copilotkit/runtime-client-gql": "1.10.7-next.0",
73
- "@copilotkit/shared": "1.10.7-next.0"
82
+ "tailwind-merge": "^1.13.2"
74
83
  },
75
84
  "keywords": [
76
85
  "copilotkit",
@@ -83,14 +92,5 @@
83
92
  "javascript",
84
93
  "automation",
85
94
  "textarea"
86
- ],
87
- "scripts": {
88
- "build": "tsup --clean",
89
- "dev": "tsup --watch --no-splitting",
90
- "test": "jest",
91
- "check-types": "tsc --noEmit",
92
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf .next",
93
- "link:global": "pnpm link --global",
94
- "unlink:global": "pnpm unlink --global"
95
- }
96
- }
95
+ ]
96
+ }
@@ -1,6 +1,7 @@
1
1
  import { RenderElementProps } from "slate-react";
2
+ import React from "react";
2
3
 
3
- export type RenderElementFunction = (props: RenderElementProps) => JSX.Element;
4
+ export type RenderElementFunction = (props: RenderElementProps) => React.JSX.Element;
4
5
 
5
6
  export function makeRenderElementFunction(
6
7
  suggestionsStyle: React.CSSProperties,
@@ -1,6 +1,7 @@
1
1
  import { RenderPlaceholderProps } from "slate-react";
2
+ import React from "react";
2
3
 
3
- export type RenderPlaceholderFunction = (props: RenderPlaceholderProps) => JSX.Element;
4
+ export type RenderPlaceholderFunction = (props: RenderPlaceholderProps) => React.JSX.Element;
4
5
 
5
6
  export function makeRenderPlaceholderFunction(
6
7
  placeholderStyle?: React.CSSProperties,
@@ -70,7 +70,7 @@ const isSelectionEqual = (a: BaseSelection, b: BaseSelection) => {
70
70
  * ```
71
71
  */
72
72
  function usePrevious<T>(value: T): T | undefined {
73
- const ref = useRef<T>();
73
+ const ref = useRef<T>(undefined!);
74
74
 
75
75
  useEffect(() => {
76
76
  ref.current = value;
@@ -3,47 +3,35 @@ import React, { PropsWithChildren, Ref } from "react";
3
3
  import ReactDOM from "react-dom";
4
4
 
5
5
  interface BaseProps {
6
- className: string;
6
+ className?: string;
7
7
  [key: string]: unknown;
8
8
  }
9
9
 
10
- export const Button = React.forwardRef(
11
- (
12
- {
13
- className,
14
- active,
15
- reversed,
16
- ...props
17
- }: PropsWithChildren<
18
- {
19
- active: boolean;
20
- reversed: boolean;
21
- } & BaseProps
22
- >,
23
- ref: Ref<HTMLSpanElement | null>,
24
- ) => (
25
- <span
26
- {...props}
27
- ref={ref as Ref<HTMLSpanElement>}
28
- className={cx(
29
- className,
30
- css`
31
- cursor: pointer;
32
- color: ${reversed ? (active ? "white" : "#aaa") : active ? "black" : "#ccc"};
33
- `,
34
- )}
35
- />
36
- ),
37
- );
10
+ export const Button = React.forwardRef<
11
+ HTMLSpanElement,
12
+ PropsWithChildren<{ active: boolean; reversed: boolean } & BaseProps>
13
+ >(({ className, active, reversed, ...props }, ref) => (
14
+ <span
15
+ {...props}
16
+ ref={ref}
17
+ className={cx(
18
+ className as string,
19
+ css`
20
+ cursor: pointer;
21
+ color: ${reversed ? (active ? "white" : "#aaa") : active ? "black" : "#ccc"};
22
+ `,
23
+ )}
24
+ />
25
+ ));
38
26
 
39
- export const Icon = React.forwardRef(
40
- ({ className, ...props }: PropsWithChildren<BaseProps>, ref: Ref<HTMLSpanElement | null>) => (
27
+ export const Icon = React.forwardRef<HTMLSpanElement, PropsWithChildren<BaseProps>>(
28
+ ({ className, ...props }, ref) => (
41
29
  <span
42
30
  {...props}
43
- ref={ref as Ref<HTMLSpanElement>}
31
+ ref={ref}
44
32
  className={cx(
45
33
  "material-icons",
46
- className,
34
+ className as string,
47
35
  css`
48
36
  font-size: 18px;
49
37
  vertical-align: text-bottom;
@@ -53,15 +41,15 @@ export const Icon = React.forwardRef(
53
41
  ),
54
42
  );
55
43
 
56
- export const Menu = React.forwardRef(
57
- ({ className, ...props }: PropsWithChildren<BaseProps>, ref: Ref<HTMLDivElement | null>) => {
44
+ export const Menu = React.forwardRef<HTMLDivElement, PropsWithChildren<BaseProps>>(
45
+ ({ className, ...props }, ref) => {
58
46
  return (
59
47
  <div
60
48
  {...props}
61
49
  data-testid="menu"
62
- ref={ref as Ref<HTMLDivElement>}
50
+ ref={ref}
63
51
  className={cx(
64
- className,
52
+ className as string,
65
53
  css`
66
54
  & > * {
67
55
  display: inline-block;
@@ -80,13 +68,13 @@ export const Portal = ({ children }: { children: React.ReactNode }) => {
80
68
  return typeof document === "object" ? ReactDOM.createPortal(children, document.body) : null;
81
69
  };
82
70
 
83
- export const Toolbar = React.forwardRef(
84
- ({ className, ...props }: PropsWithChildren<BaseProps>, ref?: Ref<HTMLDivElement>) => (
71
+ export const Toolbar = React.forwardRef<HTMLDivElement, PropsWithChildren<BaseProps>>(
72
+ ({ className, ...props }, ref) => (
85
73
  <Menu
86
74
  {...props}
87
75
  ref={ref}
88
76
  className={cx(
89
- className,
77
+ className as string,
90
78
  css`
91
79
  position: relative;
92
80
  padding: 1px 18px 17px;
@@ -1,4 +1 @@
1
1
  export { BaseCopilotTextarea } from "./base-copilot-textarea/base-copilot-textarea";
2
-
3
- export { CopilotTextarea } from "./copilot-textarea/copilot-textarea";
4
- export type { CopilotTextareaProps } from "./copilot-textarea/copilot-textarea";
@@ -33,7 +33,8 @@ export function useMakeStandardAutosuggestionFunction(
33
33
  contextCategories: string[],
34
34
  apiConfig: SuggestionsApiConfig,
35
35
  ): AutosuggestionsBareFunction {
36
- const { getContextString, copilotApiConfig, runtimeClient } = useCopilotContext();
36
+ const runtimeClient = { generateCopilotResponse: (...args: any[]) => {} };
37
+ const { getContextString, copilotApiConfig } = useCopilotContext();
37
38
  const { chatApiEndpoint: url, publicApiKey, credentials, properties } = copilotApiConfig;
38
39
  const headers = {
39
40
  ...copilotApiConfig.headers,
@@ -70,27 +71,28 @@ export function useMakeStandardAutosuggestionFunction(
70
71
  }),
71
72
  ].filter(Boolean);
72
73
 
73
- const response = await runtimeClient
74
- .generateCopilotResponse({
75
- data: {
76
- frontend: {
77
- actions: [],
78
- url: window.location.href,
79
- },
80
- messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),
81
- metadata: {
82
- requestType: CopilotRequestType.TextareaCompletion,
83
- },
84
- forwardedParameters: {
85
- maxTokens,
86
- stop,
87
- temperature,
88
- },
89
- },
90
- properties,
91
- signal: abortSignal,
92
- })
93
- .toPromise();
74
+ // const response = await runtimeClient
75
+ // .generateCopilotResponse({
76
+ // data: {
77
+ // frontend: {
78
+ // actions: [],
79
+ // url: window.location.href,
80
+ // },
81
+ // messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),
82
+ // metadata: {
83
+ // requestType: CopilotRequestType.TextareaCompletion,
84
+ // },
85
+ // forwardedParameters: {
86
+ // maxTokens,
87
+ // stop,
88
+ // temperature,
89
+ // },
90
+ // },
91
+ // properties,
92
+ // signal: abortSignal,
93
+ // })
94
+ // .toPromise();
95
+ const response: any = {};
94
96
 
95
97
  let result = "";
96
98
  for (const message of convertGqlOutputToMessages(
@@ -39,7 +39,8 @@ export function useMakeStandardInsertionOrEditingFunction(
39
39
  insertionApiConfig: InsertionsApiConfig,
40
40
  editingApiConfig: EditingApiConfig,
41
41
  ): Generator_InsertionOrEditingSuggestion {
42
- const { getContextString, copilotApiConfig, runtimeClient } = useCopilotContext();
42
+ const runtimeClient: any = { generateCopilotResponse: (...args: any[]) => {} };
43
+ const { getContextString, copilotApiConfig } = useCopilotContext();
43
44
  const headers = {
44
45
  ...(copilotApiConfig.publicApiKey
45
46
  ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey }
@@ -1,7 +1,7 @@
1
1
  import { Ref, RefObject, useEffect } from "react";
2
2
 
3
3
  // Updates the height of a <textarea> when the value changes.
4
- const useAutosizeTextArea = (textAreaRef: RefObject<HTMLTextAreaElement>, value: string) => {
4
+ const useAutosizeTextArea = (textAreaRef: RefObject<HTMLTextAreaElement | null>, value: string) => {
5
5
  useEffect(() => {
6
6
  if (textAreaRef.current !== null) {
7
7
  // We need to reset the height momentarily to get the correct scrollHeight for the textarea
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/misc/use-autosize-textarea.tsx"],"sourcesContent":["import { Ref, RefObject, useEffect } from \"react\";\n\n// Updates the height of a <textarea> when the value changes.\nconst useAutosizeTextArea = (textAreaRef: RefObject<HTMLTextAreaElement>, value: string) => {\n useEffect(() => {\n if (textAreaRef.current !== null) {\n // We need to reset the height momentarily to get the correct scrollHeight for the textarea\n textAreaRef.current.style.height = \"0px\";\n const scrollHeight = textAreaRef.current.scrollHeight;\n\n // We then set the height directly, outside of the render loop\n // Trying to set this with state or a ref will product an incorrect value.\n textAreaRef.current.style.height = scrollHeight + \"px\";\n }\n }, [textAreaRef, value]);\n};\n\nexport default useAutosizeTextArea;\n"],"mappings":";AAAA,SAAyB,iBAAiB;AAG1C,IAAM,sBAAsB,CAAC,aAA6C,UAAkB;AAC1F,YAAU,MAAM;AACd,QAAI,YAAY,YAAY,MAAM;AAEhC,kBAAY,QAAQ,MAAM,SAAS;AACnC,YAAM,eAAe,YAAY,QAAQ;AAIzC,kBAAY,QAAQ,MAAM,SAAS,eAAe;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,aAAa,KAAK,CAAC;AACzB;AAEA,IAAO,gCAAQ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/base-copilot-textarea/render-element.tsx"],"sourcesContent":["import { RenderElementProps } from \"slate-react\";\n\nexport type RenderElementFunction = (props: RenderElementProps) => JSX.Element;\n\nexport function makeRenderElementFunction(\n suggestionsStyle: React.CSSProperties,\n): RenderElementFunction {\n return (props: RenderElementProps) => {\n switch (props.element.type) {\n case \"paragraph\":\n return <DefaultElement {...props} />;\n case \"suggestion\":\n return <SuggestionElement {...props} suggestionsStyle={suggestionsStyle} />;\n }\n };\n}\n\nconst DefaultElement = (props: RenderElementProps) => {\n return <div {...props.attributes}>{props.children}</div>;\n};\nconst SuggestionElement = (\n props: RenderElementProps & {\n suggestionsStyle: React.CSSProperties;\n },\n) => {\n return (\n <span\n {...props.attributes}\n style={{\n ...props.suggestionsStyle,\n }}\n data-testid=\"suggestion\"\n contentEditable={false}\n >\n {props.children /* https://github.com/ianstormtaylor/slate/issues/3930 */}\n {props.element.type === \"suggestion\" && props.element.content}\n </span>\n );\n};\n"],"mappings":";;;;;;AAUe,cAgBX,YAhBW;AANR,SAAS,0BACd,kBACuB;AACvB,SAAO,CAAC,UAA8B;AACpC,YAAQ,MAAM,QAAQ,MAAM;AAAA,MAC1B,KAAK;AACH,eAAO,oBAAC,mCAAmB,MAAO;AAAA,MACpC,KAAK;AACH,eAAO,oBAAC,oDAAsB,QAAtB,EAA6B,mBAAoC;AAAA,IAC7E;AAAA,EACF;AACF;AAEA,IAAM,iBAAiB,CAAC,UAA8B;AACpD,SAAO,oBAAC,wCAAQ,MAAM,aAAd,EAA2B,gBAAM,WAAS;AACpD;AACA,IAAM,oBAAoB,CACxB,UAGG;AACH,SACE;AAAA,IAAC;AAAA,qCACK,MAAM,aADX;AAAA,MAEC,OAAO,mBACF,MAAM;AAAA,MAEX,eAAY;AAAA,MACZ,iBAAiB;AAAA,MAEhB;AAAA,cAAM;AAAA,QACN,MAAM,QAAQ,SAAS,gBAAgB,MAAM,QAAQ;AAAA;AAAA;AAAA,EACxD;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx"],"sourcesContent":["import { COPILOT_CLOUD_PUBLIC_API_KEY_HEADER } from \"@copilotkit/shared\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport { useCallback } from \"react\";\nimport { AutosuggestionsBareFunction } from \"../../types\";\nimport { retry } from \"../../lib/retry\";\nimport { InsertionEditorState } from \"../../types/base/autosuggestions-bare-function\";\nimport { SuggestionsApiConfig } from \"../../types/autosuggestions-config/suggestions-api-config\";\nimport {\n Message,\n Role,\n TextMessage,\n convertGqlOutputToMessages,\n convertMessagesToGqlInput,\n filterAgentStateMessages,\n CopilotRequestType,\n} from \"@copilotkit/runtime-client-gql\";\n\n/**\n * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n * The function takes in the text before and after the cursor, and an abort signal.\n * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.\n * The function returns the suggestion from the API response.\n *\n * @param textareaPurpose - The purpose of the textarea. This is included in the system message.\n * @param apiEndpoint - The API endpoint to send the autosuggestion request to.\n * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.\n * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.\n * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) \"global\" context category.\n * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n */\nexport function useMakeStandardAutosuggestionFunction(\n textareaPurpose: string,\n contextCategories: string[],\n apiConfig: SuggestionsApiConfig,\n): AutosuggestionsBareFunction {\n const { getContextString, copilotApiConfig, runtimeClient } = useCopilotContext();\n const { chatApiEndpoint: url, publicApiKey, credentials, properties } = copilotApiConfig;\n const headers = {\n ...copilotApiConfig.headers,\n ...(publicApiKey ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: publicApiKey } : {}),\n };\n const { maxTokens, stop, temperature = 0 } = apiConfig;\n\n return useCallback(\n async (editorState: InsertionEditorState, abortSignal: AbortSignal) => {\n const res = await retry(async () => {\n // @ts-expect-error -- Passing null is forbidden, but we're filtering it later\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: apiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString([], contextCategories),\n ),\n }),\n ...apiConfig.fewShotMessages,\n editorState.textAfterCursor != \"\"\n ? new TextMessage({\n role: Role.User,\n content: editorState.textAfterCursor,\n })\n : null,\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n ].filter(Boolean);\n\n const response = await runtimeClient\n .generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n url: window.location.href,\n },\n messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n forwardedParameters: {\n maxTokens,\n stop,\n temperature,\n },\n },\n properties,\n signal: abortSignal,\n })\n .toPromise();\n\n let result = \"\";\n for (const message of convertGqlOutputToMessages(\n response.data?.generateCopilotResponse?.messages ?? [],\n )) {\n if (abortSignal.aborted) {\n break;\n }\n if (message.isTextMessage()) {\n result += message.content;\n }\n }\n\n return result;\n });\n\n return res;\n },\n [apiConfig, getContextString, contextCategories, textareaPurpose],\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,2CAA2C;AACpD,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAK5B;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeA,SAAS,sCACd,iBACA,mBACA,WAC6B;AAC7B,QAAM,EAAE,kBAAkB,kBAAkB,cAAc,IAAI,kBAAkB;AAChF,QAAM,EAAE,iBAAiB,KAAK,cAAc,aAAa,WAAW,IAAI;AACxE,QAAM,UAAU,kCACX,iBAAiB,UAChB,eAAe,EAAE,CAAC,mCAAmC,GAAG,aAAa,IAAI,CAAC;AAEhF,QAAM,EAAE,WAAW,MAAM,cAAc,EAAE,IAAI;AAE7C,SAAO;AAAA,IACL,CAAO,aAAmC,gBAA6B;AACrE,YAAM,MAAM,MAAM,MAAM,MAAY;AA7C1C;AA+CQ,cAAM,WAAsB;AAAA,UAC1B,IAAI,YAAY;AAAA,YACd,MAAM,KAAK;AAAA,YACX,SAAS,UAAU;AAAA,cACjB;AAAA,cACA,iBAAiB,CAAC,GAAG,iBAAiB;AAAA,YACxC;AAAA,UACF,CAAC;AAAA,UACD,GAAG,UAAU;AAAA,UACb,YAAY,mBAAmB,KAC3B,IAAI,YAAY;AAAA,YACd,MAAM,KAAK;AAAA,YACX,SAAS,YAAY;AAAA,UACvB,CAAC,IACD;AAAA,UACJ,IAAI,YAAY;AAAA,YACd,MAAM,KAAK;AAAA,YACX,SAAS,oBAAoB,YAAY;AAAA,UAC3C,CAAC;AAAA,UACD,IAAI,YAAY;AAAA,YACd,MAAM,KAAK;AAAA,YACX,SAAS,qBAAqB,YAAY;AAAA,UAC5C,CAAC;AAAA,QACH,EAAE,OAAO,OAAO;AAEhB,cAAM,WAAW,MAAM,cACpB,wBAAwB;AAAA,UACvB,MAAM;AAAA,YACJ,UAAU;AAAA,cACR,SAAS,CAAC;AAAA,cACV,KAAK,OAAO,SAAS;AAAA,YACvB;AAAA,YACA,UAAU,0BAA0B,yBAAyB,QAAQ,CAAC;AAAA,YACtE,UAAU;AAAA,cACR,aAAa,mBAAmB;AAAA,YAClC;AAAA,YACA,qBAAqB;AAAA,cACnB;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,UACF;AAAA,UACA;AAAA,UACA,QAAQ;AAAA,QACV,CAAC,EACA,UAAU;AAEb,YAAI,SAAS;AACb,mBAAW,WAAW;AAAA,WACpB,0BAAS,SAAT,mBAAe,4BAAf,mBAAwC,aAAxC,YAAoD,CAAC;AAAA,QACvD,GAAG;AACD,cAAI,YAAY,SAAS;AACvB;AAAA,UACF;AACA,cAAI,QAAQ,cAAc,GAAG;AAC3B,sBAAU,QAAQ;AAAA,UACpB;AAAA,QACF;AAEA,eAAO;AAAA,MACT,EAAC;AAED,aAAO;AAAA,IACT;AAAA,IACA,CAAC,WAAW,kBAAkB,mBAAmB,eAAe;AAAA,EAClE;AACF;","names":[]}
@@ -1 +0,0 @@
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":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-MMVDU6DF.mjs.map
@@ -1,60 +0,0 @@
1
- import {
2
- useMakeStandardAutosuggestionFunction
3
- } from "./chunk-F6GMWOLE.mjs";
4
- import {
5
- useMakeStandardInsertionOrEditingFunction
6
- } from "./chunk-RXV67GJN.mjs";
7
- import {
8
- defaultAutosuggestionsConfig
9
- } from "./chunk-6SGWO63I.mjs";
10
- import {
11
- BaseCopilotTextarea
12
- } from "./chunk-7WVURIB7.mjs";
13
- import {
14
- __objRest,
15
- __spreadProps,
16
- __spreadValues
17
- } from "./chunk-MRXNTQOX.mjs";
18
-
19
- // src/components/copilot-textarea/copilot-textarea.tsx
20
- import React from "react";
21
- import merge from "lodash.merge";
22
- import { Fragment, jsx } from "react/jsx-runtime";
23
- var CopilotTextarea = React.forwardRef(
24
- (props, ref) => {
25
- const _a = props, { autosuggestionsConfig: autosuggestionsConfigUserSpecified } = _a, forwardedProps = __objRest(_a, ["autosuggestionsConfig"]);
26
- const autosuggestionsConfig = merge(
27
- defaultAutosuggestionsConfig,
28
- autosuggestionsConfigUserSpecified
29
- );
30
- const autosuggestionsFunction = useMakeStandardAutosuggestionFunction(
31
- autosuggestionsConfig.textareaPurpose,
32
- autosuggestionsConfig.contextCategories,
33
- autosuggestionsConfig.chatApiConfigs.suggestionsApiConfig
34
- );
35
- const insertionOrEditingFunction = useMakeStandardInsertionOrEditingFunction(
36
- autosuggestionsConfig.textareaPurpose,
37
- autosuggestionsConfig.contextCategories,
38
- autosuggestionsConfig.chatApiConfigs.insertionApiConfig,
39
- autosuggestionsConfig.chatApiConfigs.editingApiConfig
40
- );
41
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
42
- BaseCopilotTextarea,
43
- __spreadProps(__spreadValues({
44
- ref
45
- }, forwardedProps), {
46
- baseAutosuggestionsConfig: __spreadProps(__spreadValues({}, autosuggestionsConfig), {
47
- apiConfig: {
48
- insertionOrEditingFunction,
49
- autosuggestionsFunction
50
- }
51
- })
52
- })
53
- ) });
54
- }
55
- );
56
-
57
- export {
58
- CopilotTextarea
59
- };
60
- //# sourceMappingURL=chunk-NZIHZWRU.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/copilot-textarea/copilot-textarea.tsx"],"sourcesContent":["/**\n * <br/>\n * <img src=\"https://cdn.copilotkit.ai/docs/copilotkit/images/CopilotTextarea.gif\" width=\"500\" />\n *\n * `<CopilotTextarea>` is a React component that acts as a drop-in replacement for the standard `<textarea>`,\n * offering enhanced autocomplete features powered by AI. It is context-aware, integrating seamlessly with the\n * [`useCopilotReadable`](/reference/hooks/useCopilotReadable) hook to provide intelligent suggestions based on the application context.\n *\n * In addition, it provides a hovering editor window (available by default via `Cmd + K` on Mac and `Ctrl + K` on Windows) that allows the user to\n * suggest changes to the text, for example providing a summary or rephrasing the text.\n *\n * ## Example\n *\n * ```tsx\n * import { CopilotTextarea } from '@copilotkit/react-textarea';\n * import \"@copilotkit/react-textarea/styles.css\";\n *\n * <CopilotTextarea\n * autosuggestionsConfig={{\n * textareaPurpose:\n * \"the body of an email message\",\n * chatApiConfigs: {},\n * }}\n * />\n * ```\n *\n * ## Usage\n *\n * ### Install Dependencies\n *\n * This component is part of the [@copilotkit/react-textarea](https://npmjs.com/package/@copilotkit/react-textarea) package.\n *\n * ```shell npm2yarn \\\"@copilotkit/react-textarea\"\\\n * npm install @copilotkit/react-core @copilotkit/react-textarea\n * ```\n *\n * ### Usage\n *\n * Use the CopilotTextarea component in your React application similarly to a standard `<textarea />`,\n * with additional configurations for AI-powered features.\n *\n * For example:\n *\n * ```tsx\n * import { useState } from \"react\";\n * import { CopilotTextarea } from \"@copilotkit/react-textarea\";\n * import \"@copilotkit/react-textarea/styles.css\";\n *\n * export function ExampleComponent() {\n * const [text, setText] = useState(\"\");\n *\n * return (\n * <CopilotTextarea\n * className=\"custom-textarea-class\"\n * value={text}\n * onValueChange={(value: string) => setText(value)}\n * placeholder=\"Enter your text here...\"\n * autosuggestionsConfig={{\n * textareaPurpose: \"Provide context or purpose of the textarea.\",\n * chatApiConfigs: {\n * suggestionsApiConfig: {\n * maxTokens: 20,\n * stop: [\".\", \"?\", \"!\"],\n * },\n * },\n * }}\n * />\n * );\n * }\n * ```\n *\n * ### Look & Feel\n *\n * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:\n * ```tsx title=\"YourRootComponent.tsx\"\n * ...\n * import \"@copilotkit/react-textarea/styles.css\"; // [!code highlight]\n *\n * export function YourRootComponent() {\n * return (\n * <CopilotKit>\n * ...\n * </CopilotKit>\n * );\n * }\n * ```\n * For more information about how to customize the styles, check out the [Customize Look & Feel](/guides/custom-look-and-feel/customize-built-in-ui-components) guide.\n * */\nimport React from \"react\";\nimport { useMakeStandardAutosuggestionFunction } from \"../../hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function\";\nimport { HTMLCopilotTextAreaElement } from \"../../types\";\nimport { BaseCopilotTextareaProps } from \"../../types/base/base-copilot-textarea-props\";\nimport {\n AutosuggestionsConfig,\n defaultAutosuggestionsConfig,\n} from \"../../types/autosuggestions-config\";\nimport { BaseCopilotTextarea } from \"../base-copilot-textarea/base-copilot-textarea\";\nimport { useMakeStandardInsertionOrEditingFunction } from \"../../hooks/make-autosuggestions-function/use-make-standard-insertion-function\";\nimport merge from \"lodash.merge\";\nimport { AutosuggestionsConfigUserSpecified } from \"../../types/autosuggestions-config/autosuggestions-config-user-specified\";\n\n// Like the base copilot textarea props,\n// but with baseAutosuggestionsConfig replaced with autosuggestionsConfig.\nexport interface CopilotTextareaProps\n extends Omit<BaseCopilotTextareaProps, \"baseAutosuggestionsConfig\"> {\n /**\n * Configuration settings for the autosuggestions feature.\n * For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).\n *\n * <PropertyReference name=\"textareaPurpose\" type=\"string\" required={true} >\n * The purpose of the text area in plain text.\n *\n * Example: *\"The body of the email response\"*\n * </PropertyReference>\n *\n * <PropertyReference name=\"chatApiConfigs\" type=\"ChatApiConfigs\" >\n * The chat API configurations.\n *\n * <strong>NOTE:</strong> You must provide specify at least one of `suggestionsApiConfig` or `insertionApiConfig`.\n *\n * <PropertyReference name=\"suggestionsApiConfig\" type=\"SuggestionsApiConfig\">\n * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).\n * </PropertyReference>\n * <PropertyReference name=\"insertionApiConfig\" type=\"InsertionApiConfig\">\n * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).\n * </PropertyReference>\n * </PropertyReference>\n *\n * <PropertyReference name=\"disabled\" type=\"boolean\" >\n * Whether the textarea is disabled.\n * </PropertyReference>\n *\n * <PropertyReference name=\"disableBranding\" type=\"boolean\" >\n * Whether to disable the CopilotKit branding.\n * </PropertyReference>\n *\n * <PropertyReference name=\"placeholderStyle\" type=\"React.CSSProperties\" >\n * Specifies the CSS styles to apply to the placeholder text.\n * </PropertyReference>\n *\n * <PropertyReference name=\"suggestionsStyle\" type=\"React.CSSProperties\" >\n * Specifies the CSS styles to apply to the suggestions list.\n * </PropertyReference>\n *\n * <PropertyReference name=\"hoverMenuClassname\" type=\"string\" >\n * A class name to apply to the editor popover window.\n * </PropertyReference>\n *\n * <PropertyReference name=\"value\" type=\"string\" >\n * The initial value of the textarea. Can be controlled via `onValueChange`.\n * </PropertyReference>\n *\n * <PropertyReference name=\"onValueChange\" type=\"(value: string) => void\" >\n * Callback invoked when the value of the textarea changes.\n * </PropertyReference>\n *\n * <PropertyReference name=\"onChange\" type=\"(event: React.ChangeEvent<HTMLTextAreaElement>) => void\" >\n * Callback invoked when a `change` event is triggered on the textarea element.\n * </PropertyReference>\n *\n * <PropertyReference name=\"shortcut\" type=\"string\" >\n * The shortcut to use to open the editor popover window. Default is `\"Cmd-k\"`.\n * </PropertyReference>\n */\n autosuggestionsConfig: AutosuggestionsConfigUserSpecified;\n}\n\n/**\n * A copilot textarea that uses the standard autosuggestions function.\n */\nexport const CopilotTextarea = React.forwardRef(\n (props: CopilotTextareaProps, ref: React.Ref<HTMLCopilotTextAreaElement>) => {\n // separate the AutosuggestionsConfigUserSpecified from the rest of the props\n const { autosuggestionsConfig: autosuggestionsConfigUserSpecified, ...forwardedProps } = props;\n\n const autosuggestionsConfig: AutosuggestionsConfig = merge(\n defaultAutosuggestionsConfig,\n autosuggestionsConfigUserSpecified,\n );\n\n const autosuggestionsFunction = useMakeStandardAutosuggestionFunction(\n autosuggestionsConfig.textareaPurpose,\n autosuggestionsConfig.contextCategories,\n autosuggestionsConfig.chatApiConfigs.suggestionsApiConfig,\n );\n\n const insertionOrEditingFunction = useMakeStandardInsertionOrEditingFunction(\n autosuggestionsConfig.textareaPurpose,\n autosuggestionsConfig.contextCategories,\n autosuggestionsConfig.chatApiConfigs.insertionApiConfig,\n autosuggestionsConfig.chatApiConfigs.editingApiConfig,\n );\n\n return (\n <>\n <BaseCopilotTextarea\n ref={ref}\n {...forwardedProps}\n baseAutosuggestionsConfig={{\n ...autosuggestionsConfig,\n apiConfig: {\n insertionOrEditingFunction: insertionOrEditingFunction,\n autosuggestionsFunction: autosuggestionsFunction,\n },\n }}\n />\n </>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwFA,OAAO,WAAW;AAUlB,OAAO,WAAW;AAgGZ,mBACE,WADF;AAxBC,IAAM,kBAAkB,MAAM;AAAA,EACnC,CAAC,OAA6B,QAA+C;AAE3E,UAAyF,YAAjF,yBAAuB,mCA7KnC,IA6K6F,IAAnB,2BAAmB,IAAnB,CAA9D;AAER,UAAM,wBAA+C;AAAA,MACnD;AAAA,MACA;AAAA,IACF;AAEA,UAAM,0BAA0B;AAAA,MAC9B,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,sBAAsB,eAAe;AAAA,IACvC;AAEA,UAAM,6BAA6B;AAAA,MACjC,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,sBAAsB,eAAe;AAAA,MACrC,sBAAsB,eAAe;AAAA,IACvC;AAEA,WACE,gCACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,SACI,iBAFL;AAAA,QAGC,2BAA2B,iCACtB,wBADsB;AAAA,UAEzB,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx"],"sourcesContent":["import { COPILOT_CLOUD_PUBLIC_API_KEY_HEADER } from \"@copilotkit/shared\";\nimport { useCopilotContext } from \"@copilotkit/react-core\";\nimport { useCallback } from \"react\";\nimport {\n CopilotRuntimeClient,\n Message,\n Role,\n TextMessage,\n convertGqlOutputToMessages,\n convertMessagesToGqlInput,\n filterAgentStateMessages,\n CopilotRequestType,\n} from \"@copilotkit/runtime-client-gql\";\nimport { retry } from \"../../lib/retry\";\nimport {\n EditingEditorState,\n Generator_InsertionOrEditingSuggestion,\n} from \"../../types/base/autosuggestions-bare-function\";\nimport { InsertionsApiConfig } from \"../../types/autosuggestions-config/insertions-api-config\";\nimport { EditingApiConfig } from \"../../types/autosuggestions-config/editing-api-config\";\nimport { DocumentPointer } from \"@copilotkit/react-core\";\n\n/**\n * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n * The function takes in the text before and after the cursor, and an abort signal.\n * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.\n * The function returns the suggestion from the API response.\n *\n * @param textareaPurpose - The purpose of the textarea. This is included in the system message.\n * @param apiEndpoint - The API endpoint to send the autosuggestion request to.\n * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.\n * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.\n * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) \"global\" context category.\n * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n */\nexport function useMakeStandardInsertionOrEditingFunction(\n textareaPurpose: string,\n contextCategories: string[],\n insertionApiConfig: InsertionsApiConfig,\n editingApiConfig: EditingApiConfig,\n): Generator_InsertionOrEditingSuggestion {\n const { getContextString, copilotApiConfig, runtimeClient } = useCopilotContext();\n const headers = {\n ...(copilotApiConfig.publicApiKey\n ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey }\n : {}),\n };\n\n async function runtimeClientResponseToStringStream(\n responsePromise: ReturnType<typeof runtimeClient.generateCopilotResponse>,\n ) {\n const messagesStream = runtimeClient.asStream(responsePromise);\n\n return new ReadableStream({\n async start(controller) {\n const reader = messagesStream.getReader();\n let sentContent = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n\n const messages = convertGqlOutputToMessages(value.generateCopilotResponse.messages);\n\n let newContent = \"\";\n\n for (const message of messages) {\n if (message.isTextMessage()) {\n newContent += message.content;\n }\n }\n if (newContent) {\n const contentToSend = newContent.slice(sentContent.length);\n controller.enqueue(contentToSend);\n sentContent += contentToSend;\n }\n }\n controller.close();\n },\n });\n }\n\n const insertionFunction = useCallback(\n async (\n editorState: EditingEditorState,\n insertionPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n const res = await retry(async () => {\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: insertionApiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString(documents, contextCategories),\n ),\n }),\n ...insertionApiConfig.fewShotMessages,\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<InsertionPrompt>${insertionPrompt}</InsertionPrompt>`,\n }),\n ];\n\n return runtimeClientResponseToStringStream(\n runtimeClient.generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n url: window.location.href,\n },\n messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n },\n properties: copilotApiConfig.properties,\n signal: abortSignal,\n }),\n );\n });\n\n return res;\n },\n [insertionApiConfig, getContextString, contextCategories, textareaPurpose],\n );\n\n const editingFunction = useCallback(\n async (\n editorState: EditingEditorState,\n editingPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n const res = await retry(async () => {\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: editingApiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString(documents, contextCategories),\n ),\n }),\n ...editingApiConfig.fewShotMessages,\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextToEdit>${editorState.selectedText}</TextToEdit>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<EditingPrompt>${editingPrompt}</EditingPrompt>`,\n }),\n ];\n\n return runtimeClientResponseToStringStream(\n runtimeClient.generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n url: window.location.href,\n },\n messages: convertMessagesToGqlInput(filterAgentStateMessages(messages)),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n },\n properties: copilotApiConfig.properties,\n signal: abortSignal,\n }),\n );\n });\n\n return res;\n },\n [editingApiConfig, getContextString, contextCategories, textareaPurpose],\n );\n\n const insertionOrEditingFunction = useCallback(\n async (\n editorState: EditingEditorState,\n insertionPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n if (editorState.selectedText === \"\") {\n return await insertionFunction(editorState, insertionPrompt, documents, abortSignal);\n } else {\n return await editingFunction(editorState, insertionPrompt, documents, abortSignal);\n }\n },\n [insertionFunction, editingFunction],\n );\n\n return insertionOrEditingFunction;\n}\n"],"mappings":"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","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/base-copilot-textarea/render-placeholder.tsx"],"sourcesContent":["import { RenderPlaceholderProps } from \"slate-react\";\n\nexport type RenderPlaceholderFunction = (props: RenderPlaceholderProps) => JSX.Element;\n\nexport function makeRenderPlaceholderFunction(\n placeholderStyle?: React.CSSProperties,\n): RenderPlaceholderFunction {\n return (props: RenderPlaceholderProps) => {\n const { style, ...restAttributes } = props.attributes;\n\n return (\n <div\n {...restAttributes}\n style={{\n ...style,\n ...placeholderStyle,\n }}\n >\n {props.children}\n </div>\n );\n };\n}\n"],"mappings":";;;;;;;AAWM;AAPC,SAAS,8BACd,kBAC2B;AAC3B,SAAO,CAAC,UAAkC;AACxC,UAAqC,WAAM,YAAnC,QARZ,IAQyC,IAAnB,2BAAmB,IAAnB,CAAV;AAER,WACE;AAAA,MAAC;AAAA,uCACK,iBADL;AAAA,QAEC,OAAO,kCACF,QACA;AAAA,QAGJ,gBAAM;AAAA;AAAA,IACT;AAAA,EAEJ;AACF;","names":[]}