@copilotkit/react-textarea 1.50.1 → 1.51.0-next.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # ui
2
2
 
3
+ ## 1.51.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @copilotkit/react-core@1.51.0-next.1
8
+ - @copilotkit/runtime-client-gql@1.51.0-next.1
9
+ - @copilotkit/shared@1.51.0-next.1
10
+
11
+ ## 1.50.2-next.0
12
+
13
+ ### Patch Changes
14
+
15
+ - @copilotkit/runtime-client-gql@1.50.2-next.0
16
+ - @copilotkit/react-core@1.50.2-next.0
17
+ - @copilotkit/shared@1.50.2-next.0
18
+
3
19
  ## 1.50.1
4
20
 
5
21
  ### Patch Changes
@@ -2678,7 +2694,6 @@
2678
2694
  - e16d95e: New prerelease
2679
2695
  - 1721cbd: Add convertActionsToDynamicStructuredTools to sdk-js
2680
2696
  - CopilotKit Core:
2681
-
2682
2697
  - Improved error messages and overall logs
2683
2698
  - `useCopilotAction.renderAndAwait` renamed to `.renderAndAwaitForResponse` (backwards compatible, will be deprecated in the future)
2684
2699
  - Improved scrolling behavior. It is now possible to scroll up during LLM response generation
@@ -2686,7 +2701,6 @@
2686
2701
  - Updated interfaces for better developer ergonomics
2687
2702
 
2688
2703
  CoAgents:
2689
-
2690
2704
  - Renamed `remoteActions` to `remoteEndpoints` (backwards compatible, will be deprecated in the future)
2691
2705
  - Support for LangGraph Platform in Remote Endpoints
2692
2706
  - LangGraph JS Support for CoAgents (locally via `langgraph dev`, `langgraph up` or deployed to LangGraph Platform)
@@ -2694,7 +2708,6 @@
2694
2708
  - Enhanced state management and message handling
2695
2709
 
2696
2710
  CopilotKid Back-end SDK:
2697
-
2698
2711
  - Released a whole-new `@copilotkit/sdk-js` for building agents with LangGraph JS Support
2699
2712
 
2700
2713
  - 8d0144f: bump
@@ -3097,7 +3110,6 @@ CopilotKid Back-end SDK:
3097
3110
  ### Patch Changes
3098
3111
 
3099
3112
  - inject minified css in bundle
3100
-
3101
3113
  - removes the need to import `styles.css` manually
3102
3114
  - empty `styles.css` included in the build for backwards compatibility
3103
3115
  - uses tsup's `injectStyles` with `postcss` to bundle and minify the CSS, then inject it as a style tag
@@ -3262,7 +3274,6 @@ CopilotKid Back-end SDK:
3262
3274
  ### Major Changes
3263
3275
 
3264
3276
  - b6a4b6eb: V1.0 Release Candidate
3265
-
3266
3277
  - A robust new protocol between the frontend and the Copilot Runtime
3267
3278
  - Support for Copilot Cloud
3268
3279
  - Generative UI
@@ -3270,7 +3281,6 @@ CopilotKid Back-end SDK:
3270
3281
  - OpenAI assistant API streaming
3271
3282
 
3272
3283
  - V1.0 Release
3273
-
3274
3284
  - A robust new protocol between the frontend and the Copilot Runtime
3275
3285
  - Support for Copilot Cloud
3276
3286
  - Generative UI
@@ -3314,7 +3324,6 @@ CopilotKid Back-end SDK:
3314
3324
  ### Major Changes
3315
3325
 
3316
3326
  - V1.0 Release Candidate
3317
-
3318
3327
  - A robust new protocol between the frontend and the Copilot Runtime
3319
3328
  - Support for Copilot Cloud
