@copilotkit/react-textarea 0.19.0-alpha.4 → 0.19.0-alpha.5
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 +129 -190
- package/CHANGELOG.md +10 -0
- package/dist/chunk-2NURR2DX.mjs +47 -0
- package/dist/chunk-2NURR2DX.mjs.map +1 -0
- package/dist/chunk-4HSJ5XUO.mjs +107 -0
- package/dist/chunk-4HSJ5XUO.mjs.map +1 -0
- package/dist/chunk-4S5ZJH3I.mjs +18 -0
- package/dist/chunk-4S5ZJH3I.mjs.map +1 -0
- package/dist/chunk-55EGOC5T.mjs +87 -0
- package/dist/chunk-55EGOC5T.mjs.map +1 -0
- package/dist/chunk-5ARCOTW3.mjs +34 -0
- package/dist/chunk-5ARCOTW3.mjs.map +1 -0
- package/dist/chunk-5EJ5XOGP.mjs +22 -0
- package/dist/chunk-5EJ5XOGP.mjs.map +1 -0
- package/dist/chunk-5FO6ISW4.mjs +3 -0
- package/dist/chunk-5FO6ISW4.mjs.map +1 -0
- package/dist/chunk-6Z6Z2K7O.mjs +20 -0
- package/dist/chunk-6Z6Z2K7O.mjs.map +1 -0
- package/dist/chunk-7PSM4AUU.mjs +201 -0
- package/dist/chunk-7PSM4AUU.mjs.map +1 -0
- package/dist/chunk-A2RRLD23.mjs +69 -0
- package/dist/chunk-A2RRLD23.mjs.map +1 -0
- package/dist/chunk-CSGFJU3L.mjs +65 -0
- package/dist/chunk-CSGFJU3L.mjs.map +1 -0
- package/dist/chunk-D7SEV5PR.mjs +12 -0
- package/dist/chunk-D7SEV5PR.mjs.map +1 -0
- package/dist/chunk-DE5K76I2.mjs +3 -0
- package/dist/chunk-DE5K76I2.mjs.map +1 -0
- package/dist/chunk-F3MHL6ZY.mjs +25 -0
- package/dist/chunk-F3MHL6ZY.mjs.map +1 -0
- package/dist/chunk-FN7GDKKG.mjs +29 -0
- package/dist/chunk-FN7GDKKG.mjs.map +1 -0
- package/dist/chunk-GQJYEVBT.mjs +461 -0
- package/dist/chunk-GQJYEVBT.mjs.map +1 -0
- package/dist/chunk-H4VKQGVU.mjs +3 -0
- package/dist/chunk-H4VKQGVU.mjs.map +1 -0
- package/dist/chunk-HAFHLU4N.mjs +55 -0
- package/dist/chunk-HAFHLU4N.mjs.map +1 -0
- package/dist/chunk-IU3WTXLQ.mjs +3 -0
- package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
- package/dist/chunk-IXJ2HCOA.mjs +101 -0
- package/dist/chunk-IXJ2HCOA.mjs.map +1 -0
- package/dist/chunk-JAFCXEPU.mjs +10 -0
- package/dist/chunk-JAFCXEPU.mjs.map +1 -0
- package/dist/chunk-KCHYD3EB.mjs +107 -0
- package/dist/chunk-KCHYD3EB.mjs.map +1 -0
- package/dist/chunk-KGKLUWKW.mjs +47 -0
- package/dist/chunk-KGKLUWKW.mjs.map +1 -0
- package/dist/chunk-L7VVZH4Q.mjs +3 -0
- package/dist/chunk-L7VVZH4Q.mjs.map +1 -0
- package/dist/chunk-LNAIMEB2.mjs +34 -0
- package/dist/chunk-LNAIMEB2.mjs.map +1 -0
- package/dist/chunk-MMVDU6DF.mjs +3 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/chunk-MPME5BW2.mjs +59 -0
- package/dist/chunk-MPME5BW2.mjs.map +1 -0
- package/dist/chunk-MRXNTQOX.mjs +55 -0
- package/dist/chunk-MRXNTQOX.mjs.map +1 -0
- package/dist/chunk-ND5PXTAW.mjs +17 -0
- package/dist/chunk-ND5PXTAW.mjs.map +1 -0
- package/dist/chunk-NKW5OU2S.mjs +33 -0
- package/dist/chunk-NKW5OU2S.mjs.map +1 -0
- package/dist/chunk-O5OWT5GE.mjs +114 -0
- package/dist/chunk-O5OWT5GE.mjs.map +1 -0
- package/dist/chunk-OD7ZMOVE.mjs +45 -0
- package/dist/chunk-OD7ZMOVE.mjs.map +1 -0
- package/dist/chunk-OELUUJZY.mjs +16 -0
- package/dist/chunk-OELUUJZY.mjs.map +1 -0
- package/dist/chunk-PHFEZQTN.mjs +44 -0
- package/dist/chunk-PHFEZQTN.mjs.map +1 -0
- package/dist/chunk-QL2GYGG5.mjs +19 -0
- package/dist/chunk-QL2GYGG5.mjs.map +1 -0
- package/dist/chunk-RQHOUUXQ.mjs +29 -0
- package/dist/chunk-RQHOUUXQ.mjs.map +1 -0
- package/dist/chunk-UHD44NC5.mjs +101 -0
- package/dist/chunk-UHD44NC5.mjs.map +1 -0
- package/dist/chunk-VBIJPE3H.mjs +108 -0
- package/dist/chunk-VBIJPE3H.mjs.map +1 -0
- package/dist/chunk-WADHCMPK.mjs +3 -0
- package/dist/chunk-WADHCMPK.mjs.map +1 -0
- package/dist/chunk-WJHSY5T6.mjs +3 -0
- package/dist/chunk-WJHSY5T6.mjs.map +1 -0
- package/dist/chunk-WJYQWL4I.mjs +27 -0
- package/dist/chunk-WJYQWL4I.mjs.map +1 -0
- package/dist/chunk-XA7M72ZO.mjs +106 -0
- package/dist/chunk-XA7M72ZO.mjs.map +1 -0
- package/dist/chunk-XDT7BF3V.mjs +81 -0
- package/dist/chunk-XDT7BF3V.mjs.map +1 -0
- package/dist/chunk-XHUMROEY.mjs +91 -0
- package/dist/chunk-XHUMROEY.mjs.map +1 -0
- package/dist/chunk-YQU7WG7T.mjs +83 -0
- package/dist/chunk-YQU7WG7T.mjs.map +1 -0
- package/dist/chunk-YTOPHPSG.mjs +45 -0
- package/dist/chunk-YTOPHPSG.mjs.map +1 -0
- package/dist/chunk-YW3REYX6.mjs +23 -0
- package/dist/chunk-YW3REYX6.mjs.map +1 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +33 -1870
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +3 -52
- package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +3 -46
- 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 +4 -86
- 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 +3 -57
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +43 -2339
- package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +3 -22
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +3 -125
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +16 -1015
- 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 +10 -721
- 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 +11 -734
- 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 +12 -734
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
- package/dist/components/index.mjs +44 -2340
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +6 -5
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
- package/dist/components/source-search-box/source-search-box.mjs +10 -323
- package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
- package/dist/components/ui/button.mjs +4 -88
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/card.mjs +7 -53
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/command.mjs +5 -266
- package/dist/components/ui/command.mjs.map +1 -1
- package/dist/components/ui/dialog.mjs +4 -164
- package/dist/components/ui/dialog.mjs.map +1 -1
- package/dist/components/ui/label.mjs +4 -63
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/separator.mjs +8 -50
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/textarea.mjs +7 -48
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +6 -168
- 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 +4 -168
- 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 +5 -155
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +4 -90
- 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 +4 -143
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
- package/dist/hooks/misc/use-autosize-textarea.mjs +3 -15
- package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
- package/dist/index.mjs +48 -2343
- package/dist/index.mjs.map +1 -1
- package/dist/lib/debouncer.mjs +3 -51
- package/dist/lib/debouncer.mjs.map +1 -1
- package/dist/lib/editor-to-text.mjs +3 -43
- package/dist/lib/editor-to-text.mjs.map +1 -1
- package/dist/lib/get-text-around-cursor.mjs +3 -109
- package/dist/lib/get-text-around-cursor.mjs.map +1 -1
- package/dist/lib/retry.mjs +3 -17
- package/dist/lib/retry.mjs.map +1 -1
- package/dist/lib/slatejs-edits/add-autocompletions.mjs +3 -25
- package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +3 -23
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/replace-text.mjs +3 -27
- package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.mjs +3 -106
- package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
- package/dist/lib/stream-promise-flatten.mjs +3 -47
- package/dist/lib/stream-promise-flatten.mjs.map +1 -1
- package/dist/lib/utils.mjs +3 -71
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.mjs +1 -0
- package/dist/lib/utils.test.mjs.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +2 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +9 -312
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +4 -155
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +10 -313
- package/dist/types/autosuggestions-config/index.mjs.map +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +4 -149
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +3 -71
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +2 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs +2 -0
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs +4 -137
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
- package/dist/types/base/autosuggestion-state.mjs +2 -0
- package/dist/types/base/autosuggestion-state.mjs.map +1 -1
- package/dist/types/base/autosuggestions-bare-function.mjs +2 -0
- package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -1
- package/dist/types/base/base-autosuggestions-config.mjs +3 -11
- package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
- package/dist/types/base/base-copilot-textarea-props.mjs +2 -0
- package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -1
- package/dist/types/base/custom-editor.mjs +2 -0
- package/dist/types/base/custom-editor.mjs.map +1 -1
- package/dist/types/base/editor-autocomplete-state.mjs +4 -17
- package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
- package/dist/types/base/index.mjs +4 -11
- package/dist/types/base/index.mjs.map +1 -1
- package/dist/types/html-copilot-textarea-element.mjs +2 -0
- package/dist/types/html-copilot-textarea-element.mjs.map +1 -1
- package/dist/types/index.mjs +12 -314
- package/dist/types/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +0 -13
- package/dist/components/base-copilot-textarea/render-element.d.ts +0 -6
- package/dist/components/base-copilot-textarea/render-placeholder.d.ts +0 -6
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.ts +0 -6
- package/dist/components/base-copilot-textarea/use-add-branding-css.d.ts +0 -3
- package/dist/components/copilot-textarea/copilot-textarea.d.ts +0 -20
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +0 -13
- package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +0 -18
- package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +0 -8
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +0 -29
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +0 -12
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.d.ts +0 -3
- package/dist/components/index.d.ts +0 -15
- package/dist/components/manual-ui/chip-with-icon.d.ts +0 -10
- package/dist/components/source-search-box/source-search-box.d.ts +0 -17
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/card.d.ts +0 -10
- package/dist/components/ui/command.d.ts +0 -48
- package/dist/components/ui/dialog.d.ts +0 -18
- package/dist/components/ui/label.d.ts +0 -8
- package/dist/components/ui/separator.d.ts +0 -6
- package/dist/components/ui/textarea.d.ts +0 -7
- package/dist/context/index.d.ts +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.ts +0 -13
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.d.ts +0 -8
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.ts +0 -7
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.ts +0 -22
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.d.ts +0 -23
- package/dist/hooks/misc/use-autosize-textarea.d.ts +0 -5
- package/dist/index.d.ts +0 -15
- package/dist/lib/debouncer.d.ts +0 -11
- package/dist/lib/editor-to-text.d.ts +0 -7
- package/dist/lib/get-text-around-cursor.d.ts +0 -15
- package/dist/lib/retry.d.ts +0 -3
- package/dist/lib/slatejs-edits/add-autocompletions.d.ts +0 -8
- package/dist/lib/slatejs-edits/clear-autocompletions.d.ts +0 -8
- package/dist/lib/slatejs-edits/replace-text.d.ts +0 -5
- package/dist/lib/slatejs-edits/with-partial-history.d.ts +0 -10
- package/dist/lib/stream-promise-flatten.d.ts +0 -3
- package/dist/lib/utils.d.ts +0 -10
- package/dist/lib/utils.test.d.ts +0 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +0 -25
- package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +0 -20
- package/dist/types/autosuggestions-config/editing-api-config.d.ts +0 -17
- package/dist/types/autosuggestions-config/index.d.ts +0 -10
- package/dist/types/autosuggestions-config/insertions-api-config.d.ts +0 -17
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.d.ts +0 -26
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +0 -3
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.d.ts +0 -7
- package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +0 -17
- package/dist/types/base/autosuggestion-state.d.ts +0 -8
- package/dist/types/base/autosuggestions-bare-function.d.ts +0 -17
- package/dist/types/base/base-autosuggestions-config.d.ts +0 -14
- package/dist/types/base/base-copilot-textarea-props.d.ts +0 -40
- package/dist/types/base/custom-editor.d.ts +0 -29
- package/dist/types/base/editor-autocomplete-state.d.ts +0 -10
- package/dist/types/base/index.d.ts +0 -4
- package/dist/types/html-copilot-textarea-element.d.ts +0 -7
- package/dist/types/index.d.ts +0 -13
package/dist/types/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/base/base-autosuggestions-config.tsx","../../src/types/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx","../../src/types/autosuggestions-config/suggestions-api-config.tsx","../../src/types/autosuggestions-config/insertions-api-config.tsx","../../src/types/autosuggestions-config/editing-api-config.tsx","../../src/types/autosuggestions-config/autosuggestions-config.tsx"],"sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\n\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n debounceTime: number;\n acceptAutosuggestionKey: string;\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n apiConfig: BaseCopilotTextareaApiConfig;\n}\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n acceptAutosuggestionKey: \"Tab\",\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n};\n","import { MinimalChatGPTMessage } from \"./minimal-chat-gpt-message\";\n\nexport type ChatlikeApiEndpointImpl = (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n) => Promise<string>;\n\nexport type StreamingChatlikeApiEndpointImpl = (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n) => Promise<ReadableStream<string>>;\n\nexport class ChatlikeApiEndpoint {\n public run: StreamingChatlikeApiEndpointImpl;\n\n constructor(run: StreamingChatlikeApiEndpointImpl) {\n this.run = run;\n }\n\n /**\n * Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.\n * @param apiEndpoint The URL of the OpenAI-compatible API endpoint.\n * @returns A new instance of ChatlikeApiEndpoint.\n */\n static standardOpenAIEndpoint(apiEndpoint: string): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(\n async (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n ) => {\n const res = await fetch(apiEndpoint, {\n method: \"POST\",\n body: JSON.stringify({\n ...forwardedProps,\n messages: messages,\n }),\n signal: abortSignal,\n });\n\n const bodySteram: ReadableStream<Uint8Array> | null = res.body;\n if (!bodySteram) {\n throw new Error(\"The response body is empty.\");\n }\n\n // map the stream to a stream of strings\n const stringStream = bodySteram.pipeThrough(new TextDecoderStream());\n\n return stringStream;\n }\n );\n }\n\n /**\n * Creates a fully customized instance of ChatlikeApiEndpoint.\n * @param run - The implementation of the ChatlikeApiEndpointImpl interface.\n * @returns A new instance of ChatlikeApiEndpoint .\n */\n static custom(run: StreamingChatlikeApiEndpointImpl): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(run);\n }\n}\n","import { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\nimport { ChatlikeApiEndpoint } from \"./subtypes/chatlike-api-endpoint\";\n\nexport interface SuggestionsApiConfig {\n apiEndpoint: ChatlikeApiEndpoint;\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:\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: \"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 apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(\n \"/api/copilotkit_chatlike\"\n ),\n makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,\n fewShotMessages: defaultSuggestionsFewShotMessages,\n forwardedParams: undefined,\n};\n","import { ChatlikeApiEndpoint } from \"./subtypes/chatlike-api-endpoint\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\nimport { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\n\nexport interface InsertionsApiConfig {\n apiEndpoint: ChatlikeApiEndpoint;\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 apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(\n \"/api/copilotkit_chatlike\"\n ),\n makeSystemPrompt: defaultInsertionsMakeSystemPrompt,\n fewShotMessages: defaultInsertionsFewShotMessages,\n forwardedParams: undefined,\n};\n","import { ChatlikeApiEndpoint } from \"./subtypes/chatlike-api-endpoint\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\nimport { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\n\nexport interface EditingApiConfig {\n apiEndpoint: ChatlikeApiEndpoint;\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultEditingMakeSystemPrompt: 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 EDITING some text they are writing. \nYour job is to come up with an EDIT of the text that the user would like to use - AS BEST YOU CAN.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide the following information; use this to infer the best relevant EDIT:\n<TextBeforeCursor>\n<TextToEdit>\n<TextAfterCursor>\n<EditingPrompt>\n\n<YourEditSuggestion>\n\nIf we need to add a whitespace character to the suggested edit 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 defaultEditingFewShotMessages: MinimalChatGPTMessage[] = [\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: \"TextToEdit\",\n content:\n \"While I was there I also picked up some apples, oranges, and bananas. \",\n },\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"The grocery store was having a sale on fruit, so I decided to stock up.\",\n },\n {\n role: \"user\",\n name: \"EditingPrompt\",\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 defaultEditingApiConfig: EditingApiConfig = {\n apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(\n \"/api/copilotkit_chatlike\"\n ),\n makeSystemPrompt: defaultEditingMakeSystemPrompt,\n fewShotMessages: defaultEditingFewShotMessages,\n forwardedParams: undefined,\n};\n","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"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.19.0-alpha.
|
|
7
|
+
"version": "0.19.0-alpha.5",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"**/*.css"
|
|
10
10
|
],
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"tsup": "^6.1.3",
|
|
34
34
|
"typescript": "^4.9.4",
|
|
35
35
|
"eslint-config-custom": "0.2.0",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"tsconfig": "0.4.0-alpha.0",
|
|
37
|
+
"tailwind-config": "0.1.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@emotion/css": "^11.11.2",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { BaseCopilotTextareaProps } from '../../types/base/base-copilot-textarea-props.js';
|
|
3
|
-
import '../../types/base/base-autosuggestions-config.js';
|
|
4
|
-
import '../../types/base/autosuggestions-bare-function.js';
|
|
5
|
-
|
|
6
|
-
interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
7
|
-
value: string;
|
|
8
|
-
focus: () => void;
|
|
9
|
-
blur: () => void;
|
|
10
|
-
}
|
|
11
|
-
declare const BaseCopilotTextarea: React__default.ForwardRefExoticComponent<BaseCopilotTextareaProps & React__default.RefAttributes<HTMLCopilotTextAreaElement>>;
|
|
12
|
-
|
|
13
|
-
export { BaseCopilotTextarea, HTMLCopilotTextAreaElement };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RenderElementProps } from 'slate-react';
|
|
2
|
-
|
|
3
|
-
type RenderElementFunction = (props: RenderElementProps) => JSX.Element;
|
|
4
|
-
declare function makeRenderElementFunction(suggestionsStyle: React.CSSProperties): RenderElementFunction;
|
|
5
|
-
|
|
6
|
-
export { RenderElementFunction, makeRenderElementFunction };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RenderPlaceholderProps } from 'slate-react';
|
|
2
|
-
|
|
3
|
-
type RenderPlaceholderFunction = (props: RenderPlaceholderProps) => JSX.Element;
|
|
4
|
-
declare function makeRenderPlaceholderFunction(placeholderStyle?: React.CSSProperties): RenderPlaceholderFunction;
|
|
5
|
-
|
|
6
|
-
export { RenderPlaceholderFunction, makeRenderPlaceholderFunction };
|
package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
interface TrackerTextEditedSinceLastCursorMovementProps {
|
|
2
|
-
setCursorMovedSinceLastTextChange: (value: boolean) => void;
|
|
3
|
-
}
|
|
4
|
-
declare function TrackerTextEditedSinceLastCursorMovement(props: TrackerTextEditedSinceLastCursorMovementProps): JSX.Element;
|
|
5
|
-
|
|
6
|
-
export { TrackerTextEditedSinceLastCursorMovement };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { BaseCopilotTextareaProps } from '../../types/base/base-copilot-textarea-props.js';
|
|
3
|
-
import { HTMLCopilotTextAreaElement } from '../../types/html-copilot-textarea-element.js';
|
|
4
|
-
import { AutosuggestionsConfigUserSpecified } from '../../types/autosuggestions-config/autosuggestions-config-user-specified.js';
|
|
5
|
-
import '../../types/base/base-autosuggestions-config.js';
|
|
6
|
-
import '../../types/base/autosuggestions-bare-function.js';
|
|
7
|
-
import '../../types/autosuggestions-config/autosuggestions-config.js';
|
|
8
|
-
import '../../types/autosuggestions-config/suggestions-api-config.js';
|
|
9
|
-
import '../../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
|
|
10
|
-
import '../../types/autosuggestions-config/subtypes/make-system-prompt.js';
|
|
11
|
-
import '../../types/autosuggestions-config/subtypes/chatlike-api-endpoint.js';
|
|
12
|
-
import '../../types/autosuggestions-config/insertions-api-config.js';
|
|
13
|
-
import '../../types/autosuggestions-config/editing-api-config.js';
|
|
14
|
-
|
|
15
|
-
interface CopilotTextareaProps extends Omit<BaseCopilotTextareaProps, "baseAutosuggestionsConfig"> {
|
|
16
|
-
autosuggestionsConfig: AutosuggestionsConfigUserSpecified;
|
|
17
|
-
}
|
|
18
|
-
declare const CopilotTextarea: React__default.ForwardRefExoticComponent<CopilotTextareaProps & React__default.RefAttributes<HTMLCopilotTextAreaElement>>;
|
|
19
|
-
|
|
20
|
-
export { CopilotTextarea, CopilotTextareaProps };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
interface HoveringEditorContextProps {
|
|
4
|
-
isDisplayed: boolean;
|
|
5
|
-
setIsDisplayed: (value: boolean) => void;
|
|
6
|
-
}
|
|
7
|
-
interface HoveringEditorProviderProps {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
declare const HoveringEditorProvider: ({ children, }: HoveringEditorProviderProps) => JSX.Element;
|
|
11
|
-
declare const useHoveringEditorContext: () => HoveringEditorContextProps;
|
|
12
|
-
|
|
13
|
-
export { HoveringEditorProvider, useHoveringEditorContext };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
|
|
3
|
-
interface BaseProps {
|
|
4
|
-
className: string;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}
|
|
7
|
-
declare const Button: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<{
|
|
8
|
-
active: boolean;
|
|
9
|
-
reversed: boolean;
|
|
10
|
-
} & BaseProps>, "ref"> & React__default.RefAttributes<HTMLSpanElement>>;
|
|
11
|
-
declare const Icon: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<BaseProps>, "ref"> & React__default.RefAttributes<HTMLSpanElement>>;
|
|
12
|
-
declare const Menu: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<BaseProps>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
declare const Portal: ({ children }: {
|
|
14
|
-
children: React__default.ReactNode;
|
|
15
|
-
}) => React__default.ReactPortal | null;
|
|
16
|
-
declare const Toolbar: React__default.ForwardRefExoticComponent<Omit<React__default.PropsWithChildren<BaseProps>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
|
|
18
|
-
export { Button, Icon, Menu, Portal, Toolbar };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { InsertionEditorApiConfig } from '../../types/base/autosuggestions-bare-function.js';
|
|
2
|
-
|
|
3
|
-
interface HoveringToolbarProps {
|
|
4
|
-
apiConfig: InsertionEditorApiConfig;
|
|
5
|
-
}
|
|
6
|
-
declare const HoveringToolbar: (props: HoveringToolbarProps) => JSX.Element | null;
|
|
7
|
-
|
|
8
|
-
export { HoveringToolbar, HoveringToolbarProps };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { EditingEditorState, Generator_InsertionOrEditingSuggestion } from '../../../types/base/autosuggestions-bare-function.js';
|
|
2
|
-
import { FilePointer } from '../../source-search-box/source-search-box.js';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
|
|
5
|
-
type SuggestionState = {
|
|
6
|
-
editorState: EditingEditorState;
|
|
7
|
-
};
|
|
8
|
-
interface HoveringInsertionPromptBoxCoreProps {
|
|
9
|
-
state: SuggestionState;
|
|
10
|
-
performInsertion: (insertedText: string) => void;
|
|
11
|
-
insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;
|
|
12
|
-
}
|
|
13
|
-
declare const HoveringInsertionPromptBoxCore: React__default.FC<HoveringInsertionPromptBoxCoreProps>;
|
|
14
|
-
interface IncludedFilesPreviewProps {
|
|
15
|
-
includedFiles: FilePointer[];
|
|
16
|
-
setIncludedFiles: React__default.Dispatch<React__default.SetStateAction<FilePointer[]>>;
|
|
17
|
-
}
|
|
18
|
-
declare const IncludedFilesPreview: React__default.FC<IncludedFilesPreviewProps>;
|
|
19
|
-
interface FileChipPreviewProp {
|
|
20
|
-
filePointer: FilePointer;
|
|
21
|
-
onDelete: () => void;
|
|
22
|
-
}
|
|
23
|
-
declare const FileChipPreview: React__default.FC<FileChipPreviewProp>;
|
|
24
|
-
declare function IconForFilePointer({ filePointer, className, }: {
|
|
25
|
-
filePointer: FilePointer;
|
|
26
|
-
className: string;
|
|
27
|
-
}): JSX.Element;
|
|
28
|
-
|
|
29
|
-
export { FileChipPreview, FileChipPreviewProp, HoveringInsertionPromptBoxCore, HoveringInsertionPromptBoxCoreProps, IconForFilePointer, IncludedFilesPreview, SuggestionState };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { EditingEditorState, InsertionEditorApiConfig } from '../../../types/base/autosuggestions-bare-function.js';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
editorState: EditingEditorState;
|
|
6
|
-
apiConfig: InsertionEditorApiConfig;
|
|
7
|
-
performInsertion: (insertedText: string) => void;
|
|
8
|
-
closeWindow: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const HoveringInsertionPromptBox: React__default.FC<Props>;
|
|
11
|
-
|
|
12
|
-
export { HoveringInsertionPromptBox, Props };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { BaseCopilotTextarea } from './base-copilot-textarea/base-copilot-textarea.js';
|
|
2
|
-
export { CopilotTextarea, CopilotTextareaProps } from './copilot-textarea/copilot-textarea.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '../types/base/base-copilot-textarea-props.js';
|
|
5
|
-
import '../types/base/base-autosuggestions-config.js';
|
|
6
|
-
import '../types/base/autosuggestions-bare-function.js';
|
|
7
|
-
import '../types/html-copilot-textarea-element.js';
|
|
8
|
-
import '../types/autosuggestions-config/autosuggestions-config-user-specified.js';
|
|
9
|
-
import '../types/autosuggestions-config/autosuggestions-config.js';
|
|
10
|
-
import '../types/autosuggestions-config/suggestions-api-config.js';
|
|
11
|
-
import '../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
|
|
12
|
-
import '../types/autosuggestions-config/subtypes/make-system-prompt.js';
|
|
13
|
-
import '../types/autosuggestions-config/subtypes/chatlike-api-endpoint.js';
|
|
14
|
-
import '../types/autosuggestions-config/insertions-api-config.js';
|
|
15
|
-
import '../types/autosuggestions-config/editing-api-config.js';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface FilePointer {
|
|
2
|
-
name: string;
|
|
3
|
-
sourceApplication: string;
|
|
4
|
-
getContents: () => Promise<string>;
|
|
5
|
-
}
|
|
6
|
-
interface SourceSearchBoxProps {
|
|
7
|
-
searchTerm: string;
|
|
8
|
-
recentFiles: FilePointer[];
|
|
9
|
-
onSelectedFile: (filePointer: FilePointer) => void;
|
|
10
|
-
}
|
|
11
|
-
declare function SourceSearchBox(props: SourceSearchBoxProps): JSX.Element;
|
|
12
|
-
declare function Logo({ children, size, }: {
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
size?: string;
|
|
15
|
-
}): JSX.Element;
|
|
16
|
-
|
|
17
|
-
export { FilePointer, Logo, SourceSearchBox, SourceSearchBoxProps };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
-
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
7
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
8
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
9
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
|
-
asChild?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
-
|
|
14
|
-
export { Button, ButtonProps, buttonVariants };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
-
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
-
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
|
|
10
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { DialogProps } from '@radix-ui/react-dialog';
|
|
3
|
-
|
|
4
|
-
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
} & React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
label?: string | undefined;
|
|
8
|
-
shouldFilter?: boolean | undefined;
|
|
9
|
-
filter?: ((value: string, search: string) => number) | undefined;
|
|
10
|
-
value?: string | undefined;
|
|
11
|
-
onValueChange?: ((value: string) => void) | undefined;
|
|
12
|
-
loop?: boolean | undefined;
|
|
13
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
interface CommandDialogProps extends DialogProps {
|
|
15
|
-
}
|
|
16
|
-
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => JSX.Element;
|
|
17
|
-
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "type"> & {
|
|
18
|
-
value?: string | undefined;
|
|
19
|
-
onValueChange?: ((search: string) => void) | undefined;
|
|
20
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
-
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
-
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
25
|
-
children?: React.ReactNode;
|
|
26
|
-
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
-
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
28
|
-
children?: React.ReactNode;
|
|
29
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "heading"> & {
|
|
30
|
-
heading?: React.ReactNode;
|
|
31
|
-
value?: string | undefined;
|
|
32
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
-
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
|
|
34
|
-
alwaysRender?: boolean | undefined;
|
|
35
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
-
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
37
|
-
children?: React.ReactNode;
|
|
38
|
-
} & Omit<React.HTMLAttributes<HTMLDivElement>, "disabled" | "value" | "onSelect"> & {
|
|
39
|
-
disabled?: boolean | undefined;
|
|
40
|
-
onSelect?: ((value: string) => void) | undefined;
|
|
41
|
-
value?: string | undefined;
|
|
42
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
-
declare const CommandShortcut: {
|
|
44
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX.Element;
|
|
45
|
-
displayName: string;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
|
|
4
|
-
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
5
|
-
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
declare const DialogHeader: {
|
|
8
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
11
|
-
declare const DialogFooter: {
|
|
12
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
};
|
|
15
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
17
|
-
|
|
18
|
-
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
7
|
-
|
|
8
|
-
export { Label };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
-
|
|
4
|
-
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
|
|
6
|
-
export { Separator };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
-
}
|
|
5
|
-
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
6
|
-
|
|
7
|
-
export { Textarea, TextareaProps };
|
package/dist/context/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AutosuggestionsBareFunction } from '../../types/base/autosuggestions-bare-function.js';
|
|
2
|
-
import { AutosuggestionState } from '../../types/base/autosuggestion-state.js';
|
|
3
|
-
import { EditorAutocompleteState } from '../../types/base/editor-autocomplete-state.js';
|
|
4
|
-
import 'slate';
|
|
5
|
-
|
|
6
|
-
interface UseAutosuggestionsResult {
|
|
7
|
-
currentAutocompleteSuggestion: AutosuggestionState | null;
|
|
8
|
-
onChangeHandler: (newEditorState: EditorAutocompleteState | null) => void;
|
|
9
|
-
onKeyDownHandler: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
10
|
-
}
|
|
11
|
-
declare function useAutosuggestions(debounceTime: number, acceptAutosuggestionKey: string, autosuggestionFunction: AutosuggestionsBareFunction, insertAutocompleteSuggestion: (suggestion: AutosuggestionState) => void, disableWhenEmpty: boolean, disabled: boolean): UseAutosuggestionsResult;
|
|
12
|
-
|
|
13
|
-
export { UseAutosuggestionsResult, useAutosuggestions };
|
package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { Editor } from 'slate';
|
|
3
|
-
import { HTMLCopilotTextAreaElement } from '../../types/html-copilot-textarea-element.js';
|
|
4
|
-
|
|
5
|
-
declare function usePopulateCopilotTextareaRef(editor: Editor, ref: React__default.Ref<HTMLCopilotTextAreaElement>): void;
|
|
6
|
-
|
|
7
|
-
export { usePopulateCopilotTextareaRef };
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AutosuggestionsBareFunction } from '../../types/base/autosuggestions-bare-function.js';
|
|
2
|
-
import { SuggestionsApiConfig } from '../../types/autosuggestions-config/suggestions-api-config.js';
|
|
3
|
-
import '../../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
|
|
4
|
-
import '../../types/autosuggestions-config/subtypes/make-system-prompt.js';
|
|
5
|
-
import '../../types/autosuggestions-config/subtypes/chatlike-api-endpoint.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
|
|
9
|
-
* The function takes in the text before and after the cursor, and an abort signal.
|
|
10
|
-
* It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.
|
|
11
|
-
* The function returns the suggestion from the API response.
|
|
12
|
-
*
|
|
13
|
-
* @param textareaPurpose - The purpose of the textarea. This is included in the system message.
|
|
14
|
-
* @param apiEndpoint - The API endpoint to send the autosuggestion request to.
|
|
15
|
-
* @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.
|
|
16
|
-
* @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.
|
|
17
|
-
* @param contextCategories - The categories of context strings we want to include. By default, we include the (default) "global" context category.
|
|
18
|
-
* @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
|
|
19
|
-
*/
|
|
20
|
-
declare function useMakeStandardAutosuggestionFunction(textareaPurpose: string, contextCategories: string[] | undefined, apiConfig: SuggestionsApiConfig): AutosuggestionsBareFunction;
|
|
21
|
-
|
|
22
|
-
export { useMakeStandardAutosuggestionFunction };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Generator_InsertionOrEditingSuggestion } from '../../types/base/autosuggestions-bare-function.js';
|
|
2
|
-
import { InsertionsApiConfig } from '../../types/autosuggestions-config/insertions-api-config.js';
|
|
3
|
-
import { EditingApiConfig } from '../../types/autosuggestions-config/editing-api-config.js';
|
|
4
|
-
import '../../types/autosuggestions-config/subtypes/chatlike-api-endpoint.js';
|
|
5
|
-
import '../../types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
|
|
6
|
-
import '../../types/autosuggestions-config/subtypes/make-system-prompt.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
|
|
10
|
-
* The function takes in the text before and after the cursor, and an abort signal.
|
|
11
|
-
* It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.
|
|
12
|
-
* The function returns the suggestion from the API response.
|
|
13
|
-
*
|
|
14
|
-
* @param textareaPurpose - The purpose of the textarea. This is included in the system message.
|
|
15
|
-
* @param apiEndpoint - The API endpoint to send the autosuggestion request to.
|
|
16
|
-
* @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.
|
|
17
|
-
* @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.
|
|
18
|
-
* @param contextCategories - The categories of context strings we want to include. By default, we include the (default) "global" context category.
|
|
19
|
-
* @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.
|
|
20
|
-
*/
|
|
21
|
-
declare function useMakeStandardInsertionOrEditingFunction(textareaPurpose: string, contextCategories: string[] | undefined, insertionApiConfig: InsertionsApiConfig, editingApiConfig: EditingApiConfig): Generator_InsertionOrEditingSuggestion;
|
|
22
|
-
|
|
23
|
-
export { useMakeStandardInsertionOrEditingFunction };
|
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { BaseCopilotTextarea } from './components/base-copilot-textarea/base-copilot-textarea.js';
|
|
2
|
-
export { CopilotTextarea, CopilotTextareaProps } from './components/copilot-textarea/copilot-textarea.js';
|
|
3
|
-
export { BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig } from './types/base/base-autosuggestions-config.js';
|
|
4
|
-
export { AutosuggestionsBareFunction } from './types/base/autosuggestions-bare-function.js';
|
|
5
|
-
export { BaseCopilotTextareaProps } from './types/base/base-copilot-textarea-props.js';
|
|
6
|
-
export { HTMLCopilotTextAreaElement } from './types/html-copilot-textarea-element.js';
|
|
7
|
-
export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './types/autosuggestions-config/autosuggestions-config.js';
|
|
8
|
-
export { MinimalChatGPTMessage } from './types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
|
|
9
|
-
export { MakeSystemPrompt } from './types/autosuggestions-config/subtypes/make-system-prompt.js';
|
|
10
|
-
export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './types/autosuggestions-config/subtypes/chatlike-api-endpoint.js';
|
|
11
|
-
export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './types/autosuggestions-config/autosuggestions-config-user-specified.js';
|
|
12
|
-
import 'react';
|
|
13
|
-
import './types/autosuggestions-config/suggestions-api-config.js';
|
|
14
|
-
import './types/autosuggestions-config/insertions-api-config.js';
|
|
15
|
-
import './types/autosuggestions-config/editing-api-config.js';
|
package/dist/lib/debouncer.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type AsyncFunction<T extends any[]> = (...args: [...T, AbortSignal]) => Promise<void>;
|
|
2
|
-
declare class Debouncer<T extends any[]> {
|
|
3
|
-
private wait;
|
|
4
|
-
private timeoutId?;
|
|
5
|
-
private activeAbortController?;
|
|
6
|
-
constructor(wait: number);
|
|
7
|
-
debounce: (func: AsyncFunction<T>, ...args: T) => Promise<void>;
|
|
8
|
-
cancel: () => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { AsyncFunction, Debouncer };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseRange, Editor, Range } from 'slate';
|
|
2
|
-
import { EditorAutocompleteState } from '../types/base/editor-autocomplete-state.js';
|
|
3
|
-
|
|
4
|
-
interface EditorTextState {
|
|
5
|
-
selection: BaseRange;
|
|
6
|
-
textBeforeCursor: string;
|
|
7
|
-
selectedText: string;
|
|
8
|
-
textAfterCursor: string;
|
|
9
|
-
}
|
|
10
|
-
declare function getTextAroundCollapsedCursor(editor: Editor): EditorAutocompleteState | null;
|
|
11
|
-
declare function getTextAroundSelection(editor: Editor): EditorTextState | null;
|
|
12
|
-
declare function getFullEditorTextWithNewlines(editor: Editor): string;
|
|
13
|
-
declare function extractTextWithNewlines(editor: Editor, range: Range): string;
|
|
14
|
-
|
|
15
|
-
export { EditorTextState, extractTextWithNewlines, getFullEditorTextWithNewlines, getTextAroundCollapsedCursor, getTextAroundSelection };
|
package/dist/lib/retry.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BasePoint } from 'slate';
|
|
2
|
-
import { CustomEditor } from '../../types/base/custom-editor.js';
|
|
3
|
-
import 'slate-react';
|
|
4
|
-
import 'slate-history';
|
|
5
|
-
|
|
6
|
-
declare function addAutocompletionsToEditor(editor: CustomEditor, newSuggestion: string, point: BasePoint): void;
|
|
7
|
-
|
|
8
|
-
export { addAutocompletionsToEditor };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CustomEditor } from '../../types/base/custom-editor.js';
|
|
2
|
-
import { Operation } from 'slate';
|
|
3
|
-
import { HistoryEditor } from 'slate-history';
|
|
4
|
-
import 'slate-react';
|
|
5
|
-
|
|
6
|
-
type ShouldSaveToHistory = (op: Operation, prev: Operation | undefined) => boolean;
|
|
7
|
-
declare const withPartialHistory: <T extends CustomEditor>(editor: T, shouldSave: ShouldSaveToHistory) => T & HistoryEditor;
|
|
8
|
-
declare const defaultShouldSave: (op: Operation, prev: Operation | undefined) => boolean;
|
|
9
|
-
|
|
10
|
-
export { ShouldSaveToHistory, defaultShouldSave, withPartialHistory };
|
package/dist/lib/utils.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ClassValue } from 'clsx';
|
|
2
|
-
|
|
3
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
-
declare const nanoid: (size?: number | undefined) => string;
|
|
5
|
-
declare function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON>;
|
|
6
|
-
declare function formatDate(input: string | number | Date): string;
|
|
7
|
-
declare const arraysAreEqual: (arr1: number[], arr2: number[]) => boolean;
|
|
8
|
-
declare function nullableCompatibleEqualityCheck<T>(naiveEqualityCheck: (a: T, b: T) => boolean, a: T | null | undefined, b: T | null | undefined): boolean;
|
|
9
|
-
|
|
10
|
-
export { arraysAreEqual, cn, fetcher, formatDate, nanoid, nullableCompatibleEqualityCheck };
|
package/dist/lib/utils.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|