@copilotkit/react-textarea 1.55.2-next.0 → 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/dist/index.mjs CHANGED
@@ -159,7 +159,7 @@ const withPartialHistory = (editor, shouldSave) => {
159
159
  const batch = undos[undos.length - 1];
160
160
  HistoryEditor.withoutSaving(e, () => {
161
161
  Editor.withoutNormalizing(e, () => {
162
- const inverseOps = batch.operations.map(Operation.inverse).reverse();
162
+ const inverseOps = batch.operations.map(Operation.inverse).toReversed();
163
163
  for (const op of inverseOps) e.apply(op);
164
164
  if (batch.selectionBefore) Transforms.setSelection(e, batch.selectionBefore);
165
165
  });
@@ -1450,7 +1450,7 @@ const defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
1450
1450
  return `You are a versatile writing assistant.
1451
1451
 
1452
1452
  The user is writing some text.
1453
- The purpose is: \"${textareaPurpose}\"
1453
+ The purpose is: "${textareaPurpose}"
1454
1454
 
1455
1455
  Your job is to guess what the user will write next AS BEST YOU CAN.
1456
1456
  Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
@@ -1508,7 +1508,7 @@ const defaultInsertionsMakeSystemPrompt = (textareaPurpose, contextString) => {
1508
1508
  return `You are a versatile writing assistant helping the user insert new text into their existing work.
1509
1509
 
1510
1510
  The user is writing some text.
1511
- The purpose is: \"${textareaPurpose}\"
1511
+ The purpose is: "${textareaPurpose}"
1512
1512
 
1513
1513
  The following external context is also provided. Use it to inform your suggestions when relevant!!!
1514
1514
  \`\`\`
@@ -1577,7 +1577,7 @@ const defaultEditingMakeSystemPrompt = (textareaPurpose, contextString) => {
1577
1577
  return `You are a versatile writing assistant helping the user edit a portion of their text.
1578
1578
 
1579
1579
  The user is writing some text.
1580
- The purpose is: \"${textareaPurpose}\"
1580
+ The purpose is: "${textareaPurpose}"
1581
1581
 
1582
1582
  The following external context is also provided. Use it when relevant.
1583
1583
  \`\`\`
@@ -1677,7 +1677,7 @@ const defaultAutosuggestionsConfig = {
1677
1677
  function useMakeStandardInsertionOrEditingFunction(textareaPurpose, contextCategories, insertionApiConfig, editingApiConfig) {
1678
1678
  const runtimeClient = { generateCopilotResponse: (...args) => {} };
1679
1679
  const { getContextString, copilotApiConfig } = useCopilotContext();
1680
- ({ ...copilotApiConfig.publicApiKey ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey } : {} });
1680
+ copilotApiConfig.publicApiKey && copilotApiConfig.publicApiKey;
1681
1681
  async function runtimeClientResponseToStringStream(responsePromise) {
1682
1682
  const messagesStream = runtimeClient.asStream(responsePromise);
1683
1683
  return new ReadableStream({ async start(controller) {