@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/dist/index.umd.js
CHANGED
|
@@ -178,7 +178,7 @@ lodash_merge = __toESM(lodash_merge);
|
|
|
178
178
|
const batch = undos[undos.length - 1];
|
|
179
179
|
slate_history.HistoryEditor.withoutSaving(e, () => {
|
|
180
180
|
slate.Editor.withoutNormalizing(e, () => {
|
|
181
|
-
const inverseOps = batch.operations.map(slate.Operation.inverse).
|
|
181
|
+
const inverseOps = batch.operations.map(slate.Operation.inverse).toReversed();
|
|
182
182
|
for (const op of inverseOps) e.apply(op);
|
|
183
183
|
if (batch.selectionBefore) slate.Transforms.setSelection(e, batch.selectionBefore);
|
|
184
184
|
});
|
|
@@ -1481,7 +1481,7 @@ lodash_merge = __toESM(lodash_merge);
|
|
|
1481
1481
|
return `You are a versatile writing assistant.
|
|
1482
1482
|
|
|
1483
1483
|
The user is writing some text.
|
|
1484
|
-
The purpose is:
|
|
1484
|
+
The purpose is: "${textareaPurpose}"
|
|
1485
1485
|
|
|
1486
1486
|
Your job is to guess what the user will write next AS BEST YOU CAN.
|
|
1487
1487
|
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
@@ -1539,7 +1539,7 @@ ${contextString}
|
|
|
1539
1539
|
return `You are a versatile writing assistant helping the user insert new text into their existing work.
|
|
1540
1540
|
|
|
1541
1541
|
The user is writing some text.
|
|
1542
|
-
The purpose is:
|
|
1542
|
+
The purpose is: "${textareaPurpose}"
|
|
1543
1543
|
|
|
1544
1544
|
The following external context is also provided. Use it to inform your suggestions when relevant!!!
|
|
1545
1545
|
\`\`\`
|
|
@@ -1608,7 +1608,7 @@ The conversation will be structured as follows:
|
|
|
1608
1608
|
return `You are a versatile writing assistant helping the user edit a portion of their text.
|
|
1609
1609
|
|
|
1610
1610
|
The user is writing some text.
|
|
1611
|
-
The purpose is:
|
|
1611
|
+
The purpose is: "${textareaPurpose}"
|
|
1612
1612
|
|
|
1613
1613
|
The following external context is also provided. Use it when relevant.
|
|
1614
1614
|
\`\`\`
|
|
@@ -1708,7 +1708,7 @@ The conversation will be structured as follows:
|
|
|
1708
1708
|
function useMakeStandardInsertionOrEditingFunction(textareaPurpose, contextCategories, insertionApiConfig, editingApiConfig) {
|
|
1709
1709
|
const runtimeClient = { generateCopilotResponse: (...args) => {} };
|
|
1710
1710
|
const { getContextString, copilotApiConfig } = (0, _copilotkit_react_core.useCopilotContext)();
|
|
1711
|
-
|
|
1711
|
+
copilotApiConfig.publicApiKey && copilotApiConfig.publicApiKey;
|
|
1712
1712
|
async function runtimeClientResponseToStringStream(responsePromise) {
|
|
1713
1713
|
const messagesStream = runtimeClient.asStream(responsePromise);
|
|
1714
1714
|
return new ReadableStream({ async start(controller) {
|