@copilotkit/react-textarea 0.20.0 → 0.21.0-alpha.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 (101) hide show
  1. package/.turbo/turbo-build.log +258 -303
  2. package/CHANGELOG.md +11 -0
  3. package/dist/{chunk-OM3Z4S4Y.mjs → chunk-24SYR4JB.mjs} +12 -7
  4. package/dist/chunk-24SYR4JB.mjs.map +1 -0
  5. package/dist/{chunk-7JO276KU.mjs → chunk-5DU2QDHZ.mjs} +2 -2
  6. package/dist/{chunk-TIBMW3DC.mjs → chunk-63FSISXT.mjs} +3 -3
  7. package/dist/chunk-63FSISXT.mjs.map +1 -0
  8. package/dist/{chunk-PPWNZF3T.mjs → chunk-DYGPLRY3.mjs} +2 -2
  9. package/dist/{chunk-LRXRD5KU.mjs → chunk-KLROO6ID.mjs} +2 -2
  10. package/dist/{chunk-F4WZCQG6.mjs → chunk-O7G7E3E3.mjs} +2 -2
  11. package/dist/{chunk-KIRROE2K.mjs → chunk-QJDMIGLU.mjs} +4 -3
  12. package/dist/chunk-QJDMIGLU.mjs.map +1 -0
  13. package/dist/{chunk-IBSJOQI7.mjs → chunk-WPIA53HF.mjs} +2 -2
  14. package/dist/{chunk-34D4UIYX.mjs → chunk-YXA3UPMI.mjs} +2 -2
  15. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +5 -5
  16. package/dist/components/copilot-textarea/copilot-textarea.mjs +9 -9
  17. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +4 -4
  18. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +2 -2
  19. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +3 -3
  20. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +1 -1
  21. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +3 -3
  22. package/dist/components/index.mjs +9 -9
  23. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +2 -2
  24. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +2 -2
  25. package/dist/index.mjs +9 -9
  26. package/dist/types/autosuggestions-config/index.mjs +1 -1
  27. package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +1 -1
  28. package/dist/types/index.mjs +1 -1
  29. package/package.json +3 -5
  30. package/src/components/copilot-textarea/copilot-textarea.tsx +8 -2
  31. package/src/types/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx +4 -0
  32. package/dist/chunk-KIRROE2K.mjs.map +0 -1
  33. package/dist/chunk-OM3Z4S4Y.mjs.map +0 -1
  34. package/dist/chunk-TIBMW3DC.mjs.map +0 -1
  35. package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +0 -14
  36. package/dist/components/base-copilot-textarea/render-element.d.ts +0 -6
  37. package/dist/components/base-copilot-textarea/render-placeholder.d.ts +0 -6
  38. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.ts +0 -6
  39. package/dist/components/base-copilot-textarea/use-add-branding-css.d.ts +0 -3
  40. package/dist/components/copilot-textarea/copilot-textarea.d.ts +0 -20
  41. package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +0 -13
  42. package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +0 -18
  43. package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +0 -10
  44. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +0 -16
  45. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +0 -14
  46. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.d.ts +0 -15
  47. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.d.ts +0 -4
  48. package/dist/components/index.d.ts +0 -15
  49. package/dist/components/manual-ui/chip-with-icon.d.ts +0 -10
  50. package/dist/components/source-search-box/source-search-box.d.ts +0 -15
  51. package/dist/components/ui/button.d.ts +0 -14
  52. package/dist/components/ui/card.d.ts +0 -10
  53. package/dist/components/ui/command.d.ts +0 -48
  54. package/dist/components/ui/dialog.d.ts +0 -18
  55. package/dist/components/ui/label.d.ts +0 -8
  56. package/dist/components/ui/separator.d.ts +0 -6
  57. package/dist/components/ui/textarea.d.ts +0 -7
  58. package/dist/context/index.d.ts +0 -1
  59. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.ts +0 -14
  60. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.d.ts +0 -8
  61. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.ts +0 -7
  62. package/dist/hooks/index.d.ts +0 -1
  63. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.ts +0 -22
  64. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.d.ts +0 -23
  65. package/dist/hooks/misc/use-autosize-textarea.d.ts +0 -5
  66. package/dist/index.d.ts +0 -16
  67. package/dist/lib/debouncer.d.ts +0 -11
  68. package/dist/lib/editor-to-text.d.ts +0 -7
  69. package/dist/lib/get-text-around-cursor.d.ts +0 -15
  70. package/dist/lib/retry.d.ts +0 -3
  71. package/dist/lib/slatejs-edits/add-autocompletions.d.ts +0 -8
  72. package/dist/lib/slatejs-edits/clear-autocompletions.d.ts +0 -8
  73. package/dist/lib/slatejs-edits/replace-text.d.ts +0 -5
  74. package/dist/lib/slatejs-edits/with-partial-history.d.ts +0 -10
  75. package/dist/lib/stream-promise-flatten.d.ts +0 -12
  76. package/dist/lib/utils.d.ts +0 -10
  77. package/dist/lib/utils.test.d.ts +0 -1
  78. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +0 -23
  79. package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +0 -20
  80. package/dist/types/autosuggestions-config/editing-api-config.d.ts +0 -15
  81. package/dist/types/autosuggestions-config/index.d.ts +0 -11
  82. package/dist/types/autosuggestions-config/insertions-api-config.d.ts +0 -15
  83. package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.d.ts +0 -27
  84. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +0 -3
  85. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.d.ts +0 -7
  86. package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +0 -15
  87. package/dist/types/base/autosuggestion-state.d.ts +0 -8
  88. package/dist/types/base/autosuggestions-bare-function.d.ts +0 -19
  89. package/dist/types/base/base-autosuggestions-config.d.ts +0 -16
  90. package/dist/types/base/base-copilot-textarea-props.d.ts +0 -41
  91. package/dist/types/base/custom-editor.d.ts +0 -29
  92. package/dist/types/base/editor-autocomplete-state.d.ts +0 -10
  93. package/dist/types/base/index.d.ts +0 -5
  94. package/dist/types/html-copilot-textarea-element.d.ts +0 -7
  95. package/dist/types/index.d.ts +0 -14
  96. /package/dist/{chunk-7JO276KU.mjs.map → chunk-5DU2QDHZ.mjs.map} +0 -0
  97. /package/dist/{chunk-PPWNZF3T.mjs.map → chunk-DYGPLRY3.mjs.map} +0 -0
  98. /package/dist/{chunk-LRXRD5KU.mjs.map → chunk-KLROO6ID.mjs.map} +0 -0
  99. /package/dist/{chunk-F4WZCQG6.mjs.map → chunk-O7G7E3E3.mjs.map} +0 -0
  100. /package/dist/{chunk-IBSJOQI7.mjs.map → chunk-WPIA53HF.mjs.map} +0 -0
  101. /package/dist/{chunk-34D4UIYX.mjs.map → chunk-YXA3UPMI.mjs.map} +0 -0