3320
3329
  - Generative UI
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Atai Barkai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -16,9 +16,6 @@ import {
16
16
  import {
17
17
  replaceEditorText
18
18
  } from "./chunk-5UNJXFUO.mjs";
19
- import {
20
- TrackerTextEditedSinceLastCursorMovement
21
- } from "./chunk-JLOABKLH.mjs";
22
19
  import {
23
20
  useAddBrandingCss
24
21
  } from "./chunk-7LSRNPNI.mjs";
@@ -38,6 +35,9 @@ import {
38
35
  import {
39
36
  makeRenderPlaceholderFunction
40
37
  } from "./chunk-3QJOFG3V.mjs";
38
+ import {
39
+ TrackerTextEditedSinceLastCursorMovement
40
+ } from "./chunk-JLOABKLH.mjs";
41
41
  import {
42
42
  getFullEditorTextWithNewlines,
43
43
  getTextAroundCollapsedCursor
@@ -266,4 +266,4 @@ function makeSemiFakeReactTextAreaEvent(currentText) {
266
266
  export {
267
267
  BaseCopilotTextarea
268
268
  };
269
- //# sourceMappingURL=chunk-E4O6GBR5.mjs.map
269
+ //# sourceMappingURL=chunk-FFYCP5ZP.mjs.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6SGWO63I.mjs";
10
10
  import {
11
11
  BaseCopilotTextarea
12
- } from "./chunk-E4O6GBR5.mjs";
12
+ } from "./chunk-FFYCP5ZP.mjs";
13
13
  import {
14
14
  __objRest,
15
15
  __spreadProps,
@@ -57,4 +57,4 @@ var CopilotTextarea = React.forwardRef(
57
57
  export {
58
58
  CopilotTextarea
59
59
  };
60
- //# sourceMappingURL=chunk-3IYQPSQV.mjs.map
60
+ //# sourceMappingURL=chunk-KGU7Z4W7.mjs.map
@@ -0,0 +1 @@
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/src/v1.x/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/src/v1.x/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/src/v1.x/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,6 +1,6 @@
1
1
  import {
2
2
  BaseCopilotTextarea
3
- } from "../../chunk-E4O6GBR5.mjs";
3
+ } from "../../chunk-FFYCP5ZP.mjs";
4
4
  import "../../chunk-2C7O2EVM.mjs";
5
5
  import "../../chunk-GQN2HYFJ.mjs";
6
6
  import "../../chunk-23Q6A46J.mjs";
@@ -9,7 +9,6 @@ import "../../chunk-DRV2FOHZ.mjs";
9
9
  import "../../chunk-4NHVQZ67.mjs";
10
10
  import "../../chunk-QJNFNPWH.mjs";
11
11
  import "../../chunk-5UNJXFUO.mjs";
12
- import "../../chunk-JLOABKLH.mjs";
13
12
  import "../../chunk-7LSRNPNI.mjs";
14
13
  import "../../chunk-72GJNLCO.mjs";
15
14
  import "../../chunk-L7VVZH4Q.mjs";
@@ -30,6 +29,7 @@ import "../../chunk-WJHSY5T6.mjs";
30
29
  import "../../chunk-F6RLSVG3.mjs";
31
30
  import "../../chunk-F2ULK22F.mjs";
32
31
  import "../../chunk-3QJOFG3V.mjs";
32
+ import "../../chunk-JLOABKLH.mjs";
33
33
  import "../../chunk-DFTV4TST.mjs";
34
34
  import "../../chunk-T6MTDQZ7.mjs";
35
35
  import "../../chunk-ECR45NSD.mjs";
@@ -104,7 +104,7 @@ import '../../types/autosuggestions-config/editing-api-config.js';
104
104
  interface CopilotTextareaProps extends Omit<BaseCopilotTextareaProps, "baseAutosuggestionsConfig"> {
105
105
  /**
106
106
  * Configuration settings for the autosuggestions feature.
107
- * 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).
107
+ * For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
108
108
  *
109
109
  * <PropertyReference name="textareaPurpose" type="string" required={true} >
110
110
  * The purpose of the text area in plain text.
@@ -118,10 +118,10 @@ interface CopilotTextareaProps extends Omit<BaseCopilotTextareaProps, "baseAutos
118
118
  * <strong>NOTE:</strong> You must provide specify at least one of `suggestionsApiConfig` or `insertionApiConfig`.
119
119
  *
120
120
  * <PropertyReference name="suggestionsApiConfig" type="SuggestionsApiConfig">
121
- * 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).
121
+ * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
122
122
  * </PropertyReference>
123
123
  * <PropertyReference name="insertionApiConfig" type="InsertionApiConfig">
124
- * 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).
124
+ * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
125
125
  * </PropertyReference>
126
126
  * </PropertyReference>
127
127
  *