@copilotkit/react-textarea 0.19.0-alpha.7 → 0.19.0-alpha.9
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/.turbo/turbo-build.log +180 -178
- package/CHANGELOG.md +22 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +1734 -33
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +52 -3
- package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +46 -3
- package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +86 -4
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +57 -3
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +2202 -45
- package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +22 -3
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +125 -3
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +1 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +877 -16
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +6 -9
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +577 -10
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +592 -11
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +592 -12
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
- package/dist/components/index.mjs +2203 -46
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +5 -6
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
- package/dist/components/source-search-box/source-search-box.d.ts +5 -8
- package/dist/components/source-search-box/source-search-box.mjs +209 -10
- package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
- package/dist/components/ui/button.mjs +88 -4
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/card.mjs +53 -7
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/command.mjs +266 -5
- package/dist/components/ui/command.mjs.map +1 -1
- package/dist/components/ui/dialog.mjs +164 -4
- package/dist/components/ui/dialog.mjs.map +1 -1
- package/dist/components/ui/label.mjs +63 -4
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/separator.mjs +50 -8
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/textarea.mjs +48 -7
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/context/index.mjs +0 -2
- package/dist/context/index.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +168 -6
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +168 -4
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +155 -5
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
- package/dist/hooks/index.mjs +0 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +145 -14
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +199 -14
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
- package/dist/hooks/misc/use-autosize-textarea.mjs +15 -3
- package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
- package/dist/index.css +4 -18
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +2206 -48
- package/dist/index.mjs.map +1 -1
- package/dist/lib/debouncer.mjs +51 -3
- package/dist/lib/debouncer.mjs.map +1 -1
- package/dist/lib/editor-to-text.mjs +43 -3
- package/dist/lib/editor-to-text.mjs.map +1 -1
- package/dist/lib/get-text-around-cursor.mjs +109 -3
- package/dist/lib/get-text-around-cursor.mjs.map +1 -1
- package/dist/lib/retry.mjs +17 -3
- package/dist/lib/retry.mjs.map +1 -1
- package/dist/lib/slatejs-edits/add-autocompletions.mjs +25 -3
- package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +23 -3
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/replace-text.mjs +27 -3
- package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.mjs +106 -3
- package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
- package/dist/lib/stream-promise-flatten.mjs +47 -3
- package/dist/lib/stream-promise-flatten.mjs.map +1 -1
- package/dist/lib/utils.mjs +71 -3
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.mjs +0 -1
- package/dist/lib/utils.test.mjs.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +0 -2
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +254 -8
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +83 -3
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +310 -10
- package/dist/types/autosuggestions-config/index.mjs.map +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +77 -3
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +77 -3
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +0 -2
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs +0 -2
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs +64 -3
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
- package/dist/types/base/autosuggestion-state.mjs +0 -2
- package/dist/types/base/autosuggestion-state.mjs.map +1 -1
- package/dist/types/base/autosuggestions-bare-function.mjs +0 -2
- package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -1
- package/dist/types/base/base-autosuggestions-config.d.ts +1 -0
- package/dist/types/base/base-autosuggestions-config.mjs +12 -3
- package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
- package/dist/types/base/base-copilot-textarea-props.mjs +0 -2
- package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -1
- package/dist/types/base/custom-editor.mjs +0 -2
- package/dist/types/base/custom-editor.mjs.map +1 -1
- package/dist/types/base/editor-autocomplete-state.mjs +17 -4
- package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
- package/dist/types/base/index.mjs +12 -4
- package/dist/types/base/index.mjs.map +1 -1
- package/dist/types/html-copilot-textarea-element.mjs +0 -2
- package/dist/types/html-copilot-textarea-element.mjs.map +1 -1
- package/dist/types/index.mjs +311 -12
- package/dist/types/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +4 -1
- package/src/components/hovering-toolbar/hovering-toolbar.tsx +2 -0
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +26 -152
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx +2 -0
- package/src/components/source-search-box/source-search-box.tsx +13 -17
- package/src/types/base/base-autosuggestions-config.tsx +2 -0
- package/dist/chunk-2NURR2DX.mjs +0 -47
- package/dist/chunk-2NURR2DX.mjs.map +0 -1
- package/dist/chunk-2TQBFDO7.mjs +0 -19
- package/dist/chunk-2TQBFDO7.mjs.map +0 -1
- package/dist/chunk-4S5ZJH3I.mjs +0 -18
- package/dist/chunk-4S5ZJH3I.mjs.map +0 -1
- package/dist/chunk-5EJ5XOGP.mjs +0 -22
- package/dist/chunk-5EJ5XOGP.mjs.map +0 -1
- package/dist/chunk-5FO6ISW4.mjs +0 -3
- package/dist/chunk-5FO6ISW4.mjs.map +0 -1
- package/dist/chunk-66BDXIX4.mjs +0 -76
- package/dist/chunk-66BDXIX4.mjs.map +0 -1
- package/dist/chunk-7XKICWEE.mjs +0 -44
- package/dist/chunk-7XKICWEE.mjs.map +0 -1
- package/dist/chunk-CSGFJU3L.mjs +0 -65
- package/dist/chunk-CSGFJU3L.mjs.map +0 -1
- package/dist/chunk-D7SEV5PR.mjs +0 -12
- package/dist/chunk-D7SEV5PR.mjs.map +0 -1
- package/dist/chunk-DE5K76I2.mjs +0 -3
- package/dist/chunk-DE5K76I2.mjs.map +0 -1
- package/dist/chunk-F3MHL6ZY.mjs +0 -25
- package/dist/chunk-F3MHL6ZY.mjs.map +0 -1
- package/dist/chunk-FN7GDKKG.mjs +0 -29
- package/dist/chunk-FN7GDKKG.mjs.map +0 -1
- package/dist/chunk-H4VKQGVU.mjs +0 -3
- package/dist/chunk-H4VKQGVU.mjs.map +0 -1
- package/dist/chunk-HRTFMM7P.mjs +0 -82
- package/dist/chunk-HRTFMM7P.mjs.map +0 -1
- package/dist/chunk-IU3WTXLQ.mjs +0 -3
- package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
- package/dist/chunk-IXJ2HCOA.mjs +0 -101
- package/dist/chunk-IXJ2HCOA.mjs.map +0 -1
- package/dist/chunk-JAFCXEPU.mjs +0 -10
- package/dist/chunk-JAFCXEPU.mjs.map +0 -1
- package/dist/chunk-JHTAOLEW.mjs +0 -63
- package/dist/chunk-JHTAOLEW.mjs.map +0 -1
- package/dist/chunk-K2AVA67P.mjs +0 -57
- package/dist/chunk-K2AVA67P.mjs.map +0 -1
- package/dist/chunk-KCHYD3EB.mjs +0 -107
- package/dist/chunk-KCHYD3EB.mjs.map +0 -1
- package/dist/chunk-KGKLUWKW.mjs +0 -47
- package/dist/chunk-KGKLUWKW.mjs.map +0 -1
- package/dist/chunk-KIRROE2K.mjs +0 -37
- package/dist/chunk-KIRROE2K.mjs.map +0 -1
- package/dist/chunk-L7VVZH4Q.mjs +0 -3
- package/dist/chunk-L7VVZH4Q.mjs.map +0 -1
- package/dist/chunk-LNAIMEB2.mjs +0 -34
- package/dist/chunk-LNAIMEB2.mjs.map +0 -1
- package/dist/chunk-MMVDU6DF.mjs +0 -3
- package/dist/chunk-MMVDU6DF.mjs.map +0 -1
- package/dist/chunk-MPME5BW2.mjs +0 -59
- package/dist/chunk-MPME5BW2.mjs.map +0 -1
- package/dist/chunk-MRXNTQOX.mjs +0 -55
- package/dist/chunk-MRXNTQOX.mjs.map +0 -1
- package/dist/chunk-ND5PXTAW.mjs +0 -17
- package/dist/chunk-ND5PXTAW.mjs.map +0 -1
- package/dist/chunk-NKA6K7FW.mjs +0 -201
- package/dist/chunk-NKA6K7FW.mjs.map +0 -1
- package/dist/chunk-NKW5OU2S.mjs +0 -33
- package/dist/chunk-NKW5OU2S.mjs.map +0 -1
- package/dist/chunk-O5OWT5GE.mjs +0 -114
- package/dist/chunk-O5OWT5GE.mjs.map +0 -1
- package/dist/chunk-OD7ZMOVE.mjs +0 -45
- package/dist/chunk-OD7ZMOVE.mjs.map +0 -1
- package/dist/chunk-OELUUJZY.mjs +0 -16
- package/dist/chunk-OELUUJZY.mjs.map +0 -1
- package/dist/chunk-OXPXFYUG.mjs +0 -111
- package/dist/chunk-OXPXFYUG.mjs.map +0 -1
- package/dist/chunk-RQHOUUXQ.mjs +0 -29
- package/dist/chunk-RQHOUUXQ.mjs.map +0 -1
- package/dist/chunk-U5AJ5PBH.mjs +0 -107
- package/dist/chunk-U5AJ5PBH.mjs.map +0 -1
- package/dist/chunk-UHD44NC5.mjs +0 -101
- package/dist/chunk-UHD44NC5.mjs.map +0 -1
- package/dist/chunk-WADHCMPK.mjs +0 -3
- package/dist/chunk-WADHCMPK.mjs.map +0 -1
- package/dist/chunk-WJHSY5T6.mjs +0 -3
- package/dist/chunk-WJHSY5T6.mjs.map +0 -1
- package/dist/chunk-WJYQWL4I.mjs +0 -27
- package/dist/chunk-WJYQWL4I.mjs.map +0 -1
- package/dist/chunk-XA7M72ZO.mjs +0 -106
- package/dist/chunk-XA7M72ZO.mjs.map +0 -1
- package/dist/chunk-XHUMROEY.mjs +0 -91
- package/dist/chunk-XHUMROEY.mjs.map +0 -1
- package/dist/chunk-XYXKONR4.mjs +0 -501
- package/dist/chunk-XYXKONR4.mjs.map +0 -1
- package/dist/chunk-YQU7WG7T.mjs +0 -83
- package/dist/chunk-YQU7WG7T.mjs.map +0 -1
- package/dist/chunk-YTOPHPSG.mjs +0 -45
- package/dist/chunk-YTOPHPSG.mjs.map +0 -1
- package/dist/chunk-YW3REYX6.mjs +0 -23
- package/dist/chunk-YW3REYX6.mjs.map +0 -1
- package/dist/chunk-ZA3R6NZI.mjs +0 -20
- package/dist/chunk-ZA3R6NZI.mjs.map +0 -1
|
@@ -4,17 +4,16 @@ import {
|
|
|
4
4
|
EditingEditorState,
|
|
5
5
|
Generator_InsertionOrEditingSuggestion,
|
|
6
6
|
} from "../../../types/base/autosuggestions-bare-function";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
SourceSearchBox,
|
|
10
|
-
} from "../../source-search-box/source-search-box";
|
|
7
|
+
import { SourceSearchBox } from "../../source-search-box/source-search-box";
|
|
8
|
+
import { DocumentPointer } from "@copilotkit/react-core";
|
|
11
9
|
import { Button } from "../../ui/button";
|
|
12
10
|
import { Label } from "../../ui/label";
|
|
13
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
11
|
+
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
14
12
|
|
|
15
13
|
import Chip from "@mui/material/Chip";
|
|
16
14
|
import Avatar from "@mui/material/Avatar";
|
|
17
15
|
import { streamPromiseFlatten } from "../../../lib/stream-promise-flatten";
|
|
16
|
+
import { CopilotContext } from "@copilotkit/react-core";
|
|
18
17
|
|
|
19
18
|
export type SuggestionState = {
|
|
20
19
|
editorState: EditingEditorState;
|
|
@@ -24,11 +23,19 @@ export interface HoveringInsertionPromptBoxCoreProps {
|
|
|
24
23
|
state: SuggestionState;
|
|
25
24
|
performInsertion: (insertedText: string) => void;
|
|
26
25
|
insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;
|
|
26
|
+
contextCategories: string[];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const HoveringInsertionPromptBoxCore: React.FC<
|
|
30
30
|
HoveringInsertionPromptBoxCoreProps
|
|
31
|
-
> = ({
|
|
31
|
+
> = ({
|
|
32
|
+
performInsertion,
|
|
33
|
+
state,
|
|
34
|
+
insertionOrEditingFunction,
|
|
35
|
+
contextCategories,
|
|
36
|
+
}) => {
|
|
37
|
+
const { getDocumentsContext } = useContext(CopilotContext);
|
|
38
|
+
|
|
32
39
|
const [editSuggestion, setEditSuggestion] = useState<string>("");
|
|
33
40
|
const [suggestionIsLoading, setSuggestionIsLoading] =
|
|
34
41
|
useState<boolean>(false);
|
|
@@ -41,7 +48,12 @@ export const HoveringInsertionPromptBoxCore: React.FC<
|
|
|
41
48
|
const adjustmentTextAreaRef = useRef<HTMLTextAreaElement>(null);
|
|
42
49
|
const suggestionTextAreaRef = useRef<HTMLTextAreaElement>(null);
|
|
43
50
|
|
|
44
|
-
const [filePointers, setFilePointers] = useState<
|
|
51
|
+
const [filePointers, setFilePointers] = useState<DocumentPointer[]>([]);
|
|
52
|
+
|
|
53
|
+
const [suggestedFiles, setSuggestedFiles] = useState<DocumentPointer[]>([]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
setSuggestedFiles(getDocumentsContext(contextCategories));
|
|
56
|
+
}, [contextCategories, getDocumentsContext]);
|
|
45
57
|
|
|
46
58
|
useAutosizeTextArea(suggestionTextAreaRef, editSuggestion || "");
|
|
47
59
|
useAutosizeTextArea(adjustmentTextAreaRef, adjustmentPrompt || "");
|
|
@@ -51,6 +63,7 @@ export const HoveringInsertionPromptBoxCore: React.FC<
|
|
|
51
63
|
adjustmentTextAreaRef.current?.focus();
|
|
52
64
|
}, []);
|
|
53
65
|
|
|
66
|
+
// continuously read the generating suggestion stream and update the edit suggestion
|
|
54
67
|
useEffect(() => {
|
|
55
68
|
// if no generating suggestion, do nothing
|
|
56
69
|
if (!generatingSuggestion) {
|
|
@@ -104,6 +117,7 @@ export const HoveringInsertionPromptBoxCore: React.FC<
|
|
|
104
117
|
};
|
|
105
118
|
}, [generatingSuggestion]);
|
|
106
119
|
|
|
120
|
+
// when the adjustment prompt changes, reset the edit suggestion
|
|
107
121
|
const begingGeneratingAdjustment = async () => {
|
|
108
122
|
// don't generate text if the prompt is empty
|
|
109
123
|
if (!adjustmentPrompt.trim()) {
|
|
@@ -235,7 +249,7 @@ export const HoveringInsertionPromptBoxCore: React.FC<
|
|
|
235
249
|
{sourceSearchWord !== undefined && (
|
|
236
250
|
<SourceSearchBox
|
|
237
251
|
searchTerm={sourceSearchWord}
|
|
238
|
-
|
|
252
|
+
suggestedFiles={suggestedFiles}
|
|
239
253
|
onSelectedFile={(filePointer) => {
|
|
240
254
|
setAdjustmentPrompt(
|
|
241
255
|
adjustmentPrompt.replace(new RegExp(`@${sourceSearchWord}$`), "")
|
|
@@ -254,8 +268,8 @@ export const HoveringInsertionPromptBoxCore: React.FC<
|
|
|
254
268
|
};
|
|
255
269
|
|
|
256
270
|
interface IncludedFilesPreviewProps {
|
|
257
|
-
includedFiles:
|
|
258
|
-
setIncludedFiles: React.Dispatch<React.SetStateAction<
|
|
271
|
+
includedFiles: DocumentPointer[];
|
|
272
|
+
setIncludedFiles: React.Dispatch<React.SetStateAction<DocumentPointer[]>>;
|
|
259
273
|
}
|
|
260
274
|
|
|
261
275
|
export const IncludedFilesPreview: React.FC<IncludedFilesPreviewProps> = ({
|
|
@@ -285,7 +299,7 @@ export const IncludedFilesPreview: React.FC<IncludedFilesPreviewProps> = ({
|
|
|
285
299
|
};
|
|
286
300
|
|
|
287
301
|
export interface FileChipPreviewProp {
|
|
288
|
-
filePointer:
|
|
302
|
+
filePointer: DocumentPointer;
|
|
289
303
|
onDelete: () => void;
|
|
290
304
|
}
|
|
291
305
|
|
|
@@ -297,147 +311,7 @@ export const FileChipPreview: React.FC<FileChipPreviewProp> = ({
|
|
|
297
311
|
<Chip
|
|
298
312
|
label={filePointer.name}
|
|
299
313
|
onDelete={onDelete}
|
|
300
|
-
avatar={
|
|
301
|
-
<Avatar sx={{ backgroundColor: "transparent" }}>
|
|
302
|
-
<IconForFilePointer
|
|
303
|
-
filePointer={filePointer}
|
|
304
|
-
className="w-4 h-1 object-contain"
|
|
305
|
-
/>
|
|
306
|
-
</Avatar>
|
|
307
|
-
}
|
|
314
|
+
avatar={<Avatar sx={{ backgroundColor: "transparent" }}></Avatar>}
|
|
308
315
|
/>
|
|
309
316
|
);
|
|
310
317
|
};
|
|
311
|
-
|
|
312
|
-
export function IconForFilePointer({
|
|
313
|
-
filePointer,
|
|
314
|
-
className,
|
|
315
|
-
}: {
|
|
316
|
-
filePointer: FilePointer;
|
|
317
|
-
className: string;
|
|
318
|
-
}): JSX.Element {
|
|
319
|
-
if (filePointer.sourceApplication === "Salesforce") {
|
|
320
|
-
return <IconSalesforce className={className} />;
|
|
321
|
-
} else if (filePointer.sourceApplication === "GoogleDocs") {
|
|
322
|
-
return <IconGoogleDocs className={className} />;
|
|
323
|
-
} else {
|
|
324
|
-
return <IconSalesforce className={className} />;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function IconSalesforce({ className, ...props }: React.ComponentProps<"svg">) {
|
|
329
|
-
return (
|
|
330
|
-
<svg
|
|
331
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
332
|
-
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
333
|
-
preserveAspectRatio="xMidYMid meet"
|
|
334
|
-
viewBox="0 0 273 191"
|
|
335
|
-
{...props}
|
|
336
|
-
>
|
|
337
|
-
<title>{"Salesforce.com logo"}</title>
|
|
338
|
-
<defs>
|
|
339
|
-
<path id="a" d="M.06.5h272v190H.06z" />
|
|
340
|
-
</defs>
|
|
341
|
-
<g fillRule="evenodd">
|
|
342
|
-
<mask id="b" fill="#fff">
|
|
343
|
-
<use xlinkHref="#a" />
|
|
344
|
-
</mask>
|
|
345
|
-
<path
|
|
346
|
-
fill="#00A1E0"
|
|
347
|
-
d="M113 21.3c8.78-9.14 21-14.8 34.5-14.8 18 0 33.6 10 42 24.9a58 58 0 0 1 23.7-5.05c32.4 0 58.7 26.5 58.7 59.2s-26.3 59.2-58.7 59.2c-3.96 0-7.82-.398-11.6-1.15-7.35 13.1-21.4 22-37.4 22a42.7 42.7 0 0 1-18.8-4.32c-7.45 17.5-24.8 29.8-45 29.8-21.1 0-39-13.3-45.9-32a45.1 45.1 0 0 1-9.34.972c-25.1 0-45.4-20.6-45.4-45.9 0-17 9.14-31.8 22.7-39.8a52.6 52.6 0 0 1-4.35-21c0-29.2 23.7-52.8 52.9-52.8 17.1 0 32.4 8.15 42 20.8"
|
|
348
|
-
mask="url(#b)"
|
|
349
|
-
/>
|
|
350
|
-
<path
|
|
351
|
-
fill="#FFFFFE"
|
|
352
|
-
d="M39.4 99.3c-.171.446.061.539.116.618.511.37 1.03.638 1.55.939 2.78 1.47 5.4 1.9 8.14 1.9 5.58 0 9.05-2.97 9.05-7.75v-.094c0-4.42-3.92-6.03-7.58-7.18l-.479-.155c-2.77-.898-5.16-1.68-5.16-3.5v-.093c0-1.56 1.4-2.71 3.56-2.71 2.4 0 5.26.799 7.09 1.81 0 0 .542.35.739-.173.107-.283 1.04-2.78 1.14-3.06.106-.293-.08-.514-.271-.628-2.1-1.28-5-2.15-8-2.15l-.557.002c-5.11 0-8.68 3.09-8.68 7.51v.095c0 4.66 3.94 6.18 7.62 7.23l.592.184c2.68.824 5 1.54 5 3.42v.094c0 1.73-1.51 3.02-3.93 3.02-.941 0-3.94-.016-7.19-2.07-.393-.229-.617-.394-.92-.579-.16-.097-.56-.272-.734.252l-1.1 3.06m81.7 0c-.171.446.061.539.118.618.509.37 1.03.638 1.55.939 2.78 1.47 5.4 1.9 8.14 1.9 5.58 0 9.05-2.97 9.05-7.75v-.094c0-4.42-3.91-6.03-7.58-7.18l-.479-.155c-2.77-.898-5.16-1.68-5.16-3.5v-.093c0-1.56 1.4-2.71 3.56-2.71 2.4 0 5.25.799 7.09 1.81 0 0 .542.35.74-.173.106-.283 1.04-2.78 1.13-3.06.107-.293-.08-.514-.27-.628-2.1-1.28-5-2.15-8-2.15l-.558.002c-5.11 0-8.68 3.09-8.68 7.51v.095c0 4.66 3.94 6.18 7.62 7.23l.591.184c2.69.824 5 1.54 5 3.42v.094c0 1.73-1.51 3.02-3.93 3.02-.943 0-3.95-.016-7.19-2.07-.393-.229-.623-.387-.921-.579-.101-.064-.572-.248-.733.252l-1.1 3.06m55.8-9.36c0 2.7-.504 4.83-1.49 6.34-.984 1.49-2.47 2.22-4.54 2.22s-3.55-.724-4.52-2.21c-.977-1.5-1.47-3.64-1.47-6.34 0-2.7.496-4.82 1.47-6.31.968-1.48 2.44-2.19 4.52-2.19s3.56.717 4.54 2.19c.992 1.49 1.49 3.61 1.49 6.31m4.66-5.01c-.459-1.55-1.17-2.91-2.12-4.05a10.151 10.151 0 0 0-3.58-2.72c-1.42-.665-3.1-1-5-1s-3.57.337-5 1c-1.42.664-2.63 1.58-3.58 2.72-.948 1.14-1.66 2.5-2.12 4.05-.455 1.54-.686 3.22-.686 5.01 0 1.79.231 3.47.686 5.01.457 1.55 1.17 2.91 2.12 4.05.951 1.14 2.16 2.05 3.58 2.7 1.43.648 3.11.978 5 .978 1.89 0 3.57-.33 4.99-.978 1.42-.648 2.63-1.56 3.58-2.7.949-1.14 1.66-2.5 2.12-4.05.454-1.54.685-3.22.685-5.01 0-1.78-.231-3.47-.685-5.01m38.3 12.8c-.153-.453-.595-.282-.595-.282-.677.259-1.4.499-2.17.619-.776.122-1.64.183-2.55.183-2.25 0-4.05-.671-5.33-2-1.29-1.33-2.01-3.47-2-6.37.007-2.64.645-4.62 1.79-6.14 1.13-1.5 2.87-2.28 5.17-2.28 1.92 0 3.39.223 4.93.705 0 0 .365.159.54-.322.409-1.13.711-1.94 1.15-3.18.124-.355-.18-.505-.291-.548-.604-.236-2.03-.623-3.11-.786-1.01-.154-2.18-.234-3.5-.234-1.96 0-3.7.335-5.19.999-1.49.663-2.75 1.58-3.75 2.72-1 1.14-1.76 2.5-2.27 4.05-.505 1.54-.76 3.23-.76 5.02 0 3.86 1.04 6.99 3.1 9.28 2.06 2.3 5.16 3.46 9.2 3.46 2.39 0 4.84-.483 6.6-1.18 0 0 .336-.162.19-.554l-1.15-3.16m8.15-10.4c.223-1.5.634-2.75 1.28-3.72.967-1.48 2.44-2.29 4.51-2.29s3.44.814 4.42 2.29c.65.975.934 2.27 1.04 3.72l-11.3-.002zm15.7-3.3c-.397-1.49-1.38-3-2.02-3.69-1.02-1.09-2.01-1.86-3-2.28a11.5 11.5 0 0 0-4.52-.917c-1.97 0-3.76.333-5.21 1.01-1.45.682-2.67 1.61-3.63 2.77-.959 1.16-1.68 2.53-2.14 4.1-.46 1.55-.692 3.25-.692 5.03 0 1.82.241 3.51.715 5.04.479 1.54 1.25 2.89 2.29 4.01 1.04 1.13 2.37 2.01 3.97 2.63 1.59.615 3.52.934 5.73.927 4.56-.015 6.96-1.03 7.94-1.58.175-.098.34-.267.134-.754l-1.03-2.89c-.158-.431-.594-.275-.594-.275-1.13.422-2.73 1.18-6.48 1.17-2.45-.004-4.26-.727-5.4-1.86-1.16-1.16-1.74-2.85-1.83-5.25l15.8.012s.416-.004.459-.41c.017-.168.541-3.24-.471-6.79zm-142 3.3c.223-1.5.635-2.75 1.28-3.72.968-1.48 2.44-2.29 4.51-2.29s3.44.814 4.42 2.29c.649.975.933 2.27 1.04 3.72l-11.3-.002zm15.7-3.3c-.396-1.49-1.38-3-2.02-3.69-1.02-1.09-2.01-1.86-3-2.28a11.5 11.5 0 0 0-4.52-.917c-1.97 0-3.76.333-5.21 1.01-1.45.682-2.67 1.61-3.63 2.77-.957 1.16-1.68 2.53-2.14 4.1-.459 1.55-.69 3.25-.69 5.03 0 1.82.239 3.51.716 5.04.478 1.54 1.25 2.89 2.28 4.01 1.04 1.13 2.37 2.01 3.97 2.63 1.59.615 3.51.934 5.73.927 4.56-.015 6.96-1.03 7.94-1.58.174-.098.34-.267.133-.754l-1.03-2.89c-.159-.431-.595-.275-.595-.275-1.13.422-2.73 1.18-6.48 1.17-2.44-.004-4.26-.727-5.4-1.86-1.16-1.16-1.74-2.85-1.83-5.25l15.8.012s.416-.004.459-.41c.017-.168.541-3.24-.472-6.79zm-49.8 13.6c-.619-.494-.705-.615-.91-.936-.313-.483-.473-1.17-.473-2.05 0-1.38.46-2.38 1.41-3.05-.01.002 1.36-1.18 4.58-1.14a32 32 0 0 1 4.28.365v7.17h.002s-2 .431-4.26.567c-3.21.193-4.63-.924-4.62-.921zm6.28-11.1c-.64-.047-1.47-.07-2.46-.07-1.35 0-2.66.168-3.88.498-1.23.332-2.34.846-3.29 1.53a7.63 7.63 0 0 0-2.29 2.6c-.559 1.04-.844 2.26-.844 3.64 0 1.4.243 2.61.723 3.6a6.54 6.54 0 0 0 2.06 2.47c.877.638 1.96 1.11 3.21 1.39 1.24.283 2.64.426 4.18.426 1.62 0 3.23-.136 4.79-.399a95.1 95.1 0 0 0 3.97-.772c.526-.121 1.11-.28 1.11-.28.39-.099.36-.516.36-.516l-.009-14.4c0-3.16-.844-5.51-2.51-6.96-1.66-1.45-4.09-2.18-7.24-2.18-1.18 0-3.09.16-4.23.389 0 0-3.44.668-4.86 1.78 0 0-.312.192-.142.627l1.12 3c.139.389.518.256.518.256s.119-.047.259-.13c3.03-1.65 6.87-1.6 6.87-1.6 1.7 0 3.02.345 3.9 1.02.861.661 1.3 1.66 1.3 3.76v.667c-1.35-.196-2.6-.309-2.6-.309zm127-8.13a.428.428 0 0 0-.237-.568c-.269-.102-1.61-.385-2.64-.449-1.98-.124-3.08.21-4.07.654-.978.441-2.06 1.15-2.66 1.97l-.002-1.92c0-.264-.187-.477-.453-.477h-4.04c-.262 0-.452.213-.452.477v23.5a.48.48 0 0 0 .479.479h4.14a.479.479 0 0 0 .478-.479v-11.8c0-1.58.174-3.15.521-4.14.342-.979.807-1.76 1.38-2.32a4.79 4.79 0 0 1 1.95-1.17 7.68 7.68 0 0 1 2.12-.298c.825 0 1.73.212 1.73.212.304.034.473-.152.576-.426.271-.721 1.04-2.88 1.19-3.31"
|
|
353
|
-
/>
|
|
354
|
-
<path
|
|
355
|
-
fill="#FFFFFE"
|
|
356
|
-
d="M162.201 67.548a13.258 13.258 0 0 0-1.559-.37 12.217 12.217 0 0 0-2.144-.166c-2.853 0-5.102.806-6.681 2.398-1.568 1.58-2.635 3.987-3.17 7.154l-.193 1.069h-3.581s-.437-.018-.529.459l-.588 3.28c-.041.314.094.51.514.508h3.486l-3.537 19.743c-.277 1.59-.594 2.898-.945 3.889-.346.978-.684 1.711-1.1 2.243-.403.515-.785.894-1.444 1.115-.544.183-1.17.267-1.856.267-.382 0-.89-.064-1.265-.139-.375-.074-.57-.158-.851-.276 0 0-.409-.156-.57.254-.131.335-1.06 2.89-1.17 3.206-.112.312.045.558.243.629.464.166.809.272 1.441.421.878.207 1.618.22 2.311.22 1.452 0 2.775-.204 3.872-.6 1.104-.399 2.065-1.094 2.915-2.035.919-1.015 1.497-2.078 2.05-3.528.547-1.437 1.013-3.221 1.386-5.3l3.554-20.109h5.196s.438.016.529-.459l.588-3.28c.041-.314-.093-.51-.515-.508h-5.043c.025-.114.254-1.888.833-3.558.247-.713.712-1.288 1.106-1.683a3.273 3.273 0 0 1 1.321-.822 5.48 5.48 0 0 1 1.693-.244c.475 0 .941.057 1.296.131.489.104.679.159.807.197.514.157.583.005.684-.244l1.206-3.312c.124-.356-.178-.506-.29-.55m-70.474 34.117c0 .264-.188.479-.452.479h-4.183c-.265 0-.453-.215-.453-.479V67.997c0-.263.188-.476.453-.476h4.183c.264 0 .452.213.452.476v33.668"
|
|
357
|
-
/>
|
|
358
|
-
</g>
|
|
359
|
-
</svg>
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function IconGoogleDocs({ className, ...props }: React.ComponentProps<"svg">) {
|
|
364
|
-
return (
|
|
365
|
-
<svg
|
|
366
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
367
|
-
xmlSpace="preserve"
|
|
368
|
-
viewBox="0 0 64 88"
|
|
369
|
-
{...props}
|
|
370
|
-
>
|
|
371
|
-
<path
|
|
372
|
-
d="M58 88H6c-3.3 0-6-2.7-6-6V6c0-3.3 2.7-6 6-6h36l22 22v60c0 3.3-2.7 6-6 6z"
|
|
373
|
-
style={{
|
|
374
|
-
fill: "#3086f6",
|
|
375
|
-
}}
|
|
376
|
-
/>
|
|
377
|
-
<path
|
|
378
|
-
d="m42 0 22 22H42V0z"
|
|
379
|
-
style={{
|
|
380
|
-
fill: "#0c67d6",
|
|
381
|
-
}}
|
|
382
|
-
/>
|
|
383
|
-
<path
|
|
384
|
-
d="M50 39H14v-5h36v5zm0 7H14v5h36v-5zM40 58H14v5h26v-5z"
|
|
385
|
-
style={{
|
|
386
|
-
fill: "#fdffff",
|
|
387
|
-
}}
|
|
388
|
-
/>
|
|
389
|
-
</svg>
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
const mockFiles: FilePointer[] = [
|
|
394
|
-
{
|
|
395
|
-
name: "CopilotTextarea README",
|
|
396
|
-
sourceApplication: "GoogleDocs",
|
|
397
|
-
getContents: async () => {
|
|
398
|
-
return "some contents";
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
name: "prospecting call transcript",
|
|
403
|
-
sourceApplication: "Salesforce",
|
|
404
|
-
getContents: async () => {
|
|
405
|
-
return "some contents";
|
|
406
|
-
},
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
name: "customer feedback",
|
|
410
|
-
sourceApplication: "Zendesk",
|
|
411
|
-
getContents: async () => {
|
|
412
|
-
return "some contents";
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
name: "product specifications",
|
|
417
|
-
sourceApplication: "Google Docs",
|
|
418
|
-
getContents: async () => {
|
|
419
|
-
return "some contents";
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
name: "meeting minutes",
|
|
424
|
-
sourceApplication: "Microsoft Teams",
|
|
425
|
-
getContents: async () => {
|
|
426
|
-
return "some contents";
|
|
427
|
-
},
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
name: "project plan",
|
|
431
|
-
sourceApplication: "Trello",
|
|
432
|
-
getContents: async () => {
|
|
433
|
-
return "some contents";
|
|
434
|
-
},
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
name: "code review comments",
|
|
438
|
-
sourceApplication: "Github",
|
|
439
|
-
getContents: async () => {
|
|
440
|
-
return "some contents";
|
|
441
|
-
},
|
|
442
|
-
},
|
|
443
|
-
];
|
package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
CHANGED
|
@@ -10,6 +10,7 @@ export interface Props {
|
|
|
10
10
|
apiConfig: InsertionEditorApiConfig;
|
|
11
11
|
performInsertion: (insertedText: string) => void;
|
|
12
12
|
closeWindow: () => void;
|
|
13
|
+
contextCategories: string[];
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const HoveringInsertionPromptBox: React.FC<Props> = (props) => {
|
|
@@ -24,6 +25,7 @@ export const HoveringInsertionPromptBox: React.FC<Props> = (props) => {
|
|
|
24
25
|
}}
|
|
25
26
|
performInsertion={props.performInsertion}
|
|
26
27
|
insertionOrEditingFunction={props.apiConfig.insertionOrEditingFunction}
|
|
28
|
+
contextCategories={props.contextCategories}
|
|
27
29
|
/>
|
|
28
30
|
</div>
|
|
29
31
|
);
|
|
@@ -19,18 +19,13 @@ import {
|
|
|
19
19
|
Smile,
|
|
20
20
|
User,
|
|
21
21
|
} from "lucide-react";
|
|
22
|
-
import { IconForFilePointer } from "../hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core";
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
name: string;
|
|
26
|
-
sourceApplication: string;
|
|
27
|
-
getContents: () => Promise<string>;
|
|
28
|
-
}
|
|
23
|
+
import { DocumentPointer } from "@copilotkit/react-core";
|
|
29
24
|
|
|
30
25
|
export interface SourceSearchBoxProps {
|
|
31
26
|
searchTerm: string;
|
|
32
|
-
|
|
33
|
-
onSelectedFile: (filePointer:
|
|
27
|
+
suggestedFiles: DocumentPointer[];
|
|
28
|
+
onSelectedFile: (filePointer: DocumentPointer) => void;
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
export function SourceSearchBox(props: SourceSearchBoxProps) {
|
|
@@ -62,22 +57,23 @@ export function SourceSearchBox(props: SourceSearchBoxProps) {
|
|
|
62
57
|
<CommandList>
|
|
63
58
|
<CommandEmpty>No results found.</CommandEmpty>
|
|
64
59
|
|
|
65
|
-
<CommandGroup heading="
|
|
66
|
-
{props.
|
|
60
|
+
<CommandGroup heading="Available resources">
|
|
61
|
+
{props.suggestedFiles.map((filePointer) => {
|
|
67
62
|
return (
|
|
68
63
|
<CommandItem
|
|
69
64
|
key={`word-${filePointer.sourceApplication}.${filePointer.name}`}
|
|
70
65
|
value={filePointer.name}
|
|
71
66
|
onSelect={(value) => {
|
|
72
|
-
console.log(filePointer.name);
|
|
73
67
|
props.onSelectedFile(filePointer);
|
|
74
68
|
}}
|
|
75
69
|
>
|
|
76
70
|
<div className="flex flex-row gap-3 items-center">
|
|
77
71
|
<Logo size="30px">
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
<img
|
|
73
|
+
src={filePointer.iconImageUri}
|
|
74
|
+
alt={filePointer.sourceApplication}
|
|
75
|
+
width={30}
|
|
76
|
+
height={30}
|
|
81
77
|
/>
|
|
82
78
|
</Logo>
|
|
83
79
|
{filePointer.name}
|
|
@@ -87,7 +83,7 @@ export function SourceSearchBox(props: SourceSearchBoxProps) {
|
|
|
87
83
|
})}
|
|
88
84
|
</CommandGroup>
|
|
89
85
|
|
|
90
|
-
<CommandGroup heading="Suggestions">
|
|
86
|
+
{/* <CommandGroup heading="Suggestions">
|
|
91
87
|
<CommandItem
|
|
92
88
|
onSelect={(value) => {
|
|
93
89
|
console.log(value);
|
|
@@ -105,7 +101,7 @@ export function SourceSearchBox(props: SourceSearchBoxProps) {
|
|
|
105
101
|
<Calculator className="mr-2 h-4 w-4" />
|
|
106
102
|
<span>Calculator</span>
|
|
107
103
|
</CommandItem>
|
|
108
|
-
</CommandGroup>
|
|
104
|
+
</CommandGroup> */}
|
|
109
105
|
<CommandSeparator />
|
|
110
106
|
</CommandList>
|
|
111
107
|
</Command>
|
|
@@ -121,7 +117,7 @@ export function Logo({
|
|
|
121
117
|
}) {
|
|
122
118
|
return (
|
|
123
119
|
<div
|
|
124
|
-
className="flex items-center justify-center"
|
|
120
|
+
className="flex items-center justify-center bg-black"
|
|
125
121
|
style={{ width: size, height: size }}
|
|
126
122
|
>
|
|
127
123
|
{children}
|
|
@@ -2,6 +2,7 @@ import { BaseCopilotTextareaApiConfig } from "./autosuggestions-bare-function";
|
|
|
2
2
|
|
|
3
3
|
export interface BaseAutosuggestionsConfig {
|
|
4
4
|
textareaPurpose: string;
|
|
5
|
+
contextCategories: string[];
|
|
5
6
|
debounceTime: number;
|
|
6
7
|
acceptAutosuggestionKey: string;
|
|
7
8
|
disableWhenEmpty: boolean;
|
|
@@ -15,6 +16,7 @@ export const defaultBaseAutosuggestionsConfig: Omit<
|
|
|
15
16
|
"textareaPurpose" | "apiConfig"
|
|
16
17
|
> = {
|
|
17
18
|
debounceTime: 250,
|
|
19
|
+
contextCategories: ["global"],
|
|
18
20
|
acceptAutosuggestionKey: "Tab",
|
|
19
21
|
disableWhenEmpty: true,
|
|
20
22
|
disabled: false,
|
package/dist/chunk-2NURR2DX.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-KGKLUWKW.mjs';
|
|
2
|
-
import { __objRest, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var buttonVariants = cva(
|
|
9
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
14
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
15
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
16
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
17
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
18
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
19
|
-
},
|
|
20
|
-
size: {
|
|
21
|
-
default: "h-10 px-4 py-2",
|
|
22
|
-
sm: "h-9 rounded-md px-3",
|
|
23
|
-
lg: "h-11 rounded-md px-8",
|
|
24
|
-
icon: "h-10 w-10"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
defaultVariants: {
|
|
28
|
-
variant: "default",
|
|
29
|
-
size: "default"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
var Button = React.forwardRef(
|
|
34
|
-
(_a, ref) => {
|
|
35
|
-
var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
|
|
36
|
-
const Comp = asChild ? Slot : "button";
|
|
37
|
-
return /* @__PURE__ */ jsx(Comp, __spreadValues({
|
|
38
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
39
|
-
ref
|
|
40
|
-
}, props));
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
Button.displayName = "Button";
|
|
44
|
-
|
|
45
|
-
export { Button, buttonVariants };
|
|
46
|
-
//# sourceMappingURL=out.js.map
|
|
47
|
-
//# sourceMappingURL=chunk-2NURR2DX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/button.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AA2CjC;AAvCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,IAAyD,QAAQ;AAAjE,iBAAE,aAAW,SAAS,MAAM,UAAU,MA1CzC,IA0CG,IAAgD,kBAAhD,IAAgD,CAA9C,aAAW,WAAS,QAAM;AAC3B,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC;AAAA,MACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,MAC1D;AAAA,OACI,MACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n"]}
|
package/dist/chunk-2TQBFDO7.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defaultEditingApiConfig } from './chunk-HRTFMM7P.mjs';
|
|
2
|
-
import { defaultInsertionsApiConfig } from './chunk-66BDXIX4.mjs';
|
|
3
|
-
import { defaultSuggestionsApiConfig } from './chunk-JHTAOLEW.mjs';
|
|
4
|
-
import { defaultBaseAutosuggestionsConfig } from './chunk-D7SEV5PR.mjs';
|
|
5
|
-
import { __spreadProps, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
6
|
-
|
|
7
|
-
// src/types/autosuggestions-config/autosuggestions-config.tsx
|
|
8
|
-
var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseAutosuggestionsConfig), {
|
|
9
|
-
externalContextCategories: void 0,
|
|
10
|
-
chatApiConfigs: {
|
|
11
|
-
suggestionsApiConfig: defaultSuggestionsApiConfig,
|
|
12
|
-
insertionApiConfig: defaultInsertionsApiConfig,
|
|
13
|
-
editingApiConfig: defaultEditingApiConfig
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export { defaultAutosuggestionsConfig };
|
|
18
|
-
//# sourceMappingURL=out.js.map
|
|
19
|
-
//# sourceMappingURL=chunk-2TQBFDO7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/autosuggestions-config/autosuggestions-config.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BO,IAAM,+BAGT,iCACC,mCADD;AAAA,EAEF,2BAA2B;AAAA,EAC3B,gBAAgB;AAAA,IACd,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,kBAAkB;AAAA,EACpB;AACF","sourcesContent":["import {\n BaseAutosuggestionsConfig,\n defaultBaseAutosuggestionsConfig,\n} from \"../base\";\nimport {\n SuggestionsApiConfig,\n defaultSuggestionsApiConfig,\n} from \"./suggestions-api-config\";\nimport {\n InsertionsApiConfig,\n defaultInsertionsApiConfig,\n} from \"./insertions-api-config\";\nimport { ChatlikeApiEndpoint } from \".\";\nimport {\n EditingApiConfig,\n defaultEditingApiConfig,\n} from \"./editing-api-config\";\n\n// Like the base autosuggestions config, with 2 additional fields:\n// 1. externalContextCategories: string[] | undefined;\n// 2. instead of apiConfigs, we have chatApiConfigs: a higher-level abstraction that uses a ChatGPT-like API endpoint.\nexport interface AutosuggestionsConfig\n extends Omit<BaseAutosuggestionsConfig, \"apiConfig\"> {\n externalContextCategories: string[] | undefined;\n chatApiConfigs: {\n suggestionsApiConfig: SuggestionsApiConfig;\n insertionApiConfig: InsertionsApiConfig;\n editingApiConfig: EditingApiConfig;\n };\n}\n\nexport const defaultAutosuggestionsConfig: Omit<\n AutosuggestionsConfig,\n \"textareaPurpose\" | \"apiEndpoint\"\n> = {\n ...defaultBaseAutosuggestionsConfig,\n externalContextCategories: undefined,\n chatApiConfigs: {\n suggestionsApiConfig: defaultSuggestionsApiConfig,\n insertionApiConfig: defaultInsertionsApiConfig,\n editingApiConfig: defaultEditingApiConfig,\n },\n};\n"]}
|
package/dist/chunk-4S5ZJH3I.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/lib/retry.tsx
|
|
2
|
-
function retry(fn, retriesLeft = 2, interval = 200, backoff = 1.5) {
|
|
3
|
-
return new Promise((resolve, reject) => {
|
|
4
|
-
fn().then(resolve).catch((error) => {
|
|
5
|
-
if (retriesLeft === 1) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
setTimeout(() => {
|
|
10
|
-
retry(fn, retriesLeft - 1, interval * backoff, backoff).then(resolve).catch(reject);
|
|
11
|
-
}, interval);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { retry };
|
|
17
|
-
//# sourceMappingURL=out.js.map
|
|
18
|
-
//# sourceMappingURL=chunk-4S5ZJH3I.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/retry.tsx"],"names":[],"mappings":";AAAO,SAAS,MACd,IACA,cAAsB,GACtB,WAAmB,KACnB,UAAkB,KACN;AACZ,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,OAAG,EACA,KAAK,OAAO,EACZ,MAAM,CAAC,UAAU;AAChB,UAAI,gBAAgB,GAAG;AACrB,eAAO,KAAK;AACZ;AAAA,MACF;AAEA,iBAAW,MAAM;AACf,cAAM,IAAI,cAAc,GAAG,WAAW,SAAS,OAAO,EACnD,KAAK,OAAO,EACZ,MAAM,MAAM;AAAA,MACjB,GAAG,QAAQ;AAAA,IACb,CAAC;AAAA,EACL,CAAC;AACH","sourcesContent":["export function retry<T>(\n fn: () => Promise<T>,\n retriesLeft: number = 2,\n interval: number = 200,\n backoff: number = 1.5\n): Promise<T> {\n return new Promise((resolve, reject) => {\n fn()\n .then(resolve)\n .catch((error) => {\n if (retriesLeft === 1) {\n reject(error);\n return;\n }\n\n setTimeout(() => {\n retry(fn, retriesLeft - 1, interval * backoff, backoff)\n .then(resolve)\n .catch(reject);\n }, interval);\n });\n });\n}\n"]}
|
package/dist/chunk-5EJ5XOGP.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-KGKLUWKW.mjs';
|
|
2
|
-
import { __objRest, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var labelVariants = cva(
|
|
9
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
10
|
-
);
|
|
11
|
-
var Label = React.forwardRef((_a, ref) => {
|
|
12
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
13
|
-
return /* @__PURE__ */ jsx(LabelPrimitive.Root, __spreadValues({
|
|
14
|
-
ref,
|
|
15
|
-
className: cn(labelVariants(), className)
|
|
16
|
-
}, props));
|
|
17
|
-
});
|
|
18
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
19
|
-
|
|
20
|
-
export { Label };
|
|
21
|
-
//# sourceMappingURL=out.js.map
|
|
22
|
-
//# sourceMappingURL=chunk-5EJ5XOGP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/label.tsx"],"names":[],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,WAA8B;AAarC;AAjBF;AAQA,IAAM,gBAAgB;AAAA,EACpB;AACF;AAEA,IAAM,QAAc,iBAIlB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAhBL,IAgBG,IAAgB,kBAAhB,IAAgB,CAAd;AACH,6BAAgB,qBAAf;AAAA,IACC;AAAA,IACA,WAAW,GAAG,cAAc,GAAG,SAAS;AAAA,KACpC,MACN;AAAA,CACD;AACD,MAAM,cAA6B,oBAAK","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n"]}
|
package/dist/chunk-5FO6ISW4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/chunk-66BDXIX4.mjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// src/types/autosuggestions-config/insertions-api-config.tsx
|
|
2
|
-
var defaultInsertionsMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
3
|
-
return `You are a versatile writing assistant.
|
|
4
|
-
|
|
5
|
-
The user is writing some text.
|
|
6
|
-
The purpose is: "${textareaPurpose}"
|
|
7
|
-
|
|
8
|
-
The user also provides you with a prompt for INSERTIONS into the text they are writing.
|
|
9
|
-
Your job is to come up with an INSERTION into the text that the user would like AS BEST YOU CAN.
|
|
10
|
-
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
11
|
-
|
|
12
|
-
Adjust yourself to the user's style and implied intent.
|
|
13
|
-
|
|
14
|
-
The user will provide the text before and after the cursor, as well as the insertion prompt. You should use this to infer the best relevant insertion.
|
|
15
|
-
<TextAfterCursor>
|
|
16
|
-
<TextBeforeCursor>
|
|
17
|
-
<InsertionPrompt>
|
|
18
|
-
<YourSuggestion>
|
|
19
|
-
|
|
20
|
-
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
|
|
21
|
-
|
|
22
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
23
|
-
\`\`\`
|
|
24
|
-
${contextString}
|
|
25
|
-
\`\`\`
|
|
26
|
-
`;
|
|
27
|
-
};
|
|
28
|
-
var defaultInsertionsFewShotMessages = [
|
|
29
|
-
{
|
|
30
|
-
role: "user",
|
|
31
|
-
name: "TextAfterCursor",
|
|
32
|
-
content: "While I was there I also picked up some apples, oranges, and bananas."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
role: "user",
|
|
36
|
-
name: "TextBeforeCursor",
|
|
37
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
role: "user",
|
|
41
|
-
name: "InsertionPrompt",
|
|
42
|
-
content: "I bought a big watermelon"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
role: "assistant",
|
|
46
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
role: "user",
|
|
50
|
-
name: "TextAfterCursor",
|
|
51
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
role: "user",
|
|
55
|
-
name: "TextBeforeCursor",
|
|
56
|
-
content: `The Optionholder, in the Optionholder's capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an "Equityholder" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an "Equityholder" thereunder;`
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
role: "user",
|
|
60
|
-
name: "InsertionPrompt",
|
|
61
|
-
content: "add section about the optionholder's pro rata share"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
role: "assistant",
|
|
65
|
-
content: ` (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder's "Pro Rata Share"; `
|
|
66
|
-
}
|
|
67
|
-
];
|
|
68
|
-
var defaultInsertionsApiConfig = {
|
|
69
|
-
makeSystemPrompt: defaultInsertionsMakeSystemPrompt,
|
|
70
|
-
fewShotMessages: defaultInsertionsFewShotMessages,
|
|
71
|
-
forwardedParams: void 0
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { defaultInsertionsApiConfig, defaultInsertionsFewShotMessages, defaultInsertionsMakeSystemPrompt };
|
|
75
|
-
//# sourceMappingURL=out.js.map
|
|
76
|
-
//# sourceMappingURL=chunk-66BDXIX4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/autosuggestions-config/insertions-api-config.tsx"],"names":[],"mappings":";AASO,IAAM,oCAAsD,CACjE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBlB;AAAA;AAAA;AAGF;AAEO,IAAM,mCAA4D;AAAA,EACvE;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AACF;AAEO,IAAM,6BAAkD;AAAA,EAC7D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB","sourcesContent":["import { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\nimport { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\n\nexport interface InsertionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultInsertionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString\n) => {\n return `You are a versatile writing assistant.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe user also provides you with a prompt for INSERTIONS into the text they are writing. \nYour job is to come up with an INSERTION into the text that the user would like AS BEST YOU CAN.\nOnly guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide the text before and after the cursor, as well as the insertion prompt. You should use this to infer the best relevant insertion.\n<TextAfterCursor>\n<TextBeforeCursor>\n<InsertionPrompt>\n<YourSuggestion>\n\nIf we need to add a whitespace character to the suggested text, make sure to explicitly add it in.\n\nThe following external context is also provided. Use it to help you make better suggestions!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n`;\n};\n\nexport const defaultInsertionsFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"While I was there I also picked up some apples, oranges, and bananas.\",\n },\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content: \"This morning I woke up and went straight to the grocery store.\",\n },\n {\n role: \"user\",\n name: \"InsertionPrompt\",\n content: \"I bought a big watermelon\",\n },\n {\n role: \"assistant\",\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n },\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.\",\n },\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content:\n 'The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;',\n },\n {\n role: \"user\",\n name: \"InsertionPrompt\",\n content: \"add section about the optionholder's pro rata share\",\n },\n {\n role: \"assistant\",\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n },\n];\n\nexport const defaultInsertionsApiConfig: InsertionsApiConfig = {\n makeSystemPrompt: defaultInsertionsMakeSystemPrompt,\n fewShotMessages: defaultInsertionsFewShotMessages,\n forwardedParams: undefined,\n};\n"]}
|
package/dist/chunk-7XKICWEE.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useMakeStandardAutosuggestionFunction } from './chunk-K2AVA67P.mjs';
|
|
2
|
-
import { useMakeStandardInsertionOrEditingFunction } from './chunk-OXPXFYUG.mjs';
|
|
3
|
-
import { BaseCopilotTextarea } from './chunk-NKA6K7FW.mjs';
|
|
4
|
-
import { defaultAutosuggestionsConfig } from './chunk-2TQBFDO7.mjs';
|
|
5
|
-
import { __spreadProps, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import merge from 'lodash.merge';
|
|
8
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
var CopilotTextarea = React.forwardRef(
|
|
11
|
-
(props, ref) => {
|
|
12
|
-
const autosuggestionsConfig = merge(
|
|
13
|
-
defaultAutosuggestionsConfig,
|
|
14
|
-
props.autosuggestionsConfig
|
|
15
|
-
);
|
|
16
|
-
const autosuggestionsFunction = useMakeStandardAutosuggestionFunction(
|
|
17
|
-
autosuggestionsConfig.textareaPurpose,
|
|
18
|
-
autosuggestionsConfig.externalContextCategories,
|
|
19
|
-
autosuggestionsConfig.chatApiConfigs.suggestionsApiConfig
|
|
20
|
-
);
|
|
21
|
-
const insertionOrEditingFunction = useMakeStandardInsertionOrEditingFunction(
|
|
22
|
-
autosuggestionsConfig.textareaPurpose,
|
|
23
|
-
autosuggestionsConfig.externalContextCategories,
|
|
24
|
-
autosuggestionsConfig.chatApiConfigs.insertionApiConfig,
|
|
25
|
-
autosuggestionsConfig.chatApiConfigs.editingApiConfig
|
|
26
|
-
);
|
|
27
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
28
|
-
children: /* @__PURE__ */ jsx(BaseCopilotTextarea, __spreadProps(__spreadValues({
|
|
29
|
-
ref
|
|
30
|
-
}, props), {
|
|
31
|
-
baseAutosuggestionsConfig: __spreadProps(__spreadValues({}, autosuggestionsConfig), {
|
|
32
|
-
apiConfig: {
|
|
33
|
-
insertionOrEditingFunction,
|
|
34
|
-
autosuggestionsFunction
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
}))
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
export { CopilotTextarea };
|
|
43
|
-
//# sourceMappingURL=out.js.map
|
|
44
|
-
//# sourceMappingURL=chunk-7XKICWEE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/copilot-textarea/copilot-textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,OAAO,WAAW;AAUlB,OAAO,WAAW;AAmCZ,mBACE,WADF;AAzBC,IAAM,kBAAkB,MAAM;AAAA,EACnC,CACE,OACA,QACgB;AAChB,UAAM,wBAA+C;AAAA,MACnD;AAAA,MACA,MAAM;AAAA,IACR;AAEA,UAAM,0BAA0B;AAAA,MAC9B,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,sBAAsB,eAAe;AAAA,IACvC;AAEA,UAAM,6BACJ;AAAA,MACE,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,sBAAsB,eAAe;AAAA,MACrC,sBAAsB,eAAe;AAAA,IACvC;AAEF,WACE;AAAA,MACE,8BAAC;AAAA,QACC;AAAA,SACI,QAFL;AAAA,QAGC,2BAA2B,iCACtB,wBADsB;AAAA,UAEzB,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACF;AAAA,KACF;AAAA,EAEJ;AACF","sourcesContent":["// This example is for an Editor with `ReactEditor` and `HistoryEditor`\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 autosuggestionsConfig: AutosuggestionsConfigUserSpecified;\n}\n\nexport const CopilotTextarea = React.forwardRef(\n (\n props: CopilotTextareaProps,\n ref: React.Ref<HTMLCopilotTextAreaElement>\n ): JSX.Element => {\n const autosuggestionsConfig: AutosuggestionsConfig = merge(\n defaultAutosuggestionsConfig,\n props.autosuggestionsConfig\n );\n\n const autosuggestionsFunction = useMakeStandardAutosuggestionFunction(\n autosuggestionsConfig.textareaPurpose,\n autosuggestionsConfig.externalContextCategories,\n autosuggestionsConfig.chatApiConfigs.suggestionsApiConfig\n );\n\n const insertionOrEditingFunction =\n useMakeStandardInsertionOrEditingFunction(\n autosuggestionsConfig.textareaPurpose,\n autosuggestionsConfig.externalContextCategories,\n autosuggestionsConfig.chatApiConfigs.insertionApiConfig,\n autosuggestionsConfig.chatApiConfigs.editingApiConfig\n );\n\n return (\n <>\n <BaseCopilotTextarea\n ref={ref}\n {...props}\n baseAutosuggestionsConfig={{\n ...autosuggestionsConfig,\n apiConfig: {\n insertionOrEditingFunction: insertionOrEditingFunction,\n autosuggestionsFunction: autosuggestionsFunction,\n },\n }}\n />\n </>\n );\n }\n);\n"]}
|