@copilotkit/react-textarea 1.55.1 → 1.55.2-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 +17 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/context/index.ts +0 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +3 -5
- package/src/lib/slatejs-edits/with-partial-history.ts +3 -1
- package/src/types/autosuggestions-config/editing-api-config.tsx +1 -1
- package/src/types/autosuggestions-config/insertions-api-config.tsx +1 -1
- package/src/types/autosuggestions-config/suggestions-api-config.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/react-textarea",
|
|
3
|
-
"version": "1.55.1",
|
|
3
|
+
"version": "1.55.2-next.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"slate-history": "^0.93.0",
|
|
60
60
|
"slate-react": "^0.98.1",
|
|
61
61
|
"tailwind-merge": "^1.13.2",
|
|
62
|
-
"@copilotkit/react-core": "1.55.1",
|
|
63
|
-
"@copilotkit/runtime-client-gql": "1.55.1",
|
|
64
|
-
"@copilotkit/shared": "1.55.1"
|
|
62
|
+
"@copilotkit/react-core": "1.55.2-next.1",
|
|
63
|
+
"@copilotkit/runtime-client-gql": "1.55.2-next.1",
|
|
64
|
+
"@copilotkit/shared": "1.55.2-next.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/lodash.merge": "^4.6.7",
|
package/src/context/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/hooks/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -43,11 +43,9 @@ export function useMakeStandardInsertionOrEditingFunction(
|
|
|
43
43
|
generateCopilotResponse: (...args: any[]) => {},
|
|
44
44
|
};
|
|
45
45
|
const { getContextString, copilotApiConfig } = useCopilotContext();
|
|
46
|
-
const headers =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
: {}),
|
|
50
|
-
};
|
|
46
|
+
const headers = copilotApiConfig.publicApiKey
|
|
47
|
+
? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey }
|
|
48
|
+
: {};
|
|
51
49
|
|
|
52
50
|
async function runtimeClientResponseToStringStream(
|
|
53
51
|
responsePromise: ReturnType<typeof runtimeClient.generateCopilotResponse>,
|
|
@@ -49,7 +49,9 @@ export const withPartialHistory = <T extends Editor>(
|
|
|
49
49
|
|
|
50
50
|
HistoryEditor.withoutSaving(e, () => {
|
|
51
51
|
Editor.withoutNormalizing(e, () => {
|
|
52
|
-
const inverseOps = batch.operations
|
|
52
|
+
const inverseOps = batch.operations
|
|
53
|
+
.map(Operation.inverse)
|
|
54
|
+
.toReversed();
|
|
53
55
|
|
|
54
56
|
for (const op of inverseOps) {
|
|
55
57
|
e.apply(op);
|
|
@@ -14,7 +14,7 @@ export const defaultEditingMakeSystemPrompt: MakeSystemPrompt = (
|
|
|
14
14
|
return `You are a versatile writing assistant helping the user edit a portion of their text.
|
|
15
15
|
|
|
16
16
|
The user is writing some text.
|
|
17
|
-
The purpose is:
|
|
17
|
+
The purpose is: "${textareaPurpose}"
|
|
18
18
|
|
|
19
19
|
The following external context is also provided. Use it when relevant.
|
|
20
20
|
\`\`\`
|
|
@@ -14,7 +14,7 @@ export const defaultInsertionsMakeSystemPrompt: MakeSystemPrompt = (
|
|
|
14
14
|
return `You are a versatile writing assistant helping the user insert new text into their existing work.
|
|
15
15
|
|
|
16
16
|
The user is writing some text.
|
|
17
|
-
The purpose is:
|
|
17
|
+
The purpose is: "${textareaPurpose}"
|
|
18
18
|
|
|
19
19
|
The following external context is also provided. Use it to inform your suggestions when relevant!!!
|
|
20
20
|
\`\`\`
|
|
@@ -16,7 +16,7 @@ export const defaultSuggestionsMakeSystemPrompt: MakeSystemPrompt = (
|
|
|
16
16
|
return `You are a versatile writing assistant.
|
|
17
17
|
|
|
18
18
|
The user is writing some text.
|
|
19
|
-
The purpose is:
|
|
19
|
+
The purpose is: "${textareaPurpose}"
|
|
20
20
|
|
|
21
21
|
Your job is to guess what the user will write next AS BEST YOU CAN.
|
|
22
22
|
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|