@@ -1,13 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- interface HoveringEditorContextProps {
4
- isDisplayed: boolean;
5
- setIsDisplayed: (value: boolean) => void;
6
- }
7
- interface HoveringEditorProviderProps {
8
- children: ReactNode;
9
- }
10
- declare const HoveringEditorProvider: ({ children, }: HoveringEditorProviderProps) => JSX.Element;
11
- declare const useHoveringEditorContext: () => HoveringEditorContextProps;
12
-
13
- export { HoveringEditorProvider, useHoveringEditorContext };
@@ -1,18 +0,0 @@
1
- import React__default from 'react';
2
-
3
- interface BaseProps {
4
- className: string;
5
- [key: string]: unknown;
6
- }
7
- declare const Button: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<{
8
- active: boolean;
9
- reversed: boolean;
10
- } & BaseProps>, "ref"> & React__default.RefAttributes<HTMLSpanElement>>;
11
- declare const Icon: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<BaseProps>, "ref"> & React__default.RefAttributes<HTMLSpanElement>>;
12
- declare const Menu: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<BaseProps>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
13
- declare const Portal: ({ children }: {
14
- children: React__default.ReactNode;
15
- }) => React__default.ReactPortal | null;
16
- declare const Toolbar: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<BaseProps>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
17
-
18
- export { Button, Icon, Menu, Portal, Toolbar };
@@ -1,10 +0,0 @@
1
- import { InsertionEditorApiConfig } from '../../types/base/autosuggestions-bare-function.js';
2
- import '@copilotkit/react-core';
3
-
4
- interface HoveringToolbarProps {
5
- apiConfig: InsertionEditorApiConfig;
6
- contextCategories: string[];
7
- }
8
- declare const HoveringToolbar: (props: HoveringToolbarProps) => JSX.Element | null;
9
-
10
- export { HoveringToolbar, HoveringToolbarProps };
@@ -1,16 +0,0 @@
1
- import { EditingEditorState, Generator_InsertionOrEditingSuggestion } from '../../../types/base/autosuggestions-bare-function.js';
2
- import React__default from 'react';
3
- import '@copilotkit/react-core';
4
-
5
- type SuggestionState = {
6
- editorState: EditingEditorState;
7
- };
8
- interface HoveringInsertionPromptBoxCoreProps {
9
- state: SuggestionState;
10
- performInsertion: (insertedText: string) => void;
11
- insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;
12
- contextCategories: string[];
13
- }
14
- declare const HoveringInsertionPromptBoxCore: React__default.FC<HoveringInsertionPromptBoxCoreProps>;
15
-
16
- export { HoveringInsertionPromptBoxCore, HoveringInsertionPromptBoxCoreProps, SuggestionState };
@@ -1,14 +0,0 @@
1
- import React__default from 'react';
2
- import { EditingEditorState, InsertionEditorApiConfig } from '../../../types/base/autosuggestions-bare-function.js';
3
- import '@copilotkit/react-core';
4
-
5
- interface Props {
6
- editorState: EditingEditorState;
7
- apiConfig: InsertionEditorApiConfig;
8
- performInsertion: (insertedText: string) => void;
9
- closeWindow: () => void;
10
- contextCategories: string[];
11
- }
12
- declare const HoveringInsertionPromptBox: React__default.FC<Props>;
13
-
14
- export { HoveringInsertionPromptBox, Props };
@@ -1,15 +0,0 @@
1
- import { DocumentPointer } from '@copilotkit/react-core';
2
- import React__default from 'react';
3
-
4
- interface IncludedFilesPreviewProps {
5
- includedFiles: DocumentPointer[];
6
- setIncludedFiles: React__default.Dispatch<React__default.SetStateAction<DocumentPointer[]>>;
7
- }
8
- declare const IncludedFilesPreview: React__default.FC<IncludedFilesPreviewProps>;
9
- interface FileChipPreviewProp {
10
- filePointer: DocumentPointer;
11
- onDelete: () => void;
12
- }
13
- declare const FileChipPreview: React__default.FC<FileChipPreviewProp>;
14
-
15
- export { FileChipPreview, FileChipPreviewProp, IncludedFilesPreview, IncludedFilesPreviewProps };
@@ -1,4 +0,0 @@
1
- export { HoveringInsertionPromptBox, Props } from './hovering-insertion-prompt-box.js';
2
- import 'react';
3
- import '../../../types/base/autosuggestions-bare-function.js';
4
- import '@copilotkit/react-core';
@@ -1,15 +0,0 @@
1
- export { BaseCopilotTextarea } from './base-copilot-textarea/base-copilot-textarea.js';
2
- export { CopilotTextarea, CopilotTextareaProps } from './copilot-textarea/copilot-textarea.js';
3
- import 'react';
4
- import '../types/base/base-copilot-textarea-props.js';
5
- import '../types/base/base-autosuggestions-config.js';
6
- import '../types/base/autosuggestions-bare-function.js';
7
- import '@copilotkit/react-core';
8
- import '../types/html-copilot-textarea-element.js';
9
- import '../types/autosuggestions-config/autosuggestions-config-user-specified.js';
10
- import '../types/autosuggestions-config/autosuggestions-config.js';
11
- import '../types/autosuggestions-config/suggestions-api-config.js';
12
- import '../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
13
- import '../types/autosuggestions-config/subtypes/make-system-prompt.js';
14
- import '../types/autosuggestions-config/insertions-api-config.js';
15
- import '../types/autosuggestions-config/editing-api-config.js';
@@ -1,10 +0,0 @@
1
- import React__default from 'react';
2
-
3
- interface ChipWithIconProps {
4
- label: string;
5
- onDelete: () => void;
6
- iconUrl: string;
7
- }
8
- declare const ChipWithIcon: React__default.FC<ChipWithIconProps>;
9
-
10
- export { ChipWithIcon, ChipWithIconProps };
@@ -1,15 +0,0 @@
1
- import { DocumentPointer } from '@copilotkit/react-core';
2
-
3
- interface SourceSearchBoxProps {
4
- searchTerm: string;
5
- suggestedFiles: DocumentPointer[];
6
- onSelectedFile: (filePointer: DocumentPointer) => void;
7
- }
8
- declare function SourceSearchBox(props: SourceSearchBoxProps): JSX.Element;
9
- declare function Logo({ children, width, height, }: {
10
- children: React.ReactNode;
11
- width: string;
12
- height: string;
13
- }): JSX.Element;
14
-
15
- export { Logo, SourceSearchBox, SourceSearchBoxProps };
@@ -1,14 +0,0 @@
1
- import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
2
- import * as React from 'react';
3
- import { VariantProps } from 'class-variance-authority';
4
-
5
- declare const buttonVariants: (props?: ({
6
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
7
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
8
- } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
9
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
- asChild?: boolean;
11
- }
12
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
-
14
- export { Button, ButtonProps, buttonVariants };
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
-
3
- declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
6
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
7
- declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
- declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
-
10
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -1,48 +0,0 @@
1
- import * as React from 'react';
2
- import { DialogProps } from '@radix-ui/react-dialog';
3
-
4
- declare const Command: React.ForwardRefExoticComponent<Omit<{
5
- children?: React.ReactNode;
6
- } & React.HTMLAttributes<HTMLDivElement> & {
7
- label?: string | undefined;
8
- shouldFilter?: boolean | undefined;
9
- filter?: ((value: string, search: string) => number) | undefined;
10
- value?: string | undefined;
11
- onValueChange?: ((value: string) => void) | undefined;
12
- loop?: boolean | undefined;
13
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- interface CommandDialogProps extends DialogProps {
15
- }
16
- declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => JSX.Element;
17
- declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "type"> & {
18
- value?: string | undefined;
19
- onValueChange?: ((search: string) => void) | undefined;
20
- } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
21
- declare const CommandList: React.ForwardRefExoticComponent<Omit<{
22
- children?: React.ReactNode;
23
- } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
- declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
25
- children?: React.ReactNode;
26
- } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
27
- declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
28
- children?: React.ReactNode;
29
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "heading"> & {
30
- heading?: React.ReactNode;
31
- value?: string | undefined;
32
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
- declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
34
- alwaysRender?: boolean | undefined;
35
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
- declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
37
- children?: React.ReactNode;
38
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "disabled" | "value" | "onSelect"> & {
39
- disabled?: boolean | undefined;
40
- onSelect?: ((value: string) => void) | undefined;
41
- value?: string | undefined;
42
- } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
43
- declare const CommandShortcut: {
44
- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX.Element;
45
- displayName: string;
46
- };
47
-
48
- export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import * as DialogPrimitive from '@radix-ui/react-dialog';
3
-
4
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
5
- declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
- declare const DialogHeader: {
8
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
9
- displayName: string;
10
- };
11
- declare const DialogFooter: {
12
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
13
- displayName: string;
14
- };
15
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
16
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
17
-
18
- export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
@@ -1,8 +0,0 @@
1
- import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
2
- import * as React from 'react';
3
- import * as LabelPrimitive from '@radix-ui/react-label';
4
- import { VariantProps } from 'class-variance-authority';
5
-
6
- declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
7
-
8
- export { Label };
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
-
4
- declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
-
6
- export { Separator };
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
4
- }
5
- declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
6
-
7
- export { Textarea, TextareaProps };
@@ -1 +0,0 @@
1
-
@@ -1,14 +0,0 @@
1
- import { AutosuggestionsBareFunction } from '../../types/base/autosuggestions-bare-function.js';
2
- import { AutosuggestionState } from '../../types/base/autosuggestion-state.js';
3
- import { EditorAutocompleteState } from '../../types/base/editor-autocomplete-state.js';
4
- import '@copilotkit/react-core';
5
- import 'slate';
6
-
7
- interface UseAutosuggestionsResult {
8
- currentAutocompleteSuggestion: AutosuggestionState | null;
9
- onChangeHandler: (newEditorState: EditorAutocompleteState | null) => void;
10
- onKeyDownHandler: (event: React.KeyboardEvent<HTMLDivElement>) => void;
11
- }
12
- declare function useAutosuggestions(debounceTime: number, acceptAutosuggestionKey: string, autosuggestionFunction: AutosuggestionsBareFunction, insertAutocompleteSuggestion: (suggestion: AutosuggestionState) => void, disableWhenEmpty: boolean, disabled: boolean): UseAutosuggestionsResult;
13
-
14
- export { UseAutosuggestionsResult, useAutosuggestions };
@@ -1,8 +0,0 @@
1
- import { CustomEditor } from '../../types/base/custom-editor.js';
2
- import 'slate';
3
- import 'slate-react';
4
- import 'slate-history';
5
-
6
- declare function useCopilotTextareaEditor(): CustomEditor;
7
-
8
- export { useCopilotTextareaEditor };
@@ -1,7 +0,0 @@
1
- import React__default from 'react';
2
- import { Editor } from 'slate';
3
- import { HTMLCopilotTextAreaElement } from '../../types/html-copilot-textarea-element.js';
4
-
5
- declare function usePopulateCopilotTextareaRef(editor: Editor, ref: React__default.Ref<HTMLCopilotTextAreaElement>): void;
6
-
7
- export { usePopulateCopilotTextareaRef };
@@ -1 +0,0 @@
1
-
@@ -1,22 +0,0 @@
1
- import { AutosuggestionsBareFunction } from '../../types/base/autosuggestions-bare-function.js';
2
- import { SuggestionsApiConfig } from '../../types/autosuggestions-config/suggestions-api-config.js';
3
- import '@copilotkit/react-core';
4
- import '../../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
5
- import '../../types/autosuggestions-config/subtypes/make-system-prompt.js';
6
-
7
- /**
8
- * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
9
- * The function takes in the text before and after the cursor, and an abort signal.
10
- * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.
11
- * The function returns the suggestion from the API response.
12
- *
13
- * @param textareaPurpose - The purpose of the textarea. This is included in the system message.
14
- * @param apiEndpoint - The API endpoint to send the autosuggestion request to.
15
- * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.
16
- * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.
17
- * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) "global" context category.
18
- * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
19
- */
20
- declare function useMakeStandardAutosuggestionFunction(textareaPurpose: string, contextCategories: string[] | undefined, apiConfig: SuggestionsApiConfig): AutosuggestionsBareFunction;
21
-
22
- export { useMakeStandardAutosuggestionFunction };
@@ -1,23 +0,0 @@
1
- import { Generator_InsertionOrEditingSuggestion } from '../../types/base/autosuggestions-bare-function.js';
2
- import { InsertionsApiConfig } from '../../types/autosuggestions-config/insertions-api-config.js';
3
- import { EditingApiConfig } from '../../types/autosuggestions-config/editing-api-config.js';
4
- import '@copilotkit/react-core';
5
- import '../../types/autosuggestions-config/subtypes/make-system-prompt.js';
6
- import '../../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
7
-
8
- /**
9
- * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
10
- * The function takes in the text before and after the cursor, and an abort signal.
11
- * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.
12
- * The function returns the suggestion from the API response.
13
- *
14
- * @param textareaPurpose - The purpose of the textarea. This is included in the system message.
15
- * @param apiEndpoint - The API endpoint to send the autosuggestion request to.
16
- * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.
17
- * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.
18
- * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) "global" context category.
19
- * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
20
- */
21
- declare function useMakeStandardInsertionOrEditingFunction(textareaPurpose: string, contextCategories: string[] | undefined, insertionApiConfig: InsertionsApiConfig, editingApiConfig: EditingApiConfig): Generator_InsertionOrEditingSuggestion;
22
-
23
- export { useMakeStandardInsertionOrEditingFunction };
@@ -1,5 +0,0 @@
1
- import { RefObject } from 'react';
2
-
3
- declare const useAutosizeTextArea: (textAreaRef: RefObject<HTMLTextAreaElement>, value: string) => void;
4
-
5
- export { useAutosizeTextArea as default };
package/dist/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export { BaseCopilotTextarea } from './components/base-copilot-textarea/base-copilot-textarea.js';
2
- export { CopilotTextarea, CopilotTextareaProps } from './components/copilot-textarea/copilot-textarea.js';
3
- export { BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig } from './types/base/base-autosuggestions-config.js';
4
- export { AutosuggestionsBareFunction } from './types/base/autosuggestions-bare-function.js';
5
- export { BaseCopilotTextareaProps } from './types/base/base-copilot-textarea-props.js';
6
- export { HTMLCopilotTextAreaElement } from './types/html-copilot-textarea-element.js';
7
- export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './types/autosuggestions-config/autosuggestions-config.js';
8
- export { MinimalChatGPTMessage } from './types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
9
- export { MakeSystemPrompt } from './types/autosuggestions-config/subtypes/make-system-prompt.js';
10
- export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './types/autosuggestions-config/subtypes/chatlike-api-endpoint.js';
11
- export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './types/autosuggestions-config/autosuggestions-config-user-specified.js';
12
- import 'react';
13
- import '@copilotkit/react-core';
14
- import './types/autosuggestions-config/suggestions-api-config.js';
15
- import './types/autosuggestions-config/insertions-api-config.js';
16
- import './types/autosuggestions-config/editing-api-config.js';
@@ -1,11 +0,0 @@
1
- type AsyncFunction<T extends any[]> = (...args: [...T, AbortSignal]) => Promise<void>;
2
- declare class Debouncer<T extends any[]> {
3
- private wait;
4
- private timeoutId?;
5
- private activeAbortController?;
6
- constructor(wait: number);
7
- debounce: (func: AsyncFunction<T>, ...args: T) => Promise<void>;
8
- cancel: () => void;
9
- }
10
-
11
- export { AsyncFunction, Debouncer };
@@ -1,7 +0,0 @@
1
- import { BaseEditor } from 'slate';
2
- import { HistoryEditor } from 'slate-history';
3
- import { ReactEditor } from 'slate-react';
4
-
5
- declare const editorToText: (editor: BaseEditor & ReactEditor & HistoryEditor) => string;
6
-
7
- export { editorToText };
@@ -1,15 +0,0 @@
1
- import { BaseRange, Editor, Range } from 'slate';
2
- import { EditorAutocompleteState } from '../types/base/editor-autocomplete-state.js';
3
-
4
- interface EditorTextState {
5
- selection: BaseRange;
6
- textBeforeCursor: string;
7
- selectedText: string;
8
- textAfterCursor: string;
9
- }
10
- declare function getTextAroundCollapsedCursor(editor: Editor): EditorAutocompleteState | null;
11
- declare function getTextAroundSelection(editor: Editor): EditorTextState | null;
12
- declare function getFullEditorTextWithNewlines(editor: Editor): string;
13
- declare function extractTextWithNewlines(editor: Editor, range: Range): string;
14
-
15
- export { EditorTextState, extractTextWithNewlines, getFullEditorTextWithNewlines, getTextAroundCollapsedCursor, getTextAroundSelection };
@@ -1,3 +0,0 @@
1
- declare function retry<T>(fn: () => Promise<T>, retriesLeft?: number, interval?: number, backoff?: number): Promise<T>;
2
-
3
- export { retry };
@@ -1,8 +0,0 @@
1
- import { BasePoint } from 'slate';
2
- import { CustomEditor } from '../../types/base/custom-editor.js';
3
- import 'slate-react';
4
- import 'slate-history';
5
-
6
- declare function addAutocompletionsToEditor(editor: CustomEditor, newSuggestion: string, point: BasePoint): void;
7
-
8
- export { addAutocompletionsToEditor };
@@ -1,8 +0,0 @@
1
- import { CustomEditor } from '../../types/base/custom-editor.js';
2
- import 'slate';
3
- import 'slate-react';
4
- import 'slate-history';
5
-
6
- declare function clearAutocompletionsFromEditor(editor: CustomEditor): void;
7
-
8
- export { clearAutocompletionsFromEditor };
@@ -1,5 +0,0 @@
1
- import { Editor } from 'slate';
2
-
3
- declare function replaceEditorText(editor: Editor, newText: string): void;
4
-
5
- export { replaceEditorText };
@@ -1,10 +0,0 @@
1
- import { CustomEditor } from '../../types/base/custom-editor.js';
2
- import { Operation } from 'slate';
3
- import { HistoryEditor } from 'slate-history';
4
- import 'slate-react';
5
-
6
- type ShouldSaveToHistory = (op: Operation, prev: Operation | undefined) => boolean;
7
- declare const withPartialHistory: <T extends CustomEditor>(editor: T, shouldSave: ShouldSaveToHistory) => T & HistoryEditor;
8
- declare const defaultShouldSave: (op: Operation, prev: Operation | undefined) => boolean;
9
-
10
- export { ShouldSaveToHistory, defaultShouldSave, withPartialHistory };
@@ -1,12 +0,0 @@
1
- /**
2
- * Flatten a promise of a stream, into a stream.
3
- *
4
- * Useful because a stream already includes the notion of async value delivery,
5
- * so it often makes sense to simply await the values rather than the generator of the values.
6
- *
7
- * @param {Promise<ReadableStream<A>>} promise - The promise to flatten.
8
- * @returns {ReadableStream<A>} - The flattened stream.
9
- */
10
- declare function streamPromiseFlatten<A>(promise: Promise<ReadableStream<A>>): ReadableStream<A>;
11
-
12
- export { streamPromiseFlatten };
@@ -1,10 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
-
3
- declare function cn(...inputs: ClassValue[]): string;
4
- declare const nanoid: (size?: number | undefined) => string;
5
- declare function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON>;
6
- declare function formatDate(input: string | number | Date): string;
7
- declare const arraysAreEqual: (arr1: number[], arr2: number[]) => boolean;
8
- declare function nullableCompatibleEqualityCheck<T>(naiveEqualityCheck: (a: T, b: T) => boolean, a: T | null | undefined, b: T | null | undefined): boolean;
9
-
10
- export { arraysAreEqual, cn, fetcher, formatDate, nanoid, nullableCompatibleEqualityCheck };
@@ -1 +0,0 @@
1
-
@@ -1,23 +0,0 @@
1
- import { AutosuggestionsConfig } from './autosuggestions-config.js';
2
- import { InsertionsApiConfig } from './insertions-api-config.js';
3
- import { SuggestionsApiConfig } from './suggestions-api-config.js';
4
- import '../base/base-autosuggestions-config.js';
5
- import '../base/autosuggestions-bare-function.js';
6
- import '@copilotkit/react-core';
7
- import './editing-api-config.js';
8
- import './subtypes/make-system-prompt.js';
9
- import './subtypes/minimal-chat-gpt-message.js';
10
-
11
- interface SuggestionsApiConfigUserSpecified extends Partial<SuggestionsApiConfig> {
12
- }
13
- interface InsertionsApiConfigUserSpecified extends Partial<InsertionsApiConfig> {
14
- }
15
- interface AutosuggestionsConfigUserSpecified extends Partial<Omit<AutosuggestionsConfig, "chatApiConfigs" | "textareaPurpose">> {
16
- textareaPurpose: string;
17
- chatApiConfigs: {
18
- suggestionsApiConfig?: SuggestionsApiConfigUserSpecified;
19
- insertionApiConfig?: InsertionsApiConfigUserSpecified;
20
- };
21
- }
22
-
23
- export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified };
@@ -1,20 +0,0 @@
1
- import { BaseAutosuggestionsConfig } from '../base/base-autosuggestions-config.js';
2
- import { SuggestionsApiConfig } from './suggestions-api-config.js';
3
- import { InsertionsApiConfig } from './insertions-api-config.js';
4
- import { EditingApiConfig } from './editing-api-config.js';
5
- import '../base/autosuggestions-bare-function.js';
6
- import '@copilotkit/react-core';
7
- import './subtypes/minimal-chat-gpt-message.js';
8
- import './subtypes/make-system-prompt.js';
9
-
10
- interface AutosuggestionsConfig extends Omit<BaseAutosuggestionsConfig, "apiConfig"> {
11
- externalContextCategories: string[] | undefined;
12
- chatApiConfigs: {
13
- suggestionsApiConfig: SuggestionsApiConfig;
14
- insertionApiConfig: InsertionsApiConfig;
15
- editingApiConfig: EditingApiConfig;
16
- };
17
- }
18
- declare const defaultAutosuggestionsConfig: Omit<AutosuggestionsConfig, "textareaPurpose" | "apiEndpoint">;
19
-
20
- export { AutosuggestionsConfig, defaultAutosuggestionsConfig };
@@ -1,15 +0,0 @@
1
- import { MakeSystemPrompt } from './subtypes/make-system-prompt.js';
2
- import { MinimalChatGPTMessage } from './subtypes/minimal-chat-gpt-message.js';
3
-
4
- interface EditingApiConfig {
5
- makeSystemPrompt: MakeSystemPrompt;
6
- fewShotMessages: MinimalChatGPTMessage[];
7
- forwardedParams: {
8
- [key: string]: any;
9
- } | undefined;
10
- }
11
- declare const defaultEditingMakeSystemPrompt: MakeSystemPrompt;
12
- declare const defaultEditingFewShotMessages: MinimalChatGPTMessage[];
13
- declare const defaultEditingApiConfig: EditingApiConfig;
14
-
15
- export { EditingApiConfig, defaultEditingApiConfig, defaultEditingFewShotMessages, defaultEditingMakeSystemPrompt };
@@ -1,11 +0,0 @@
1
- export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './autosuggestions-config.js';
2
- export { MinimalChatGPTMessage } from './subtypes/minimal-chat-gpt-message.js';
3
- export { MakeSystemPrompt } from './subtypes/make-system-prompt.js';
4
- export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './subtypes/chatlike-api-endpoint.js';
5
- export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './autosuggestions-config-user-specified.js';
6
- import '../base/base-autosuggestions-config.js';
7
- import '../base/autosuggestions-bare-function.js';
8
- import '@copilotkit/react-core';
9
- import './suggestions-api-config.js';
10
- import './insertions-api-config.js';
11
- import './editing-api-config.js';
@@ -1,15 +0,0 @@
1
- import { MakeSystemPrompt } from './subtypes/make-system-prompt.js';
2
- import { MinimalChatGPTMessage } from './subtypes/minimal-chat-gpt-message.js';
3
-
4
- interface InsertionsApiConfig {
5
- makeSystemPrompt: MakeSystemPrompt;
6
- fewShotMessages: MinimalChatGPTMessage[];
7
- forwardedParams: {
8
- [key: string]: any;
9
- } | undefined;
10
- }
11
- declare const defaultInsertionsMakeSystemPrompt: MakeSystemPrompt;
12
- declare const defaultInsertionsFewShotMessages: MinimalChatGPTMessage[];
13
- declare const defaultInsertionsApiConfig: InsertionsApiConfig;
14
-
15
- export { InsertionsApiConfig, defaultInsertionsApiConfig, defaultInsertionsFewShotMessages, defaultInsertionsMakeSystemPrompt };
@@ -1,27 +0,0 @@
1
- import { CopilotApiConfig } from '@copilotkit/react-core';
2
- import { MinimalChatGPTMessage } from './minimal-chat-gpt-message.js';
3
-
4
- type ChatlikeApiEndpointImpl = (abortSignal: AbortSignal, messages: MinimalChatGPTMessage[], forwardedProps?: {
5
- [key: string]: any;
6
- }) => Promise<string>;
7
- type StreamingChatlikeApiEndpointImpl = (abortSignal: AbortSignal, messages: MinimalChatGPTMessage[], forwardedProps?: {
8
- [key: string]: any;
9
- }) => Promise<ReadableStream<string>>;
10
- declare class ChatlikeApiEndpoint {
11
- run: StreamingChatlikeApiEndpointImpl;
12
- constructor(run: StreamingChatlikeApiEndpointImpl);
13
- /**
14
- * Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.
15
- * @param apiEndpoint The URL of the OpenAI-compatible API endpoint.
16
- * @returns A new instance of ChatlikeApiEndpoint.
17
- */
18
- static fromCopilotApiConfig(copilotApiConfig: CopilotApiConfig): ChatlikeApiEndpoint;
19
- /**
20
- * Creates a fully customized instance of ChatlikeApiEndpoint.
21
- * @param run - The implementation of the ChatlikeApiEndpointImpl interface.
22
- * @returns A new instance of ChatlikeApiEndpoint .
23
- */
24
- static custom(run: StreamingChatlikeApiEndpointImpl): ChatlikeApiEndpoint;
25
- }
26
-
27
- export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl, StreamingChatlikeApiEndpointImpl };
@@ -1,3 +0,0 @@
1
- type MakeSystemPrompt = (textareaPurpose: string, contextString: string) => string;
2
-
3
- export { MakeSystemPrompt };