@copilotkit/react-textarea 0.25.0 → 0.26.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +313 -309
- package/CHANGELOG.md +22 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +29 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +1745 -35
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +51 -3
- package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +49 -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.d.ts +3 -0
- package/dist/components/copilot-textarea/copilot-textarea.mjs +2202 -47
- package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +7 -3
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +17 -3
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +137 -3
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +875 -18
- 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.mjs +558 -12
- 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.mjs +581 -13
- 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/included-files-preview.mjs +102 -5
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +581 -14
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
- package/dist/components/index.mjs +2203 -48
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +10 -22
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
- package/dist/components/source-search-box/source-search-box.mjs +211 -6
- package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
- package/dist/components/ui/button.mjs +85 -4
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/card.mjs +71 -31
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/command.mjs +244 -5
- package/dist/components/ui/command.mjs.map +1 -1
- package/dist/components/ui/dialog.mjs +144 -4
- package/dist/components/ui/dialog.mjs.map +1 -1
- package/dist/components/ui/label.mjs +60 -4
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/separator.mjs +63 -18
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/textarea.mjs +58 -14
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/context/index.d.ts +1 -0
- 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 +158 -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 +148 -5
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- 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 +147 -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 +193 -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.mjs +2206 -50
- 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 +102 -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 +20 -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.d.ts +1 -0
- 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 +265 -8
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +81 -3
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +327 -10
- package/dist/types/autosuggestions-config/index.mjs.map +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +75 -3
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +83 -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.mjs +26 -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 +26 -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 +328 -12
- package/dist/types/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +50 -10
- package/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx +23 -1
- package/src/components/copilot-textarea/copilot-textarea.tsx +3 -0
- package/src/components/hovering-toolbar/hovering-editor-provider.tsx +7 -3
- package/dist/chunk-2C7O2EVM.mjs +0 -27
- package/dist/chunk-2C7O2EVM.mjs.map +0 -1
- package/dist/chunk-2CDXHWVF.mjs +0 -107
- package/dist/chunk-2CDXHWVF.mjs.map +0 -1
- package/dist/chunk-2QDCE7PD.mjs +0 -29
- package/dist/chunk-2QDCE7PD.mjs.map +0 -1
- package/dist/chunk-3PQ7GSFE.mjs +0 -17
- package/dist/chunk-3PQ7GSFE.mjs.map +0 -1
- package/dist/chunk-5FO6ISW4.mjs +0 -3
- package/dist/chunk-5FO6ISW4.mjs.map +0 -1
- package/dist/chunk-5IISSXS2.mjs +0 -224
- package/dist/chunk-5IISSXS2.mjs.map +0 -1
- package/dist/chunk-5UNJXFUO.mjs +0 -29
- package/dist/chunk-5UNJXFUO.mjs.map +0 -1
- package/dist/chunk-74HF6Q3L.mjs +0 -204
- package/dist/chunk-74HF6Q3L.mjs.map +0 -1
- package/dist/chunk-7LSRNPNI.mjs +0 -59
- package/dist/chunk-7LSRNPNI.mjs.map +0 -1
- package/dist/chunk-7SZDD6XT.mjs +0 -53
- package/dist/chunk-7SZDD6XT.mjs.map +0 -1
- package/dist/chunk-7VKOE5UL.mjs +0 -45
- package/dist/chunk-7VKOE5UL.mjs.map +0 -1
- package/dist/chunk-AUCHS4VR.mjs +0 -77
- package/dist/chunk-AUCHS4VR.mjs.map +0 -1
- package/dist/chunk-BLRAOGXD.mjs +0 -10
- package/dist/chunk-BLRAOGXD.mjs.map +0 -1
- package/dist/chunk-CK7Q3Y5A.mjs +0 -21
- package/dist/chunk-CK7Q3Y5A.mjs.map +0 -1
- package/dist/chunk-DE5K76I2.mjs +0 -3
- package/dist/chunk-DE5K76I2.mjs.map +0 -1
- package/dist/chunk-ECR45NSD.mjs +0 -101
- package/dist/chunk-ECR45NSD.mjs.map +0 -1
- package/dist/chunk-EZCKXWQF.mjs +0 -16
- package/dist/chunk-EZCKXWQF.mjs.map +0 -1
- package/dist/chunk-F626GQCD.mjs +0 -47
- package/dist/chunk-F626GQCD.mjs.map +0 -1
- package/dist/chunk-FK2XUDQQ.mjs +0 -22
- package/dist/chunk-FK2XUDQQ.mjs.map +0 -1
- package/dist/chunk-FP2EKU3L.mjs +0 -28
- package/dist/chunk-FP2EKU3L.mjs.map +0 -1
- package/dist/chunk-GQN2HYFJ.mjs +0 -22
- package/dist/chunk-GQN2HYFJ.mjs.map +0 -1
- package/dist/chunk-H4VKQGVU.mjs +0 -3
- package/dist/chunk-H4VKQGVU.mjs.map +0 -1
- package/dist/chunk-IU3WTXLQ.mjs +0 -3
- package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
- package/dist/chunk-K5LNB36H.mjs +0 -80
- package/dist/chunk-K5LNB36H.mjs.map +0 -1
- package/dist/chunk-KDVMG3XF.mjs +0 -63
- package/dist/chunk-KDVMG3XF.mjs.map +0 -1
- package/dist/chunk-KMXSZRIA.mjs +0 -47
- package/dist/chunk-KMXSZRIA.mjs.map +0 -1
- package/dist/chunk-KNQIEOFP.mjs +0 -18
- package/dist/chunk-KNQIEOFP.mjs.map +0 -1
- package/dist/chunk-L7VVZH4Q.mjs +0 -3
- package/dist/chunk-L7VVZH4Q.mjs.map +0 -1
- package/dist/chunk-LZ3UOAQ4.mjs +0 -83
- package/dist/chunk-LZ3UOAQ4.mjs.map +0 -1
- package/dist/chunk-M2DR4KVB.mjs +0 -33
- package/dist/chunk-M2DR4KVB.mjs.map +0 -1
- package/dist/chunk-MMVDU6DF.mjs +0 -3
- package/dist/chunk-MMVDU6DF.mjs.map +0 -1
- package/dist/chunk-MRXNTQOX.mjs +0 -55
- package/dist/chunk-MRXNTQOX.mjs.map +0 -1
- package/dist/chunk-NTLVQENP.mjs +0 -19
- package/dist/chunk-NTLVQENP.mjs.map +0 -1
- package/dist/chunk-PDCIGRCE.mjs +0 -93
- package/dist/chunk-PDCIGRCE.mjs.map +0 -1
- package/dist/chunk-QRKKPCUD.mjs +0 -21
- package/dist/chunk-QRKKPCUD.mjs.map +0 -1
- package/dist/chunk-RBR32FWA.mjs +0 -74
- package/dist/chunk-RBR32FWA.mjs.map +0 -1
- package/dist/chunk-T6MTDQZ7.mjs +0 -45
- package/dist/chunk-T6MTDQZ7.mjs.map +0 -1
- package/dist/chunk-TZLW7PBU.mjs +0 -35
- package/dist/chunk-TZLW7PBU.mjs.map +0 -1
- package/dist/chunk-U3LUDDT5.mjs +0 -65
- package/dist/chunk-U3LUDDT5.mjs.map +0 -1
- package/dist/chunk-UEQYKC4W.mjs +0 -34
- package/dist/chunk-UEQYKC4W.mjs.map +0 -1
- package/dist/chunk-V55OPCG4.mjs +0 -45
- package/dist/chunk-V55OPCG4.mjs.map +0 -1
- package/dist/chunk-VYECMH73.mjs +0 -99
- package/dist/chunk-VYECMH73.mjs.map +0 -1
- package/dist/chunk-W2ZHOUV6.mjs +0 -108
- package/dist/chunk-W2ZHOUV6.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-WVRTFPNO.mjs +0 -91
- package/dist/chunk-WVRTFPNO.mjs.map +0 -1
- package/dist/chunk-ZEHF3AXH.mjs +0 -45
- package/dist/chunk-ZEHF3AXH.mjs.map +0 -1
- package/dist/chunk-ZKRM3DIR.mjs +0 -91
- package/dist/chunk-ZKRM3DIR.mjs.map +0 -1
- package/dist/chunk-ZMNOLW5V.mjs +0 -99
- package/dist/chunk-ZMNOLW5V.mjs.map +0 -1
package/dist/chunk-KDVMG3XF.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/types/autosuggestions-config/suggestions-api-config.tsx
|
|
2
|
-
var defaultSuggestionsMakeSystemPrompt = (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
|
-
Your job is to guess what the user will write next AS BEST YOU CAN.
|
|
9
|
-
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
10
|
-
|
|
11
|
-
Adjust yourself to the user's style and implied intent.
|
|
12
|
-
|
|
13
|
-
The user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.
|
|
14
|
-
<TextAfterCursor>
|
|
15
|
-
<TextBeforeCursor>
|
|
16
|
-
<YourSuggestion>
|
|
17
|
-
|
|
18
|
-
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
|
|
19
|
-
|
|
20
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
21
|
-
\`\`\`
|
|
22
|
-
${contextString}
|
|
23
|
-
\`\`\`
|
|
24
|
-
`;
|
|
25
|
-
};
|
|
26
|
-
var defaultSuggestionsFewShotMessages = [
|
|
27
|
-
{
|
|
28
|
-
role: "user",
|
|
29
|
-
name: "TextAfterCursor",
|
|
30
|
-
content: "While I was there I also picked up some apples, oranges, and bananas."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
role: "user",
|
|
34
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
role: "assistant",
|
|
38
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
role: "user",
|
|
42
|
-
name: "TextAfterCursor",
|
|
43
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
role: "user",
|
|
47
|
-
name: "TextBeforeCursor",
|
|
48
|
-
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;`
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
role: "assistant",
|
|
52
|
-
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"; `
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
var defaultSuggestionsApiConfig = {
|
|
56
|
-
makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
|
|
57
|
-
fewShotMessages: defaultSuggestionsFewShotMessages,
|
|
58
|
-
forwardedParams: void 0
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export { defaultSuggestionsApiConfig, defaultSuggestionsFewShotMessages, defaultSuggestionsMakeSystemPrompt };
|
|
62
|
-
//# sourceMappingURL=out.js.map
|
|
63
|
-
//# sourceMappingURL=chunk-KDVMG3XF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/autosuggestions-config/suggestions-api-config.tsx"],"names":[],"mappings":";AASO,IAAM,qCAAuD,CAClE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBlB;AAAA;AAAA;AAGF;AAEO,IAAM,oCAA6D;AAAA,EACxE;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,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,SACE;AAAA,EACJ;AACF;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB","sourcesContent":["import { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultSuggestionsMakeSystemPrompt: 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\nYour job is to guess what the user will write next 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 both the text before and after the cursor. You should use this to infer what the user is likely to write next.\n<TextAfterCursor>\n<TextBeforeCursor>\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 defaultSuggestionsFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content: \"While I was there I also picked up some apples, oranges, and bananas.\",\n },\n {\n role: \"user\",\n content: \"This morning I woke up and went straight to the grocery store.\",\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: \"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 defaultSuggestionsApiConfig: SuggestionsApiConfig = {\n makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,\n fewShotMessages: defaultSuggestionsFewShotMessages,\n forwardedParams: undefined,\n};\n"]}
|
package/dist/chunk-KMXSZRIA.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-F626GQCD.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-KMXSZRIA.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;AAwCjC;AApCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,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,MAvCzC,IAuCG,IAAgD,kBAAhD,IAAgD,CAA9C,aAAW,WAAS,QAAM;AAC3B,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC;AAAA,MAAK,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,MAAG;AAAA,OAAc,MAAO;AAAA,EAE5F;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: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"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 className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n"]}
|
package/dist/chunk-KNQIEOFP.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-KNQIEOFP.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-L7VVZH4Q.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/chunk-LZ3UOAQ4.mjs
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { replaceEditorText } from './chunk-5UNJXFUO.mjs';
|
|
2
|
-
import { getFullEditorTextWithNewlines } from './chunk-ECR45NSD.mjs';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ReactEditor } from 'slate-react';
|
|
5
|
-
|
|
6
|
-
function usePopulateCopilotTextareaRef(editor, ref) {
|
|
7
|
-
React.useImperativeHandle(
|
|
8
|
-
ref,
|
|
9
|
-
() => {
|
|
10
|
-
class Combined {
|
|
11
|
-
constructor(customMethods2, editorHtmlElement2) {
|
|
12
|
-
this.customMethods = customMethods2;
|
|
13
|
-
this.editorHtmlElement = editorHtmlElement2;
|
|
14
|
-
}
|
|
15
|
-
get(target, propKey) {
|
|
16
|
-
if (this.isKeyOfCustomMethods(propKey)) {
|
|
17
|
-
const value = this.customMethods[propKey];
|
|
18
|
-
if (typeof value === "function") {
|
|
19
|
-
return value.bind(this.customMethods);
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
} else if (this.isKeyOfHTMLElement(propKey)) {
|
|
23
|
-
const value = this.editorHtmlElement[propKey];
|
|
24
|
-
if (typeof value === "function") {
|
|
25
|
-
return value.bind(this.editorHtmlElement);
|
|
26
|
-
}
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
set(target, propKey, value) {
|
|
31
|
-
if (this.isKeyOfCustomMethods(propKey)) {
|
|
32
|
-
this.customMethods[propKey] = value;
|
|
33
|
-
} else if (this.isKeyOfHTMLElement(propKey)) {
|
|
34
|
-
this.editorHtmlElement[propKey] = value;
|
|
35
|
-
} else {
|
|
36
|
-
target[propKey] = value;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
isKeyOfCustomMethods(key) {
|
|
41
|
-
return key in this.customMethods;
|
|
42
|
-
}
|
|
43
|
-
isKeyOfHTMLElement(key) {
|
|
44
|
-
return key in this.editorHtmlElement;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const handler = {
|
|
48
|
-
get(target, propKey) {
|
|
49
|
-
return target.get(target, propKey);
|
|
50
|
-
},
|
|
51
|
-
set(target, propKey, value) {
|
|
52
|
-
return target.set(target, propKey, value);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
class CustomMethods {
|
|
56
|
-
constructor(editor2) {
|
|
57
|
-
this.editor = editor2;
|
|
58
|
-
}
|
|
59
|
-
focus() {
|
|
60
|
-
ReactEditor.focus(this.editor);
|
|
61
|
-
}
|
|
62
|
-
blur() {
|
|
63
|
-
ReactEditor.blur(this.editor);
|
|
64
|
-
}
|
|
65
|
-
get value() {
|
|
66
|
-
return getFullEditorTextWithNewlines(this.editor);
|
|
67
|
-
}
|
|
68
|
-
set value(value) {
|
|
69
|
-
replaceEditorText(this.editor, value);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const editorHtmlElement = ReactEditor.toDOMNode(editor, editor);
|
|
73
|
-
const customMethods = new CustomMethods(editor);
|
|
74
|
-
const combined = new Combined(customMethods, editorHtmlElement);
|
|
75
|
-
return new Proxy(combined, handler);
|
|
76
|
-
},
|
|
77
|
-
[editor]
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { usePopulateCopilotTextareaRef };
|
|
82
|
-
//# sourceMappingURL=out.js.map
|
|
83
|
-
//# sourceMappingURL=chunk-LZ3UOAQ4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts"],"names":["customMethods","editorHtmlElement","editor"],"mappings":";;;;;;;;AAAA,OAAO,WAAW;AAElB,SAAS,mBAAmB;AAMrB,SAAS,8BACd,QACA,KACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AACJ,YAAM,SAAS;AAAA,QACb,YAAoBA,gBAAsCC,oBAAgC;AAAtE,+BAAAD;AAAsC,mCAAAC;AAAA,QAAiC;AAAA,QAI3F,IAAI,QAAa,SAAsB;AACrC,cAAI,KAAK,qBAAqB,OAAO,GAAG;AACtC,kBAAM,QAAQ,KAAK,cAAc;AACjC,gBAAI,OAAO,UAAU,YAAY;AAC/B,qBAAO,MAAM,KAAK,KAAK,aAAa;AAAA,YACtC;AACA,mBAAO;AAAA,UACT,WAAW,KAAK,mBAAmB,OAAO,GAAG;AAC3C,kBAAM,QAAQ,KAAK,kBAAkB;AACrC,gBAAI,OAAO,UAAU,YAAY;AAC/B,qBAAO,MAAM,KAAK,KAAK,iBAAiB;AAAA,YAC1C;AACA,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,QAEA,IAAI,QAAa,SAAiB,OAAqB;AACrD,cAAI,KAAK,qBAAqB,OAAO,GAAG;AACtC,YAAC,KAAK,cAAsB,WAAW;AAAA,UACzC,WAAW,KAAK,mBAAmB,OAAO,GAAG;AAC3C,YAAC,KAAK,kBAA0B,WAAW;AAAA,UAC7C,OAAO;AAEL,mBAAO,WAAW;AAAA,UACpB;AACA,iBAAO;AAAA,QACT;AAAA,QAEQ,qBAAqB,KAAyC;AACpE,iBAAO,OAAO,KAAK;AAAA,QACrB;AAAA,QAEQ,mBAAmB,KAAuC;AAChE,iBAAO,OAAO,KAAK;AAAA,QACrB;AAAA,MACF;AAEA,YAAM,UAAU;AAAA,QACd,IAAI,QAAa,SAAkD;AACjE,iBAAO,OAAO,IAAI,QAAQ,OAAO;AAAA,QACnC;AAAA,QACA,IAAI,QAAa,SAAkD,OAAY;AAC7E,iBAAO,OAAO,IAAI,QAAQ,SAAS,KAAK;AAAA,QAC1C;AAAA,MACF;AAEA,YAAM,cAAc;AAAA,QAClB,YAAoBC,SAAsB;AAAtB,wBAAAA;AAAA,QAAuB;AAAA,QAE3C,QAAQ;AACN,sBAAY,MAAM,KAAK,MAAM;AAAA,QAC/B;AAAA,QAEA,OAAO;AACL,sBAAY,KAAK,KAAK,MAAM;AAAA,QAC9B;AAAA,QAEA,IAAI,QAAQ;AACV,iBAAO,8BAA8B,KAAK,MAAM;AAAA,QAClD;AAAA,QACA,IAAI,MAAM,OAAe;AACvB,4BAAkB,KAAK,QAAQ,KAAK;AAAA,QACtC;AAAA,MACF;AAEA,YAAM,oBAAoB,YAAY,UAAU,QAAQ,MAAM;AAC9D,YAAM,gBAAgB,IAAI,cAAc,MAAM;AAE9C,YAAM,WAAW,IAAI,SAAS,eAAe,iBAAiB;AAC9D,aAAO,IAAI,MAAM,UAAU,OAAO;AAAA,IACpC;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AACF","sourcesContent":["import React from \"react\";\nimport { Editor } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\nimport { getFullEditorTextWithNewlines } from \"../../lib/get-text-around-cursor\";\nimport { replaceEditorText } from \"../../lib/slatejs-edits/replace-text\";\nimport { HTMLCopilotTextAreaElement } from \"../../types\";\nimport { CustomEditor } from \"../../types/base/custom-editor\";\n\nexport function usePopulateCopilotTextareaRef(\n editor: Editor,\n ref: React.Ref<HTMLCopilotTextAreaElement>,\n) {\n React.useImperativeHandle(\n ref,\n () => {\n class Combined {\n constructor(private customMethods: CustomMethods, private editorHtmlElement: HTMLElement) {}\n\n [key: string]: any;\n\n get(target: any, propKey: string): any {\n if (this.isKeyOfCustomMethods(propKey)) {\n const value = this.customMethods[propKey];\n if (typeof value === \"function\") {\n return value.bind(this.customMethods);\n }\n return value;\n } else if (this.isKeyOfHTMLElement(propKey)) {\n const value = this.editorHtmlElement[propKey];\n if (typeof value === \"function\") {\n return value.bind(this.editorHtmlElement);\n }\n return value;\n }\n }\n\n set(target: any, propKey: string, value: any): boolean {\n if (this.isKeyOfCustomMethods(propKey)) {\n (this.customMethods as any)[propKey] = value;\n } else if (this.isKeyOfHTMLElement(propKey)) {\n (this.editorHtmlElement as any)[propKey] = value;\n } else {\n // Default behavior (optional)\n target[propKey] = value;\n }\n return true;\n }\n\n private isKeyOfCustomMethods(key: string): key is keyof CustomMethods {\n return key in this.customMethods;\n }\n\n private isKeyOfHTMLElement(key: string): key is keyof HTMLElement {\n return key in this.editorHtmlElement;\n }\n }\n\n const handler = {\n get(target: any, propKey: keyof CustomMethods | keyof HTMLElement) {\n return target.get(target, propKey);\n },\n set(target: any, propKey: keyof CustomMethods | keyof HTMLElement, value: any) {\n return target.set(target, propKey, value);\n },\n };\n\n class CustomMethods {\n constructor(private editor: CustomEditor) {}\n\n focus() {\n ReactEditor.focus(this.editor);\n }\n\n blur() {\n ReactEditor.blur(this.editor);\n }\n\n get value() {\n return getFullEditorTextWithNewlines(this.editor);\n }\n set value(value: string) {\n replaceEditorText(this.editor, value);\n }\n }\n\n const editorHtmlElement = ReactEditor.toDOMNode(editor, editor);\n const customMethods = new CustomMethods(editor);\n\n const combined = new Combined(customMethods, editorHtmlElement);\n return new Proxy(combined, handler);\n },\n [editor],\n );\n}\n"]}
|
package/dist/chunk-M2DR4KVB.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { __async } from './chunk-MRXNTQOX.mjs';
|
|
2
|
-
|
|
3
|
-
// src/lib/debouncer.ts
|
|
4
|
-
var Debouncer = class {
|
|
5
|
-
constructor(wait) {
|
|
6
|
-
this.wait = wait;
|
|
7
|
-
this.debounce = (func, ...args) => __async(this, null, function* () {
|
|
8
|
-
this.cancel();
|
|
9
|
-
this.timeoutId = setTimeout(() => __async(this, null, function* () {
|
|
10
|
-
try {
|
|
11
|
-
this.activeAbortController = new AbortController();
|
|
12
|
-
yield func(...args, this.activeAbortController.signal);
|
|
13
|
-
this.activeAbortController = void 0;
|
|
14
|
-
} catch (error) {
|
|
15
|
-
}
|
|
16
|
-
}), this.wait);
|
|
17
|
-
});
|
|
18
|
-
this.cancel = () => {
|
|
19
|
-
if (this.activeAbortController) {
|
|
20
|
-
this.activeAbortController.abort();
|
|
21
|
-
this.activeAbortController = void 0;
|
|
22
|
-
}
|
|
23
|
-
if (this.timeoutId !== void 0) {
|
|
24
|
-
clearTimeout(this.timeoutId);
|
|
25
|
-
this.timeoutId = void 0;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { Debouncer };
|
|
32
|
-
//# sourceMappingURL=out.js.map
|
|
33
|
-
//# sourceMappingURL=chunk-M2DR4KVB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/debouncer.ts"],"names":[],"mappings":";;;;;AAEO,IAAM,YAAN,MAAiC;AAAA,EAItC,YAAoB,MAAc;AAAd;AAEpB,oBAAW,CAAO,SAA2B,SAAY;AAEvD,WAAK,OAAO;AAEZ,WAAK,YAAY,WAAW,MAAY;AACtC,YAAI;AACF,eAAK,wBAAwB,IAAI,gBAAgB;AAGjD,gBAAM,KAAK,GAAG,MAAM,KAAK,sBAAsB,MAAM;AAErD,eAAK,wBAAwB;AAAA,QAC/B,SAAS,OAAP;AAAA,QAAe;AAAA,MACnB,IAAG,KAAK,IAAI;AAAA,IACd;AAEA,kBAAS,MAAM;AACb,UAAI,KAAK,uBAAuB;AAC9B,aAAK,sBAAsB,MAAM;AACjC,aAAK,wBAAwB;AAAA,MAC/B;AAEA,UAAI,KAAK,cAAc,QAAW;AAChC,qBAAa,KAAK,SAAS;AAC3B,aAAK,YAAY;AAAA,MACnB;AAAA,IACF;AAAA,EA5BmC;AA6BrC","sourcesContent":["export type AsyncFunction<T extends any[]> = (...args: [...T, AbortSignal]) => Promise<void>;\n\nexport class Debouncer<T extends any[]> {\n private timeoutId?: number;\n private activeAbortController?: AbortController;\n\n constructor(private wait: number) {}\n\n debounce = async (func: AsyncFunction<T>, ...args: T) => {\n // Abort the previous promise immediately\n this.cancel();\n\n this.timeoutId = setTimeout(async () => {\n try {\n this.activeAbortController = new AbortController();\n\n // Pass the signal to the async function, assuming it supports it\n await func(...args, this.activeAbortController.signal);\n\n this.activeAbortController = undefined;\n } catch (error) {}\n }, this.wait);\n };\n\n cancel = () => {\n if (this.activeAbortController) {\n this.activeAbortController.abort();\n this.activeAbortController = undefined;\n }\n\n if (this.timeoutId !== undefined) {\n clearTimeout(this.timeoutId);\n this.timeoutId = undefined;\n }\n };\n}\n"]}
|
package/dist/chunk-MMVDU6DF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/chunk-MRXNTQOX.mjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export { __async, __objRest, __spreadProps, __spreadValues };
|
|
54
|
-
//# sourceMappingURL=out.js.map
|
|
55
|
-
//# sourceMappingURL=chunk-MRXNTQOX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
package/dist/chunk-NTLVQENP.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defaultEditingApiConfig } from './chunk-K5LNB36H.mjs';
|
|
2
|
-
import { defaultInsertionsApiConfig } from './chunk-RBR32FWA.mjs';
|
|
3
|
-
import { defaultSuggestionsApiConfig } from './chunk-KDVMG3XF.mjs';
|
|
4
|
-
import { defaultBaseAutosuggestionsConfig } from './chunk-FP2EKU3L.mjs';
|
|
5
|
-
import { __spreadProps, __spreadValues } from './chunk-MRXNTQOX.mjs';
|
|
6
|
-
import { defaultCopilotContextCategories } from '@copilotkit/react-core';
|
|
7
|
-
|
|
8
|
-
var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseAutosuggestionsConfig), {
|
|
9
|
-
contextCategories: defaultCopilotContextCategories,
|
|
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-NTLVQENP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/autosuggestions-config/autosuggestions-config.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAKA,SAAS,uCAAuC;AAczC,IAAM,+BAGT,iCACC,mCADD;AAAA,EAEF,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,IACd,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,IACpB,kBAAkB;AAAA,EACpB;AACF","sourcesContent":["import { BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig } from \"../base\";\nimport { SuggestionsApiConfig, defaultSuggestionsApiConfig } from \"./suggestions-api-config\";\nimport { InsertionsApiConfig, defaultInsertionsApiConfig } from \"./insertions-api-config\";\nimport { ChatlikeApiEndpoint } from \".\";\nimport { EditingApiConfig, defaultEditingApiConfig } from \"./editing-api-config\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n// Like the base autosuggestions config, with 2 additional fields:\n// 1. contextCategories: string[] | undefined;\n// 2. instead of apiConfigs, we have chatApiConfigs: a higher-level abstraction that uses a ChatGPT-like API endpoint.\nexport interface AutosuggestionsConfig extends Omit<BaseAutosuggestionsConfig, \"apiConfig\"> {\n contextCategories: string[];\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 contextCategories: defaultCopilotContextCategories,\n chatApiConfigs: {\n suggestionsApiConfig: defaultSuggestionsApiConfig,\n insertionApiConfig: defaultInsertionsApiConfig,\n editingApiConfig: defaultEditingApiConfig,\n },\n};\n"]}
|
package/dist/chunk-PDCIGRCE.mjs
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-F626GQCD.mjs';
|
|
2
|
-
import { __objRest, __spreadValues, __spreadProps } from './chunk-MRXNTQOX.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
|
-
import { X } from 'lucide-react';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var Dialog = DialogPrimitive.Root;
|
|
9
|
-
var DialogTrigger = DialogPrimitive.Trigger;
|
|
10
|
-
var DialogPortal = (_a) => {
|
|
11
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
12
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, __spreadValues({
|
|
13
|
-
className: cn(className)
|
|
14
|
-
}, props));
|
|
15
|
-
};
|
|
16
|
-
DialogPortal.displayName = DialogPrimitive.Portal.displayName;
|
|
17
|
-
var DialogOverlay = React.forwardRef((_a, ref) => {
|
|
18
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
19
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, __spreadValues({
|
|
20
|
-
ref,
|
|
21
|
-
className: cn(
|
|
22
|
-
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
23
|
-
className
|
|
24
|
-
)
|
|
25
|
-
}, props));
|
|
26
|
-
});
|
|
27
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
28
|
-
var DialogContent = React.forwardRef((_a, ref) => {
|
|
29
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
30
|
-
return /* @__PURE__ */ jsxs(DialogPortal, {
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
33
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Content, __spreadProps(__spreadValues({
|
|
34
|
-
ref,
|
|
35
|
-
className: cn(
|
|
36
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
|
|
37
|
-
className
|
|
38
|
-
)
|
|
39
|
-
}, props), {
|
|
40
|
-
children: [
|
|
41
|
-
children,
|
|
42
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, {
|
|
43
|
-
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsx(X, {
|
|
46
|
-
className: "h-4 w-4"
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ jsx("span", {
|
|
49
|
-
className: "sr-only",
|
|
50
|
-
children: "Close"
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
}))
|
|
56
|
-
]
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
60
|
-
var DialogHeader = (_a) => {
|
|
61
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
62
|
-
return /* @__PURE__ */ jsx("div", __spreadValues({
|
|
63
|
-
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className)
|
|
64
|
-
}, props));
|
|
65
|
-
};
|
|
66
|
-
DialogHeader.displayName = "DialogHeader";
|
|
67
|
-
var DialogFooter = (_a) => {
|
|
68
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
69
|
-
return /* @__PURE__ */ jsx("div", __spreadValues({
|
|
70
|
-
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
71
|
-
}, props));
|
|
72
|
-
};
|
|
73
|
-
DialogFooter.displayName = "DialogFooter";
|
|
74
|
-
var DialogTitle = React.forwardRef((_a, ref) => {
|
|
75
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
76
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Title, __spreadValues({
|
|
77
|
-
ref,
|
|
78
|
-
className: cn("text-lg font-semibold leading-none tracking-tight", className)
|
|
79
|
-
}, props));
|
|
80
|
-
});
|
|
81
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
82
|
-
var DialogDescription = React.forwardRef((_a, ref) => {
|
|
83
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
84
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Description, __spreadValues({
|
|
85
|
-
ref,
|
|
86
|
-
className: cn("text-sm text-muted-foreground", className)
|
|
87
|
-
}, props));
|
|
88
|
-
});
|
|
89
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
90
|
-
|
|
91
|
-
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
92
|
-
//# sourceMappingURL=out.js.map
|
|
93
|
-
//# sourceMappingURL=chunk-PDCIGRCE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/dialog.tsx"],"names":[],"mappings":";;;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,SAAS;AAShB,cAkCI,YAlCJ;AAbF;AAQA,IAAM,SAAyB;AAE/B,IAAM,gBAAgC;AAEtC,IAAM,eAAe,CAAC,OAA4D;AAA5D,eAAE,YAZxB,IAYsB,IAAgB,kBAAhB,IAAgB,CAAd;AACtB,6BAAiB,wBAAhB;AAAA,IAAuB,WAAW,GAAG,SAAS;AAAA,KAAO,MAAO;AAAA;AAE/D,aAAa,cAA8B,uBAAO;AAElD,IAAM,gBAAsB,iBAG1B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YApBL,IAoBG,IAAgB,kBAAhB,IAAgB,CAAd;AACH,6BAAiB,yBAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,KACI,MACN;AAAA,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,gBAAsB,iBAG1B,CAAC,IAAmC,QAAK;AAAxC,eAAE,aAAW,SAnChB,IAmCG,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACd,8BAAC;AAAA,IACC;AAAA,0BAAC,iBAAc;AAAA,MACf,qBAAiB,yBAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,SACI,QANL;AAAA,QAQE;AAAA;AAAA,UACD,qBAAiB,uBAAhB;AAAA,YAAsB,WAAU;AAAA,YAC/B;AAAA,kCAAC;AAAA,gBAAE,WAAU;AAAA,eAAU;AAAA,cACvB,oBAAC;AAAA,gBAAK,WAAU;AAAA,gBAAU;AAAA,eAAK;AAAA;AAAA,WACjC;AAAA;AAAA,QACF;AAAA;AAAA,GACF;AAAA,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,eAAe,CAAC,OAA+D;AAA/D,eAAE,YAxDxB,IAwDsB,IAAgB,kBAAhB,IAAgB,CAAd;AACtB,6BAAC;AAAA,IAAI,WAAW,GAAG,sDAAsD,SAAS;AAAA,KAAO,MAAO;AAAA;AAElG,aAAa,cAAc;AAE3B,IAAM,eAAe,CAAC,OAA+D;AAA/D,eAAE,YA7DxB,IA6DsB,IAAgB,kBAAhB,IAAgB,CAAd;AACtB,6BAAC;AAAA,IACC,WAAW,GAAG,iEAAiE,SAAS;AAAA,KACpF,MACN;AAAA;AAEF,aAAa,cAAc;AAE3B,IAAM,cAAoB,iBAGxB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAxEL,IAwEG,IAAgB,kBAAhB,IAAgB,CAAd;AACH,6BAAiB,uBAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,KACxE,MACN;AAAA,CACD;AACD,YAAY,cAA8B,sBAAM;AAEhD,IAAM,oBAA0B,iBAG9B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YApFL,IAoFG,IAAgB,kBAAhB,IAAgB,CAAd;AACH,6BAAiB,6BAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,KACpD,MACN;AAAA,CACD;AACD,kBAAkB,cAA8B,4BAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ className, ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal className={cn(className)} {...props} />\n);\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"]}
|
package/dist/chunk-QRKKPCUD.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createContext, useState, useContext } from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
// src/components/hovering-toolbar/hovering-editor-provider.tsx
|
|
5
|
-
var HoveringEditorContext = createContext({
|
|
6
|
-
isDisplayed: false,
|
|
7
|
-
setIsDisplayed: () => {
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
var HoveringEditorProvider = ({ children }) => {
|
|
11
|
-
const [isDisplayed, setIsDisplayed] = useState(false);
|
|
12
|
-
return /* @__PURE__ */ jsx(HoveringEditorContext.Provider, {
|
|
13
|
-
value: { isDisplayed, setIsDisplayed },
|
|
14
|
-
children
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var useHoveringEditorContext = () => useContext(HoveringEditorContext);
|
|
18
|
-
|
|
19
|
-
export { HoveringEditorProvider, useHoveringEditorContext };
|
|
20
|
-
//# sourceMappingURL=out.js.map
|
|
21
|
-
//# sourceMappingURL=chunk-QRKKPCUD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/hovering-toolbar/hovering-editor-provider.tsx"],"names":[],"mappings":";AAAA,SAAgB,eAAe,UAAU,kBAA6B;AAoBlE;AAbJ,IAAM,wBAAwB,cAA0C;AAAA,EACtE,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AACzB,CAAC;AAMM,IAAM,yBAAyB,CAAC,EAAE,SAAS,MAAmC;AACnF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,SACE,oBAAC,sBAAsB,UAAtB;AAAA,IAA+B,OAAO,EAAE,aAAa,eAAe;AAAA,IAClE;AAAA,GACH;AAEJ;AAEO,IAAM,2BAA2B,MAAM,WAAW,qBAAqB","sourcesContent":["import React, { createContext, useState, useContext, ReactNode } from \"react\";\n\ninterface HoveringEditorContextProps {\n isDisplayed: boolean;\n setIsDisplayed: (value: boolean) => void;\n}\n\nconst HoveringEditorContext = createContext<HoveringEditorContextProps>({\n isDisplayed: false,\n setIsDisplayed: () => {},\n});\n\ninterface HoveringEditorProviderProps {\n children: ReactNode;\n}\n\nexport const HoveringEditorProvider = ({ children }: HoveringEditorProviderProps) => {\n const [isDisplayed, setIsDisplayed] = useState(false);\n\n return (\n <HoveringEditorContext.Provider value={{ isDisplayed, setIsDisplayed }}>\n {children}\n </HoveringEditorContext.Provider>\n );\n};\n\nexport const useHoveringEditorContext = () => useContext(HoveringEditorContext);\n"]}
|
package/dist/chunk-RBR32FWA.mjs
DELETED
|
@@ -1,74 +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 following external context is also provided. Use it to help you make better suggestions!!!
|
|
9
|
-
\`\`\`
|
|
10
|
-
${contextString}
|
|
11
|
-
\`\`\`
|
|
12
|
-
|
|
13
|
-
The user also provides you with a prompt for INSERTIONS into the text they are writing.
|
|
14
|
-
Your job is to come up with an INSERTION into the text that the user would like AS BEST YOU CAN.
|
|
15
|
-
Only insert a SHORT segment. Usually 1 sentence, or at most 1 paragraph.
|
|
16
|
-
|
|
17
|
-
Adjust yourself to the user's style and implied intent.
|
|
18
|
-
|
|
19
|
-
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.
|
|
20
|
-
<TextAfterCursor>
|
|
21
|
-
<TextBeforeCursor>
|
|
22
|
-
<InsertionPrompt>
|
|
23
|
-
<YourSuggestion>
|
|
24
|
-
`;
|
|
25
|
-
};
|
|
26
|
-
var defaultInsertionsFewShotMessages = [
|
|
27
|
-
{
|
|
28
|
-
role: "user",
|
|
29
|
-
name: "TextAfterCursor",
|
|
30
|
-
content: "While I was there I also picked up some apples, oranges, and bananas."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
role: "user",
|
|
34
|
-
name: "TextBeforeCursor",
|
|
35
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
role: "user",
|
|
39
|
-
name: "InsertionPrompt",
|
|
40
|
-
content: "I bought a big watermelon"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
role: "assistant",
|
|
44
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
role: "user",
|
|
48
|
-
name: "TextAfterCursor",
|
|
49
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
role: "user",
|
|
53
|
-
name: "TextBeforeCursor",
|
|
54
|
-
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;`
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
role: "user",
|
|
58
|
-
name: "InsertionPrompt",
|
|
59
|
-
content: "add section about the optionholder's pro rata share"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
role: "assistant",
|
|
63
|
-
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"; `
|
|
64
|
-
}
|
|
65
|
-
];
|
|
66
|
-
var defaultInsertionsApiConfig = {
|
|
67
|
-
makeSystemPrompt: defaultInsertionsMakeSystemPrompt,
|
|
68
|
-
fewShotMessages: defaultInsertionsFewShotMessages,
|
|
69
|
-
forwardedParams: void 0
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export { defaultInsertionsApiConfig, defaultInsertionsFewShotMessages, defaultInsertionsMakeSystemPrompt };
|
|
73
|
-
//# sourceMappingURL=out.js.map
|
|
74
|
-
//# sourceMappingURL=chunk-RBR32FWA.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,EAIlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeF;AAEO,IAAM,mCAA4D;AAAA,EACvE;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,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 following external context is also provided. Use it to help you make better suggestions!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\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 insert a SHORT segment. 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`;\n};\n\nexport const defaultInsertionsFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content: \"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"]}
|