@copilotkit/react-textarea 1.51.4 → 1.51.5-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attw.json +3 -0
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs +1918 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +10 -639
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +318 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +318 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1879 -61
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1900 -123
- package/dist/index.umd.js.map +1 -1
- package/package.json +18 -16
- package/src/components/copilot-textarea/copilot-textarea.tsx +1 -1
- package/tsdown.config.ts +60 -0
- package/vitest.config.mjs +11 -0
- package/dist/chunk-2C7O2EVM.mjs +0 -27
- package/dist/chunk-2C7O2EVM.mjs.map +0 -1
- package/dist/chunk-2X3CZVEP.mjs +0 -32
- package/dist/chunk-2X3CZVEP.mjs.map +0 -1
- package/dist/chunk-3WLGLZTY.mjs +0 -232
- package/dist/chunk-3WLGLZTY.mjs.map +0 -1
- package/dist/chunk-5UNJXFUO.mjs +0 -29
- package/dist/chunk-5UNJXFUO.mjs.map +0 -1
- package/dist/chunk-7GZWOXE4.mjs +0 -70
- package/dist/chunk-7GZWOXE4.mjs.map +0 -1
- package/dist/chunk-7V4ORVQX.mjs +0 -17
- package/dist/chunk-7V4ORVQX.mjs.map +0 -1
- package/dist/chunk-A6YGJFQI.mjs +0 -111
- package/dist/chunk-A6YGJFQI.mjs.map +0 -1
- package/dist/chunk-AHNPJMBR.mjs +0 -90
- package/dist/chunk-AHNPJMBR.mjs.map +0 -1
- package/dist/chunk-ARLBRSB7.mjs +0 -140
- package/dist/chunk-ARLBRSB7.mjs.map +0 -1
- package/dist/chunk-AZ7RF6ED.mjs +0 -120
- package/dist/chunk-AZ7RF6ED.mjs.map +0 -1
- package/dist/chunk-CFCMZVQ2.mjs +0 -136
- package/dist/chunk-CFCMZVQ2.mjs.map +0 -1
- package/dist/chunk-CMKGYQFX.mjs +0 -45
- package/dist/chunk-CMKGYQFX.mjs.map +0 -1
- package/dist/chunk-DE5K76I2.mjs +0 -1
- package/dist/chunk-DE5K76I2.mjs.map +0 -1
- package/dist/chunk-DZMQBOPG.mjs +0 -36
- package/dist/chunk-DZMQBOPG.mjs.map +0 -1
- package/dist/chunk-E7C63KQP.mjs +0 -64
- package/dist/chunk-E7C63KQP.mjs.map +0 -1
- package/dist/chunk-EGBZSVLK.mjs +0 -25
- package/dist/chunk-EGBZSVLK.mjs.map +0 -1
- package/dist/chunk-FTG7P3NP.mjs +0 -25
- package/dist/chunk-FTG7P3NP.mjs.map +0 -1
- package/dist/chunk-H4VKQGVU.mjs +0 -1
- package/dist/chunk-H4VKQGVU.mjs.map +0 -1
- package/dist/chunk-IBZTDP72.mjs +0 -56
- package/dist/chunk-IBZTDP72.mjs.map +0 -1
- package/dist/chunk-IU3WTXLQ.mjs +0 -1
- package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
- package/dist/chunk-KNQIEOFP.mjs +0 -19
- package/dist/chunk-KNQIEOFP.mjs.map +0 -1
- package/dist/chunk-L7VVZH4Q.mjs +0 -1
- package/dist/chunk-L7VVZH4Q.mjs.map +0 -1
- package/dist/chunk-LYNGBKJR.mjs +0 -58
- package/dist/chunk-LYNGBKJR.mjs.map +0 -1
- package/dist/chunk-M7GTVHFB.mjs +0 -188
- package/dist/chunk-M7GTVHFB.mjs.map +0 -1
- package/dist/chunk-MCNXIA4Q.mjs +0 -75
- package/dist/chunk-MCNXIA4Q.mjs.map +0 -1
- package/dist/chunk-MMVDU6DF.mjs +0 -1
- package/dist/chunk-MMVDU6DF.mjs.map +0 -1
- package/dist/chunk-MQBPYOOZ.mjs +0 -97
- package/dist/chunk-MQBPYOOZ.mjs.map +0 -1
- package/dist/chunk-MQXYWOE2.mjs +0 -32
- package/dist/chunk-MQXYWOE2.mjs.map +0 -1
- package/dist/chunk-MRXNTQOX.mjs +0 -59
- package/dist/chunk-MRXNTQOX.mjs.map +0 -1
- package/dist/chunk-NFMCLTJU.mjs +0 -39
- package/dist/chunk-NFMCLTJU.mjs.map +0 -1
- package/dist/chunk-O4WCM57A.mjs +0 -30
- package/dist/chunk-O4WCM57A.mjs.map +0 -1
- package/dist/chunk-PDFIUPCS.mjs +0 -108
- package/dist/chunk-PDFIUPCS.mjs.map +0 -1
- package/dist/chunk-QFXR6DOA.mjs +0 -64
- package/dist/chunk-QFXR6DOA.mjs.map +0 -1
- package/dist/chunk-RUV6NBIF.mjs +0 -1
- package/dist/chunk-RUV6NBIF.mjs.map +0 -1
- package/dist/chunk-SWX3MRZ4.mjs +0 -278
- package/dist/chunk-SWX3MRZ4.mjs.map +0 -1
- package/dist/chunk-TGN3YVSO.mjs +0 -85
- package/dist/chunk-TGN3YVSO.mjs.map +0 -1
- package/dist/chunk-UB4Y22EF.mjs +0 -21
- package/dist/chunk-UB4Y22EF.mjs.map +0 -1
- package/dist/chunk-UIBUYQPG.mjs +0 -79
- package/dist/chunk-UIBUYQPG.mjs.map +0 -1
- package/dist/chunk-VBPZTMXB.mjs +0 -13
- package/dist/chunk-VBPZTMXB.mjs.map +0 -1
- package/dist/chunk-VH7INUR5.mjs +0 -82
- package/dist/chunk-VH7INUR5.mjs.map +0 -1
- package/dist/chunk-VVRGAA43.mjs +0 -59
- package/dist/chunk-VVRGAA43.mjs.map +0 -1
- package/dist/chunk-VYLLLBUP.mjs +0 -50
- package/dist/chunk-VYLLLBUP.mjs.map +0 -1
- package/dist/chunk-WADHCMPK.mjs +0 -1
- package/dist/chunk-WADHCMPK.mjs.map +0 -1
- package/dist/chunk-WJHSY5T6.mjs +0 -1
- package/dist/chunk-WJHSY5T6.mjs.map +0 -1
- package/dist/chunk-WXKPRNNO.mjs +0 -32
- package/dist/chunk-WXKPRNNO.mjs.map +0 -1
- package/dist/chunk-YINY56BI.mjs +0 -49
- package/dist/chunk-YINY56BI.mjs.map +0 -1
- package/dist/chunk-ZBP4SABT.mjs +0 -117
- package/dist/chunk-ZBP4SABT.mjs.map +0 -1
- package/dist/chunk-ZWI5KPQ5.mjs +0 -31
- package/dist/chunk-ZWI5KPQ5.mjs.map +0 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.css +0 -9
- package/dist/components/base-copilot-textarea/base-copilot-textarea.css.map +0 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +0 -43
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js +0 -1849
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +0 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +0 -40
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +0 -1
- package/dist/components/base-copilot-textarea/render-element.d.ts +0 -7
- package/dist/components/base-copilot-textarea/render-element.js +0 -75
- package/dist/components/base-copilot-textarea/render-element.js.map +0 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +0 -8
- package/dist/components/base-copilot-textarea/render-element.mjs.map +0 -1
- package/dist/components/base-copilot-textarea/render-placeholder.d.ts +0 -7
- package/dist/components/base-copilot-textarea/render-placeholder.js +0 -72
- package/dist/components/base-copilot-textarea/render-placeholder.js.map +0 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +0 -8
- package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +0 -1
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.ts +0 -8
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +0 -112
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +0 -1
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +0 -9
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +0 -1
- package/dist/components/base-copilot-textarea/use-add-branding-css.d.ts +0 -3
- package/dist/components/base-copilot-textarea/use-add-branding-css.js +0 -83
- package/dist/components/base-copilot-textarea/use-add-branding-css.js.map +0 -1
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +0 -8
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +0 -1
- package/dist/components/copilot-textarea/copilot-textarea.css +0 -9
- package/dist/components/copilot-textarea/copilot-textarea.css.map +0 -1
- package/dist/components/copilot-textarea/copilot-textarea.d.ts +0 -171
- package/dist/components/copilot-textarea/copilot-textarea.js +0 -2356
- package/dist/components/copilot-textarea/copilot-textarea.js.map +0 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +0 -49
- package/dist/components/copilot-textarea/copilot-textarea.mjs.map +0 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +0 -18
- package/dist/components/hovering-toolbar/hovering-editor-provider.js +0 -46
- package/dist/components/hovering-toolbar/hovering-editor-provider.js.map +0 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +0 -10
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +0 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +0 -18
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js +0 -158
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +0 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +0 -16
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +0 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +0 -12
- package/dist/components/hovering-toolbar/hovering-toolbar.js +0 -934
- package/dist/components/hovering-toolbar/hovering-toolbar.js.map +0 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +0 -23
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +0 -16
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +0 -649
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +0 -18
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +0 -13
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +0 -672
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +0 -19
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.d.ts +0 -16
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +0 -144
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +0 -12
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.d.ts +0 -4
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +0 -672
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +0 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +0 -20
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +0 -1
- package/dist/components/index.css +0 -9
- package/dist/components/index.css.map +0 -1
- package/dist/components/index.d.ts +0 -15
- package/dist/components/index.js +0 -2360
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -53
- package/dist/components/index.mjs.map +0 -1
- package/dist/components/manual-ui/chip-with-icon.d.ts +0 -10
- package/dist/components/manual-ui/chip-with-icon.js +0 -49
- package/dist/components/manual-ui/chip-with-icon.js.map +0 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +0 -26
- package/dist/components/manual-ui/chip-with-icon.mjs.map +0 -1
- package/dist/components/source-search-box/source-search-box.d.ts +0 -16
- package/dist/components/source-search-box/source-search-box.js +0 -263
- package/dist/components/source-search-box/source-search-box.js.map +0 -1
- package/dist/components/source-search-box/source-search-box.mjs +0 -13
- package/dist/components/source-search-box/source-search-box.mjs.map +0 -1
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.js +0 -120
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/button.mjs +0 -11
- package/dist/components/ui/button.mjs.map +0 -1
- package/dist/components/ui/command.d.ts +0 -53
- package/dist/components/ui/command.js +0 -323
- package/dist/components/ui/command.js.map +0 -1
- package/dist/components/ui/command.mjs +0 -26
- package/dist/components/ui/command.mjs.map +0 -1
- package/dist/components/ui/dialog.d.ts +0 -19
- package/dist/components/ui/dialog.js +0 -205
- package/dist/components/ui/dialog.js.map +0 -1
- package/dist/components/ui/dialog.mjs +0 -21
- package/dist/components/ui/dialog.mjs.map +0 -1
- package/dist/components/ui/label.d.ts +0 -8
- package/dist/components/ui/label.js +0 -93
- package/dist/components/ui/label.js.map +0 -1
- package/dist/components/ui/label.mjs +0 -9
- package/dist/components/ui/label.mjs.map +0 -1
- package/dist/context/index.d.ts +0 -2
- package/dist/context/index.js +0 -19
- package/dist/context/index.js.map +0 -1
- package/dist/context/index.mjs +0 -2
- package/dist/context/index.mjs.map +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.ts +0 -15
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js +0 -194
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +0 -11
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.d.ts +0 -8
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js +0 -194
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js.map +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +0 -9
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.ts +0 -7
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js +0 -180
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js.map +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +0 -10
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +0 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.js +0 -19
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -2
- package/dist/hooks/index.mjs.map +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-autosuggestions-function.js +0 -142
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +0 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +0 -9
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +0 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.d.ts +0 -23
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +0 -248
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +0 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +0 -9
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +0 -1
- package/dist/hooks/misc/use-autosize-textarea.d.ts +0 -5
- package/dist/hooks/misc/use-autosize-textarea.js +0 -37
- package/dist/hooks/misc/use-autosize-textarea.js.map +0 -1
- package/dist/hooks/misc/use-autosize-textarea.mjs +0 -8
- package/dist/hooks/misc/use-autosize-textarea.mjs.map +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -2365
- package/dist/index.js.map +0 -1
- package/dist/lib/debouncer.d.ts +0 -11
- package/dist/lib/debouncer.js +0 -76
- package/dist/lib/debouncer.js.map +0 -1
- package/dist/lib/debouncer.mjs +0 -8
- package/dist/lib/debouncer.mjs.map +0 -1
- package/dist/lib/editor-to-text.d.ts +0 -7
- package/dist/lib/editor-to-text.js +0 -69
- package/dist/lib/editor-to-text.js.map +0 -1
- package/dist/lib/editor-to-text.mjs +0 -8
- package/dist/lib/editor-to-text.mjs.map +0 -1
- package/dist/lib/get-text-around-cursor.d.ts +0 -15
- package/dist/lib/get-text-around-cursor.js +0 -131
- package/dist/lib/get-text-around-cursor.js.map +0 -1
- package/dist/lib/get-text-around-cursor.mjs +0 -14
- package/dist/lib/get-text-around-cursor.mjs.map +0 -1
- package/dist/lib/retry.d.ts +0 -3
- package/dist/lib/retry.js +0 -43
- package/dist/lib/retry.js.map +0 -1
- package/dist/lib/retry.mjs +0 -8
- package/dist/lib/retry.mjs.map +0 -1
- package/dist/lib/slatejs-edits/add-autocompletions.d.ts +0 -8
- package/dist/lib/slatejs-edits/add-autocompletions.js +0 -51
- package/dist/lib/slatejs-edits/add-autocompletions.js.map +0 -1
- package/dist/lib/slatejs-edits/add-autocompletions.mjs +0 -8
- package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +0 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.d.ts +0 -8
- package/dist/lib/slatejs-edits/clear-autocompletions.js +0 -49
- package/dist/lib/slatejs-edits/clear-autocompletions.js.map +0 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +0 -8
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +0 -1
- package/dist/lib/slatejs-edits/replace-text.d.ts +0 -5
- package/dist/lib/slatejs-edits/replace-text.js +0 -53
- package/dist/lib/slatejs-edits/replace-text.js.map +0 -1
- package/dist/lib/slatejs-edits/replace-text.mjs +0 -8
- package/dist/lib/slatejs-edits/replace-text.mjs.map +0 -1
- package/dist/lib/slatejs-edits/with-partial-history.d.ts +0 -8
- package/dist/lib/slatejs-edits/with-partial-history.js +0 -133
- package/dist/lib/slatejs-edits/with-partial-history.js.map +0 -1
- package/dist/lib/slatejs-edits/with-partial-history.mjs +0 -10
- package/dist/lib/slatejs-edits/with-partial-history.mjs.map +0 -1
- package/dist/lib/stream-promise-flatten.d.ts +0 -12
- package/dist/lib/stream-promise-flatten.js +0 -72
- package/dist/lib/stream-promise-flatten.js.map +0 -1
- package/dist/lib/stream-promise-flatten.mjs +0 -8
- package/dist/lib/stream-promise-flatten.mjs.map +0 -1
- package/dist/lib/utils.d.ts +0 -9
- package/dist/lib/utils.js +0 -94
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/utils.mjs +0 -16
- package/dist/lib/utils.mjs.map +0 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +0 -23
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js +0 -19
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js.map +0 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +0 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +0 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +0 -20
- package/dist/types/autosuggestions-config/autosuggestions-config.js +0 -287
- package/dist/types/autosuggestions-config/autosuggestions-config.js.map +0 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +0 -13
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +0 -1
- package/dist/types/autosuggestions-config/editing-api-config.d.ts +0 -15
- package/dist/types/autosuggestions-config/editing-api-config.js +0 -108
- package/dist/types/autosuggestions-config/editing-api-config.js.map +0 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +0 -12
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +0 -1
- package/dist/types/autosuggestions-config/index.d.ts +0 -10
- package/dist/types/autosuggestions-config/index.js +0 -287
- package/dist/types/autosuggestions-config/index.js.map +0 -1
- package/dist/types/autosuggestions-config/index.mjs +0 -14
- package/dist/types/autosuggestions-config/index.mjs.map +0 -1
- package/dist/types/autosuggestions-config/insertions-api-config.d.ts +0 -15
- package/dist/types/autosuggestions-config/insertions-api-config.js +0 -101
- package/dist/types/autosuggestions-config/insertions-api-config.js.map +0 -1
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +0 -12
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +0 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +0 -3
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js +0 -19
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js.map +0 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +0 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +0 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +0 -15
- package/dist/types/autosuggestions-config/suggestions-api-config.js +0 -90
- package/dist/types/autosuggestions-config/suggestions-api-config.js.map +0 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs +0 -12
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +0 -1
- package/dist/types/base/autosuggestion-state.d.ts +0 -8
- package/dist/types/base/autosuggestion-state.js +0 -19
- package/dist/types/base/autosuggestion-state.js.map +0 -1
- package/dist/types/base/autosuggestion-state.mjs +0 -1
- package/dist/types/base/autosuggestion-state.mjs.map +0 -1
- package/dist/types/base/autosuggestions-bare-function.d.ts +0 -19
- package/dist/types/base/autosuggestions-bare-function.js +0 -19
- package/dist/types/base/autosuggestions-bare-function.js.map +0 -1
- package/dist/types/base/autosuggestions-bare-function.mjs +0 -1
- package/dist/types/base/autosuggestions-bare-function.mjs.map +0 -1
- package/dist/types/base/base-autosuggestions-config.d.ts +0 -87
- package/dist/types/base/base-autosuggestions-config.js +0 -54
- package/dist/types/base/base-autosuggestions-config.js.map +0 -1
- package/dist/types/base/base-autosuggestions-config.mjs +0 -8
- package/dist/types/base/base-autosuggestions-config.mjs.map +0 -1
- package/dist/types/base/base-copilot-textarea-props.d.ts +0 -5
- package/dist/types/base/base-copilot-textarea-props.js +0 -19
- package/dist/types/base/base-copilot-textarea-props.js.map +0 -1
- package/dist/types/base/base-copilot-textarea-props.mjs +0 -1
- package/dist/types/base/base-copilot-textarea-props.mjs.map +0 -1
- package/dist/types/base/custom-editor.d.ts +0 -29
- package/dist/types/base/custom-editor.js +0 -19
- package/dist/types/base/custom-editor.js.map +0 -1
- package/dist/types/base/custom-editor.mjs +0 -1
- package/dist/types/base/custom-editor.mjs.map +0 -1
- package/dist/types/base/editor-autocomplete-state.d.ts +0 -10
- package/dist/types/base/editor-autocomplete-state.js +0 -40
- package/dist/types/base/editor-autocomplete-state.js.map +0 -1
- package/dist/types/base/editor-autocomplete-state.mjs +0 -9
- package/dist/types/base/editor-autocomplete-state.mjs.map +0 -1
- package/dist/types/base/index.d.ts +0 -54
- package/dist/types/base/index.js +0 -56
- package/dist/types/base/index.js.map +0 -1
- package/dist/types/base/index.mjs +0 -9
- package/dist/types/base/index.mjs.map +0 -1
- package/dist/types/html-copilot-textarea-element.d.ts +0 -7
- package/dist/types/html-copilot-textarea-element.js +0 -19
- package/dist/types/html-copilot-textarea-element.js.map +0 -1
- package/dist/types/html-copilot-textarea-element.mjs +0 -2
- package/dist/types/html-copilot-textarea-element.mjs.map +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.js +0 -289
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -19
- package/dist/types/index.mjs.map +0 -1
- package/jest.config.js +0 -5
- package/rollup.config.mjs +0 -64
- package/tsup.config.ts +0 -15
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import React$1, { TextareaHTMLAttributes } from "react";
|
|
2
|
+
import { DocumentPointer } from "@copilotkit/react-core";
|
|
3
|
+
import { Message } from "@copilotkit/runtime-client-gql";
|
|
4
|
+
|
|
5
|
+
//#region src/types/base/autosuggestions-bare-function.d.ts
|
|
6
|
+
interface InsertionEditorState {
|
|
7
|
+
textBeforeCursor: string;
|
|
8
|
+
textAfterCursor: string;
|
|
9
|
+
}
|
|
10
|
+
interface EditingEditorState extends InsertionEditorState {
|
|
11
|
+
selectedText: string;
|
|
12
|
+
}
|
|
13
|
+
type AutosuggestionsBareFunction = (editorState: InsertionEditorState, abortSignal: AbortSignal) => Promise<string>;
|
|
14
|
+
type Generator_InsertionOrEditingSuggestion = (editorState: EditingEditorState, prompt: string, documents: DocumentPointer[], abortSignal: AbortSignal) => Promise<ReadableStream<string>>;
|
|
15
|
+
interface InsertionEditorApiConfig {
|
|
16
|
+
insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;
|
|
17
|
+
}
|
|
18
|
+
interface BaseCopilotTextareaApiConfig extends InsertionEditorApiConfig {
|
|
19
|
+
autosuggestionsFunction: AutosuggestionsBareFunction;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/types/base/base-autosuggestions-config.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* @interface BaseAutosuggestionsConfig
|
|
25
|
+
*
|
|
26
|
+
* @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.
|
|
27
|
+
*
|
|
28
|
+
* @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.
|
|
29
|
+
*
|
|
30
|
+
* @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.
|
|
31
|
+
*
|
|
32
|
+
* @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.
|
|
33
|
+
*
|
|
34
|
+
* @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.
|
|
35
|
+
*
|
|
36
|
+
* @property {boolean} disabled - Whether to disable autosuggestions entirely.
|
|
37
|
+
*
|
|
38
|
+
* @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.
|
|
39
|
+
*
|
|
40
|
+
* @property {boolean} temporarilyDisableNotTrustedEvents - Temporarily disable autosuggestions after change event from non-trusted sources (like text insertion from autocomplete plugins)
|
|
41
|
+
*
|
|
42
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the current autosuggestion based on a key press event. By default, the Tab key is used to accept the autosuggestion. Example code:
|
|
43
|
+
*
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
46
|
+
* // if tab, accept the autosuggestion
|
|
47
|
+
* if (event.key === "Tab") {
|
|
48
|
+
* return true;
|
|
49
|
+
* }
|
|
50
|
+
* return false;
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @property {(event: React.TouchEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the current autosuggestion based on a mobile touch event. By default, the touching the end of a suggestion will accept it. Example code:
|
|
55
|
+
*
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const shouldAcceptAutosuggestionOnTouch = (event: React.TouchEvent<HTMLDivElement>) => {
|
|
58
|
+
* // if tab, accept the autosuggestion
|
|
59
|
+
* if (event.type === "touchstart") {
|
|
60
|
+
* return true;
|
|
61
|
+
* }
|
|
62
|
+
* return false;
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event. By default, the Command + K key combination is used to toggle the hovering editor. Example code:
|
|
67
|
+
*
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
70
|
+
* // if command-k, toggle the hovering editor
|
|
71
|
+
* if (event.key === "k" && event.metaKey) {
|
|
72
|
+
* return true;
|
|
73
|
+
* }
|
|
74
|
+
* return false;
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
interface BaseAutosuggestionsConfig {
|
|
79
|
+
textareaPurpose: string;
|
|
80
|
+
contextCategories: string[];
|
|
81
|
+
debounceTime: number;
|
|
82
|
+
apiConfig: BaseCopilotTextareaApiConfig;
|
|
83
|
+
disableWhenEmpty: boolean;
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;
|
|
86
|
+
temporarilyDisableNotTrustedEvents: boolean;
|
|
87
|
+
shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;
|
|
88
|
+
shouldAcceptAutosuggestionOnTouch: (event: React.TouchEvent<HTMLDivElement>) => boolean;
|
|
89
|
+
shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>, shortcut: string) => boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Default configuration for the BaseAutosuggestions.
|
|
93
|
+
*
|
|
94
|
+
* @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.
|
|
95
|
+
* @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.
|
|
96
|
+
* @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.
|
|
97
|
+
* @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.
|
|
98
|
+
* @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.
|
|
99
|
+
* @property {boolean} temporarilyDisableNotTrustedEvents - Temporarily disable the autosuggestions after change event from non-trusted sources (like text insertion from autocomplete plugins)
|
|
100
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.
|
|
101
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.
|
|
102
|
+
* @property {() => boolean} defaultShouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the autosuggestion based on a mobile touch event.
|
|
103
|
+
*/
|
|
104
|
+
declare const defaultBaseAutosuggestionsConfig: Omit<BaseAutosuggestionsConfig, "textareaPurpose" | "apiConfig">;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/types/base/base-copilot-textarea-props.d.ts
|
|
107
|
+
/**
|
|
108
|
+
* `BaseCopilotTextareaProps` defines the properties for the `BaseCopilotTextarea` component.
|
|
109
|
+
*/
|
|
110
|
+
interface BaseCopilotTextareaProps extends Omit<TextareaHTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
111
|
+
/**
|
|
112
|
+
* Determines whether the CopilotKit branding should be disabled. Default is `false`.
|
|
113
|
+
*/
|
|
114
|
+
disableBranding?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Specifies the CSS styles to apply to the placeholder text.
|
|
117
|
+
*/
|
|
118
|
+
placeholderStyle?: React.CSSProperties;
|
|
119
|
+
/**
|
|
120
|
+
* Specifies the CSS styles to apply to the suggestions list.
|
|
121
|
+
*/
|
|
122
|
+
suggestionsStyle?: React.CSSProperties;
|
|
123
|
+
/**
|
|
124
|
+
* A class name to apply to the editor popover window.
|
|
125
|
+
*/
|
|
126
|
+
hoverMenuClassname?: string;
|
|
127
|
+
/**
|
|
128
|
+
* The initial value of the textarea. Can be controlled via `onValueChange`.
|
|
129
|
+
*/
|
|
130
|
+
value?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Callback invoked when the value of the textarea changes.
|
|
133
|
+
*/
|
|
134
|
+
onValueChange?: (value: string) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Callback invoked when a `change` event is triggered on the textarea element.
|
|
137
|
+
*/
|
|
138
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
139
|
+
/**
|
|
140
|
+
* The shortcut to use to open the editor popover window. Default is `"Cmd-k"`.
|
|
141
|
+
*/
|
|
142
|
+
shortcut?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Configuration settings for the autosuggestions feature.
|
|
145
|
+
* Includes a mandatory `textareaPurpose` to guide the autosuggestions.
|
|
146
|
+
*/
|
|
147
|
+
baseAutosuggestionsConfig: Partial<BaseAutosuggestionsConfig> & {
|
|
148
|
+
textareaPurpose: string;
|
|
149
|
+
apiConfig: BaseCopilotTextareaApiConfig;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/components/base-copilot-textarea/base-copilot-textarea.d.ts
|
|
154
|
+
/**
|
|
155
|
+
* Purpose: to be used as the `ref` type for `CopilotTextarea` and `BaseCopilotTextarea`.
|
|
156
|
+
*
|
|
157
|
+
* This interface extends `HTMLElement`, and is the subset of `HTMLTextAreaElement` that "actually matters".
|
|
158
|
+
* It provides the core functionality that consumers of `HTMLTextAreaElement` need 99.9% of the time:
|
|
159
|
+
* - `value`: the current value of the textarea
|
|
160
|
+
* - `focus`: make the textarea focused
|
|
161
|
+
* - `blur`: make the textarea unfocused
|
|
162
|
+
*/
|
|
163
|
+
interface HTMLCopilotTextAreaElement$1 extends HTMLElement {
|
|
164
|
+
/**
|
|
165
|
+
* The current value of the textarea.
|
|
166
|
+
*/
|
|
167
|
+
value: string;
|
|
168
|
+
/**
|
|
169
|
+
* focus on the textarea
|
|
170
|
+
*/
|
|
171
|
+
focus: () => void;
|
|
172
|
+
/**
|
|
173
|
+
* unfocus the textarea.
|
|
174
|
+
*
|
|
175
|
+
* Called `blur` for syntactic compatibility with `HTMLTextAreaElement`.
|
|
176
|
+
*/
|
|
177
|
+
blur: () => void;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Not intended for direct use. Use CopilotTextarea instead.
|
|
181
|
+
*
|
|
182
|
+
* The `BaseCopilotTextarea` includes the basic UX component,
|
|
183
|
+
* without the business logic / AI logic that makes the content useful and coherent.
|
|
184
|
+
*
|
|
185
|
+
* It is useful if you want to build your own backend, with fully custom business logic
|
|
186
|
+
* for figuring out which contnet to fill in.
|
|
187
|
+
*/
|
|
188
|
+
declare const BaseCopilotTextarea: React$1.ForwardRefExoticComponent<BaseCopilotTextareaProps & React$1.RefAttributes<HTMLCopilotTextAreaElement$1>>;
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/types/html-copilot-textarea-element.d.ts
|
|
191
|
+
interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
192
|
+
value: string;
|
|
193
|
+
focus: () => void;
|
|
194
|
+
blur: () => void;
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/types/autosuggestions-config/subtypes/make-system-prompt.d.ts
|
|
198
|
+
type MakeSystemPrompt = (textareaPurpose: string, contextString: string) => string;
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/types/autosuggestions-config/suggestions-api-config.d.ts
|
|
201
|
+
interface SuggestionsApiConfig {
|
|
202
|
+
makeSystemPrompt: MakeSystemPrompt;
|
|
203
|
+
fewShotMessages: Message[];
|
|
204
|
+
maxTokens?: number;
|
|
205
|
+
stop?: string[];
|
|
206
|
+
temperature?: number;
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/types/autosuggestions-config/insertions-api-config.d.ts
|
|
210
|
+
interface InsertionsApiConfig {
|
|
211
|
+
makeSystemPrompt: MakeSystemPrompt;
|
|
212
|
+
fewShotMessages: Message[];
|
|
213
|
+
forwardedParams: {
|
|
214
|
+
[key: string]: any;
|
|
215
|
+
} | undefined;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/types/autosuggestions-config/editing-api-config.d.ts
|
|
219
|
+
interface EditingApiConfig {
|
|
220
|
+
makeSystemPrompt: MakeSystemPrompt;
|
|
221
|
+
fewShotMessages: Message[];
|
|
222
|
+
forwardedParams: {
|
|
223
|
+
[key: string]: any;
|
|
224
|
+
} | undefined;
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/types/autosuggestions-config/autosuggestions-config.d.ts
|
|
228
|
+
interface AutosuggestionsConfig extends Omit<BaseAutosuggestionsConfig, "apiConfig"> {
|
|
229
|
+
contextCategories: string[];
|
|
230
|
+
chatApiConfigs: {
|
|
231
|
+
suggestionsApiConfig: SuggestionsApiConfig;
|
|
232
|
+
insertionApiConfig: InsertionsApiConfig;
|
|
233
|
+
editingApiConfig: EditingApiConfig;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
declare const defaultAutosuggestionsConfig: Omit<AutosuggestionsConfig, "textareaPurpose" | "apiEndpoint">;
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts
|
|
239
|
+
interface SuggestionsApiConfigUserSpecified extends Partial<SuggestionsApiConfig> {}
|
|
240
|
+
interface InsertionsApiConfigUserSpecified extends Partial<InsertionsApiConfig> {}
|
|
241
|
+
interface AutosuggestionsConfigUserSpecified extends Partial<Omit<AutosuggestionsConfig, "chatApiConfigs" | "textareaPurpose">> {
|
|
242
|
+
textareaPurpose: string;
|
|
243
|
+
chatApiConfigs: {
|
|
244
|
+
suggestionsApiConfig?: SuggestionsApiConfigUserSpecified;
|
|
245
|
+
insertionApiConfig?: InsertionsApiConfigUserSpecified;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/components/copilot-textarea/copilot-textarea.d.ts
|
|
250
|
+
interface CopilotTextareaProps extends Omit<BaseCopilotTextareaProps, "baseAutosuggestionsConfig"> {
|
|
251
|
+
/**
|
|
252
|
+
* Configuration settings for the autosuggestions feature.
|
|
253
|
+
* For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
|
|
254
|
+
*
|
|
255
|
+
* <PropertyReference name="textareaPurpose" type="string" required={true} >
|
|
256
|
+
* The purpose of the text area in plain text.
|
|
257
|
+
*
|
|
258
|
+
* Example: *"The body of the email response"*
|
|
259
|
+
* </PropertyReference>
|
|
260
|
+
*
|
|
261
|
+
* <PropertyReference name="chatApiConfigs" type="ChatApiConfigs" >
|
|
262
|
+
* The chat API configurations.
|
|
263
|
+
*
|
|
264
|
+
* <strong>NOTE:</strong> You must provide specify at least one of `suggestionsApiConfig` or `insertionApiConfig`.
|
|
265
|
+
*
|
|
266
|
+
* <PropertyReference name="suggestionsApiConfig" type="SuggestionsApiConfig">
|
|
267
|
+
* For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
|
|
268
|
+
* </PropertyReference>
|
|
269
|
+
* <PropertyReference name="insertionApiConfig" type="InsertionApiConfig">
|
|
270
|
+
* For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
|
|
271
|
+
* </PropertyReference>
|
|
272
|
+
* </PropertyReference>
|
|
273
|
+
*
|
|
274
|
+
* <PropertyReference name="disabled" type="boolean" >
|
|
275
|
+
* Whether the textarea is disabled.
|
|
276
|
+
* </PropertyReference>
|
|
277
|
+
*
|
|
278
|
+
* <PropertyReference name="disableBranding" type="boolean" >
|
|
279
|
+
* Whether to disable the CopilotKit branding.
|
|
280
|
+
* </PropertyReference>
|
|
281
|
+
*
|
|
282
|
+
* <PropertyReference name="placeholderStyle" type="React.CSSProperties" >
|
|
283
|
+
* Specifies the CSS styles to apply to the placeholder text.
|
|
284
|
+
* </PropertyReference>
|
|
285
|
+
*
|
|
286
|
+
* <PropertyReference name="suggestionsStyle" type="React.CSSProperties" >
|
|
287
|
+
* Specifies the CSS styles to apply to the suggestions list.
|
|
288
|
+
* </PropertyReference>
|
|
289
|
+
*
|
|
290
|
+
* <PropertyReference name="hoverMenuClassname" type="string" >
|
|
291
|
+
* A class name to apply to the editor popover window.
|
|
292
|
+
* </PropertyReference>
|
|
293
|
+
*
|
|
294
|
+
* <PropertyReference name="value" type="string" >
|
|
295
|
+
* The initial value of the textarea. Can be controlled via `onValueChange`.
|
|
296
|
+
* </PropertyReference>
|
|
297
|
+
*
|
|
298
|
+
* <PropertyReference name="onValueChange" type="(value: string) => void" >
|
|
299
|
+
* Callback invoked when the value of the textarea changes.
|
|
300
|
+
* </PropertyReference>
|
|
301
|
+
*
|
|
302
|
+
* <PropertyReference name="onChange" type="(event: React.ChangeEvent<HTMLTextAreaElement>) => void" >
|
|
303
|
+
* Callback invoked when a `change` event is triggered on the textarea element.
|
|
304
|
+
* </PropertyReference>
|
|
305
|
+
*
|
|
306
|
+
* <PropertyReference name="shortcut" type="string" >
|
|
307
|
+
* The shortcut to use to open the editor popover window. Default is `"Cmd-k"`.
|
|
308
|
+
* </PropertyReference>
|
|
309
|
+
*/
|
|
310
|
+
autosuggestionsConfig: AutosuggestionsConfigUserSpecified;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* A copilot textarea that uses the standard autosuggestions function.
|
|
314
|
+
*/
|
|
315
|
+
declare const CopilotTextarea: React$1.ForwardRefExoticComponent<CopilotTextareaProps & React$1.RefAttributes<HTMLCopilotTextAreaElement>>;
|
|
316
|
+
//#endregion
|
|
317
|
+
export { type AutosuggestionsBareFunction, type AutosuggestionsConfig, type AutosuggestionsConfigUserSpecified, type BaseAutosuggestionsConfig, BaseCopilotTextarea, type BaseCopilotTextareaProps, CopilotTextarea, type CopilotTextareaProps, HTMLCopilotTextAreaElement, type InsertionsApiConfigUserSpecified, type MakeSystemPrompt, type SuggestionsApiConfigUserSpecified, defaultAutosuggestionsConfig, defaultBaseAutosuggestionsConfig };
|
|
318
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/base/autosuggestions-bare-function.ts","../src/types/base/base-autosuggestions-config.tsx","../src/types/base/base-copilot-textarea-props.tsx","../src/components/base-copilot-textarea/base-copilot-textarea.tsx","../src/types/html-copilot-textarea-element.ts","../src/types/autosuggestions-config/subtypes/make-system-prompt.ts","../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","../src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx","../src/components/copilot-textarea/copilot-textarea.tsx"],"mappings":"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"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import React$1, { TextareaHTMLAttributes } from "react";
|
|
2
|
+
import { DocumentPointer } from "@copilotkit/react-core";
|
|
3
|
+
import { Message } from "@copilotkit/runtime-client-gql";
|
|
4
|
+
|
|
5
|
+
//#region src/types/base/autosuggestions-bare-function.d.ts
|
|
6
|
+
interface InsertionEditorState {
|
|
7
|
+
textBeforeCursor: string;
|
|
8
|
+
textAfterCursor: string;
|
|
9
|
+
}
|
|
10
|
+
interface EditingEditorState extends InsertionEditorState {
|
|
11
|
+
selectedText: string;
|
|
12
|
+
}
|
|
13
|
+
type AutosuggestionsBareFunction = (editorState: InsertionEditorState, abortSignal: AbortSignal) => Promise<string>;
|
|
14
|
+
type Generator_InsertionOrEditingSuggestion = (editorState: EditingEditorState, prompt: string, documents: DocumentPointer[], abortSignal: AbortSignal) => Promise<ReadableStream<string>>;
|
|
15
|
+
interface InsertionEditorApiConfig {
|
|
16
|
+
insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;
|
|
17
|
+
}
|
|
18
|
+
interface BaseCopilotTextareaApiConfig extends InsertionEditorApiConfig {
|
|
19
|
+
autosuggestionsFunction: AutosuggestionsBareFunction;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/types/base/base-autosuggestions-config.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* @interface BaseAutosuggestionsConfig
|
|
25
|
+
*
|
|
26
|
+
* @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.
|
|
27
|
+
*
|
|
28
|
+
* @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.
|
|
29
|
+
*
|
|
30
|
+
* @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.
|
|
31
|
+
*
|
|
32
|
+
* @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.
|
|
33
|
+
*
|
|
34
|
+
* @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.
|
|
35
|
+
*
|
|
36
|
+
* @property {boolean} disabled - Whether to disable autosuggestions entirely.
|
|
37
|
+
*
|
|
38
|
+
* @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.
|
|
39
|
+
*
|
|
40
|
+
* @property {boolean} temporarilyDisableNotTrustedEvents - Temporarily disable autosuggestions after change event from non-trusted sources (like text insertion from autocomplete plugins)
|
|
41
|
+
*
|
|
42
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the current autosuggestion based on a key press event. By default, the Tab key is used to accept the autosuggestion. Example code:
|
|
43
|
+
*
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
46
|
+
* // if tab, accept the autosuggestion
|
|
47
|
+
* if (event.key === "Tab") {
|
|
48
|
+
* return true;
|
|
49
|
+
* }
|
|
50
|
+
* return false;
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @property {(event: React.TouchEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the current autosuggestion based on a mobile touch event. By default, the touching the end of a suggestion will accept it. Example code:
|
|
55
|
+
*
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const shouldAcceptAutosuggestionOnTouch = (event: React.TouchEvent<HTMLDivElement>) => {
|
|
58
|
+
* // if tab, accept the autosuggestion
|
|
59
|
+
* if (event.type === "touchstart") {
|
|
60
|
+
* return true;
|
|
61
|
+
* }
|
|
62
|
+
* return false;
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event. By default, the Command + K key combination is used to toggle the hovering editor. Example code:
|
|
67
|
+
*
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
70
|
+
* // if command-k, toggle the hovering editor
|
|
71
|
+
* if (event.key === "k" && event.metaKey) {
|
|
72
|
+
* return true;
|
|
73
|
+
* }
|
|
74
|
+
* return false;
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
interface BaseAutosuggestionsConfig {
|
|
79
|
+
textareaPurpose: string;
|
|
80
|
+
contextCategories: string[];
|
|
81
|
+
debounceTime: number;
|
|
82
|
+
apiConfig: BaseCopilotTextareaApiConfig;
|
|
83
|
+
disableWhenEmpty: boolean;
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;
|
|
86
|
+
temporarilyDisableNotTrustedEvents: boolean;
|
|
87
|
+
shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;
|
|
88
|
+
shouldAcceptAutosuggestionOnTouch: (event: React.TouchEvent<HTMLDivElement>) => boolean;
|
|
89
|
+
shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>, shortcut: string) => boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Default configuration for the BaseAutosuggestions.
|
|
93
|
+
*
|
|
94
|
+
* @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.
|
|
95
|
+
* @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.
|
|
96
|
+
* @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.
|
|
97
|
+
* @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.
|
|
98
|
+
* @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.
|
|
99
|
+
* @property {boolean} temporarilyDisableNotTrustedEvents - Temporarily disable the autosuggestions after change event from non-trusted sources (like text insertion from autocomplete plugins)
|
|
100
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.
|
|
101
|
+
* @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.
|
|
102
|
+
* @property {() => boolean} defaultShouldAcceptAutosuggestionOnTouch - A function that determines whether to accept the autosuggestion based on a mobile touch event.
|
|
103
|
+
*/
|
|
104
|
+
declare const defaultBaseAutosuggestionsConfig: Omit<BaseAutosuggestionsConfig, "textareaPurpose" | "apiConfig">;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/types/base/base-copilot-textarea-props.d.ts
|
|
107
|
+
/**
|
|
108
|
+
* `BaseCopilotTextareaProps` defines the properties for the `BaseCopilotTextarea` component.
|
|
109
|
+
*/
|
|
110
|
+
interface BaseCopilotTextareaProps extends Omit<TextareaHTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
111
|
+
/**
|
|
112
|
+
* Determines whether the CopilotKit branding should be disabled. Default is `false`.
|
|
113
|
+
*/
|
|
114
|
+
disableBranding?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Specifies the CSS styles to apply to the placeholder text.
|
|
117
|
+
*/
|
|
118
|
+
placeholderStyle?: React.CSSProperties;
|
|
119
|
+
/**
|
|
120
|
+
* Specifies the CSS styles to apply to the suggestions list.
|
|
121
|
+
*/
|
|
122
|
+
suggestionsStyle?: React.CSSProperties;
|
|
123
|
+
/**
|
|
124
|
+
* A class name to apply to the editor popover window.
|
|
125
|
+
*/
|
|
126
|
+
hoverMenuClassname?: string;
|
|
127
|
+
/**
|
|
128
|
+
* The initial value of the textarea. Can be controlled via `onValueChange`.
|
|
129
|
+
*/
|
|
130
|
+
value?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Callback invoked when the value of the textarea changes.
|
|
133
|
+
*/
|
|
134
|
+
onValueChange?: (value: string) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Callback invoked when a `change` event is triggered on the textarea element.
|
|
137
|
+
*/
|
|
138
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
139
|
+
/**
|
|
140
|
+
* The shortcut to use to open the editor popover window. Default is `"Cmd-k"`.
|
|
141
|
+
*/
|
|
142
|
+
shortcut?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Configuration settings for the autosuggestions feature.
|
|
145
|
+
* Includes a mandatory `textareaPurpose` to guide the autosuggestions.
|
|
146
|
+
*/
|
|
147
|
+
baseAutosuggestionsConfig: Partial<BaseAutosuggestionsConfig> & {
|
|
148
|
+
textareaPurpose: string;
|
|
149
|
+
apiConfig: BaseCopilotTextareaApiConfig;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/components/base-copilot-textarea/base-copilot-textarea.d.ts
|
|
154
|
+
/**
|
|
155
|
+
* Purpose: to be used as the `ref` type for `CopilotTextarea` and `BaseCopilotTextarea`.
|
|
156
|
+
*
|
|
157
|
+
* This interface extends `HTMLElement`, and is the subset of `HTMLTextAreaElement` that "actually matters".
|
|
158
|
+
* It provides the core functionality that consumers of `HTMLTextAreaElement` need 99.9% of the time:
|
|
159
|
+
* - `value`: the current value of the textarea
|
|
160
|
+
* - `focus`: make the textarea focused
|
|
161
|
+
* - `blur`: make the textarea unfocused
|
|
162
|
+
*/
|
|
163
|
+
interface HTMLCopilotTextAreaElement$1 extends HTMLElement {
|
|
164
|
+
/**
|
|
165
|
+
* The current value of the textarea.
|
|
166
|
+
*/
|
|
167
|
+
value: string;
|
|
168
|
+
/**
|
|
169
|
+
* focus on the textarea
|
|
170
|
+
*/
|
|
171
|
+
focus: () => void;
|
|
172
|
+
/**
|
|
173
|
+
* unfocus the textarea.
|
|
174
|
+
*
|
|
175
|
+
* Called `blur` for syntactic compatibility with `HTMLTextAreaElement`.
|
|
176
|
+
*/
|
|
177
|
+
blur: () => void;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Not intended for direct use. Use CopilotTextarea instead.
|
|
181
|
+
*
|
|
182
|
+
* The `BaseCopilotTextarea` includes the basic UX component,
|
|
183
|
+
* without the business logic / AI logic that makes the content useful and coherent.
|
|
184
|
+
*
|
|
185
|
+
* It is useful if you want to build your own backend, with fully custom business logic
|
|
186
|
+
* for figuring out which contnet to fill in.
|
|
187
|
+
*/
|
|
188
|
+
declare const BaseCopilotTextarea: React$1.ForwardRefExoticComponent<BaseCopilotTextareaProps & React$1.RefAttributes<HTMLCopilotTextAreaElement$1>>;
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/types/html-copilot-textarea-element.d.ts
|
|
191
|
+
interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
192
|
+
value: string;
|
|
193
|
+
focus: () => void;
|
|
194
|
+
blur: () => void;
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/types/autosuggestions-config/subtypes/make-system-prompt.d.ts
|
|
198
|
+
type MakeSystemPrompt = (textareaPurpose: string, contextString: string) => string;
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/types/autosuggestions-config/suggestions-api-config.d.ts
|
|
201
|
+
interface SuggestionsApiConfig {
|
|
202
|
+
makeSystemPrompt: MakeSystemPrompt;
|
|
203
|
+
fewShotMessages: Message[];
|
|
204
|
+
maxTokens?: number;
|
|
205
|
+
stop?: string[];
|
|
206
|
+
temperature?: number;
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/types/autosuggestions-config/insertions-api-config.d.ts
|
|
210
|
+
interface InsertionsApiConfig {
|
|
211
|
+
makeSystemPrompt: MakeSystemPrompt;
|
|
212
|
+
fewShotMessages: Message[];
|
|
213
|
+
forwardedParams: {
|
|
214
|
+
[key: string]: any;
|
|
215
|
+
} | undefined;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/types/autosuggestions-config/editing-api-config.d.ts
|
|
219
|
+
interface EditingApiConfig {
|
|
220
|
+
makeSystemPrompt: MakeSystemPrompt;
|
|
221
|
+
fewShotMessages: Message[];
|
|
222
|
+
forwardedParams: {
|
|
223
|
+
[key: string]: any;
|
|
224
|
+
} | undefined;
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/types/autosuggestions-config/autosuggestions-config.d.ts
|
|
228
|
+
interface AutosuggestionsConfig extends Omit<BaseAutosuggestionsConfig, "apiConfig"> {
|
|
229
|
+
contextCategories: string[];
|
|
230
|
+
chatApiConfigs: {
|
|
231
|
+
suggestionsApiConfig: SuggestionsApiConfig;
|
|
232
|
+
insertionApiConfig: InsertionsApiConfig;
|
|
233
|
+
editingApiConfig: EditingApiConfig;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
declare const defaultAutosuggestionsConfig: Omit<AutosuggestionsConfig, "textareaPurpose" | "apiEndpoint">;
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts
|
|
239
|
+
interface SuggestionsApiConfigUserSpecified extends Partial<SuggestionsApiConfig> {}
|
|
240
|
+
interface InsertionsApiConfigUserSpecified extends Partial<InsertionsApiConfig> {}
|
|
241
|
+
interface AutosuggestionsConfigUserSpecified extends Partial<Omit<AutosuggestionsConfig, "chatApiConfigs" | "textareaPurpose">> {
|
|
242
|
+
textareaPurpose: string;
|
|
243
|
+
chatApiConfigs: {
|
|
244
|
+
suggestionsApiConfig?: SuggestionsApiConfigUserSpecified;
|
|
245
|
+
insertionApiConfig?: InsertionsApiConfigUserSpecified;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/components/copilot-textarea/copilot-textarea.d.ts
|
|
250
|
+
interface CopilotTextareaProps extends Omit<BaseCopilotTextareaProps, "baseAutosuggestionsConfig"> {
|
|
251
|
+
/**
|
|
252
|
+
* Configuration settings for the autosuggestions feature.
|
|
253
|
+
* For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
|
|
254
|
+
*
|
|
255
|
+
* <PropertyReference name="textareaPurpose" type="string" required={true} >
|
|
256
|
+
* The purpose of the text area in plain text.
|
|
257
|
+
*
|
|
258
|
+
* Example: *"The body of the email response"*
|
|
259
|
+
* </PropertyReference>
|
|
260
|
+
*
|
|
261
|
+
* <PropertyReference name="chatApiConfigs" type="ChatApiConfigs" >
|
|
262
|
+
* The chat API configurations.
|
|
263
|
+
*
|
|
264
|
+
* <strong>NOTE:</strong> You must provide specify at least one of `suggestionsApiConfig` or `insertionApiConfig`.
|
|
265
|
+
*
|
|
266
|
+
* <PropertyReference name="suggestionsApiConfig" type="SuggestionsApiConfig">
|
|
267
|
+
* For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
|
|
268
|
+
* </PropertyReference>
|
|
269
|
+
* <PropertyReference name="insertionApiConfig" type="InsertionApiConfig">
|
|
270
|
+
* For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
|
|
271
|
+
* </PropertyReference>
|
|
272
|
+
* </PropertyReference>
|
|
273
|
+
*
|
|
274
|
+
* <PropertyReference name="disabled" type="boolean" >
|
|
275
|
+
* Whether the textarea is disabled.
|
|
276
|
+
* </PropertyReference>
|
|
277
|
+
*
|
|
278
|
+
* <PropertyReference name="disableBranding" type="boolean" >
|
|
279
|
+
* Whether to disable the CopilotKit branding.
|
|
280
|
+
* </PropertyReference>
|
|
281
|
+
*
|
|
282
|
+
* <PropertyReference name="placeholderStyle" type="React.CSSProperties" >
|
|
283
|
+
* Specifies the CSS styles to apply to the placeholder text.
|
|
284
|
+
* </PropertyReference>
|
|
285
|
+
*
|
|
286
|
+
* <PropertyReference name="suggestionsStyle" type="React.CSSProperties" >
|
|
287
|
+
* Specifies the CSS styles to apply to the suggestions list.
|
|
288
|
+
* </PropertyReference>
|
|
289
|
+
*
|
|
290
|
+
* <PropertyReference name="hoverMenuClassname" type="string" >
|
|
291
|
+
* A class name to apply to the editor popover window.
|
|
292
|
+
* </PropertyReference>
|
|
293
|
+
*
|
|
294
|
+
* <PropertyReference name="value" type="string" >
|
|
295
|
+
* The initial value of the textarea. Can be controlled via `onValueChange`.
|
|
296
|
+
* </PropertyReference>
|
|
297
|
+
*
|
|
298
|
+
* <PropertyReference name="onValueChange" type="(value: string) => void" >
|
|
299
|
+
* Callback invoked when the value of the textarea changes.
|
|
300
|
+
* </PropertyReference>
|
|
301
|
+
*
|
|
302
|
+
* <PropertyReference name="onChange" type="(event: React.ChangeEvent<HTMLTextAreaElement>) => void" >
|
|
303
|
+
* Callback invoked when a `change` event is triggered on the textarea element.
|
|
304
|
+
* </PropertyReference>
|
|
305
|
+
*
|
|
306
|
+
* <PropertyReference name="shortcut" type="string" >
|
|
307
|
+
* The shortcut to use to open the editor popover window. Default is `"Cmd-k"`.
|
|
308
|
+
* </PropertyReference>
|
|
309
|
+
*/
|
|
310
|
+
autosuggestionsConfig: AutosuggestionsConfigUserSpecified;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* A copilot textarea that uses the standard autosuggestions function.
|
|
314
|
+
*/
|
|
315
|
+
declare const CopilotTextarea: React$1.ForwardRefExoticComponent<CopilotTextareaProps & React$1.RefAttributes<HTMLCopilotTextAreaElement>>;
|
|
316
|
+
//#endregion
|
|
317
|
+
export { type AutosuggestionsBareFunction, type AutosuggestionsConfig, type AutosuggestionsConfigUserSpecified, type BaseAutosuggestionsConfig, BaseCopilotTextarea, type BaseCopilotTextareaProps, CopilotTextarea, type CopilotTextareaProps, HTMLCopilotTextAreaElement, type InsertionsApiConfigUserSpecified, type MakeSystemPrompt, type SuggestionsApiConfigUserSpecified, defaultAutosuggestionsConfig, defaultBaseAutosuggestionsConfig };
|
|
318
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/base/autosuggestions-bare-function.ts","../src/types/base/base-autosuggestions-config.tsx","../src/types/base/base-copilot-textarea-props.tsx","../src/components/base-copilot-textarea/base-copilot-textarea.tsx","../src/types/html-copilot-textarea-element.ts","../src/types/autosuggestions-config/subtypes/make-system-prompt.ts","../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","../src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx","../src/components/copilot-textarea/copilot-textarea.tsx"],"mappings":";;;;;UAEiB,oBAAA;EACf,gBAAA;EACA,eAAA;AAAA;AAAA,UAGe,kBAAA,SAA2B,oBAAA;EAC1C,YAAA;AAAA;AAAA,KAGU,2BAAA,IACV,WAAA,EAAa,oBAAA,EACb,WAAA,EAAa,WAAA,KACV,OAAA;AAAA,KAEO,sCAAA,IACV,WAAA,EAAa,kBAAA,EACb,MAAA,UACA,SAAA,EAAW,eAAA,IACX,WAAA,EAAa,WAAA,KACV,OAAA,CAAQ,cAAA;AAAA,UAEI,wBAAA;EACf,0BAAA,EAA4B,sCAAA;AAAA;AAAA,UAGb,4BAAA,SAAqC,wBAAA;EACpD,uBAAA,EAAyB,2BAAA;AAAA;;;;;;;AA1B3B;;;;;AAKA;;;;;AAIA;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;UCoCiB,yBAAA;EACf,eAAA;EACA,iBAAA;EACA,YAAA;EACA,SAAA,EAAW,4BAAA;EAEX,gBAAA;EACA,QAAA;EACA,qDAAA;EACA,kCAAA;EACA,oCAAA,GACE,KAAA,EAAO,KAAA,CAAM,aAAA,CAAc,cAAA;EAE7B,iCAAA,GACE,KAAA,EAAO,KAAA,CAAM,UAAA,CAAW,cAAA;EAE1B,oCAAA,GACE,KAAA,EAAO,KAAA,CAAM,aAAA,CAAc,cAAA,GAC3B,QAAA;AAAA;;;;;;;;;;;;;;cAyCS,gCAAA,EAAkC,IAAA,CAC7C,yBAAA;;;;;ADrHF;UEKiB,wBAAA,SAAiC,IAAA,CAChD,sBAAA,CAAuB,cAAA;;;;EAMvB,eAAA;EFPkC;;;EEYlC,gBAAA,GAAmB,KAAA,CAAM,aAAA;EFRf;;;EEaV,gBAAA,GAAmB,KAAA,CAAM,aAAA;EFXZ;;;EEgBb,kBAAA;EFjBa;;;EEsBb,KAAA;EFpBG;;;EEyBH,aAAA,IAAiB,KAAA;EFvB+B;;;EE4BhD,QAAA,IAAY,KAAA,EAAO,KAAA,CAAM,WAAA,CAAY,mBAAA;EFxBxB;;;EE6Bb,QAAA;EF5BU;;;;EEkCV,yBAAA,EAA2B,OAAA,CAAQ,yBAAA;IACjC,eAAA;IACA,SAAA,EAAW,4BAAA;EAAA;AAAA;;;;;AFvDf;;;;;AAKA;;UGiCiB,4BAAA,SAAmC,WAAA;EHjCR;;AAI5C;EGiCE,KAAA;;;;EAKA,KAAA;EHnCU;;;;;EG0CV,IAAA;AAAA;;;AHxCF;;;;;;;cGoDa,mBAAA,EAAmB,OAAA,CAAA,yBAAA,CAAA,wBAAA,GAAA,OAAA,CAAA,aAAA,CAAA,4BAAA;;;UCpEf,0BAAA,SAAmC,WAAA;EAClD,KAAA;EACA,KAAA;EACA,IAAA;AAAA;;;KCHU,gBAAA,IACV,eAAA,UACA,aAAA;;;UCCe,oBAAA;EACf,gBAAA,EAAkB,gBAAA;EAClB,eAAA,EAAiB,OAAA;EACjB,SAAA;EACA,IAAA;EACA,WAAA;AAAA;;;UCLe,mBAAA;EACf,gBAAA,EAAkB,gBAAA;EAClB,eAAA,EAAiB,OAAA;EACjB,eAAA;IAAA,CAAoB,GAAA;EAAA;AAAA;;;UCHL,gBAAA;EACf,gBAAA,EAAkB,gBAAA;EAClB,eAAA,EAAiB,OAAA;EACjB,eAAA;IAAA,CAAoB,GAAA;EAAA;AAAA;;;UCeL,qBAAA,SAA8B,IAAA,CAC7C,yBAAA;EAGA,iBAAA;EACA,cAAA;IACE,oBAAA,EAAsB,oBAAA;IACtB,kBAAA,EAAoB,mBAAA;IACpB,gBAAA,EAAkB,gBAAA;EAAA;AAAA;AAAA,cAIT,4BAAA,EAA8B,IAAA,CACzC,qBAAA;;;UC7Be,iCAAA,SAA0C,OAAA,CAAQ,oBAAA;AAAA,UAGlD,gCAAA,SAAyC,OAAA,CAAQ,mBAAA;AAAA,UAGjD,kCAAA,SAA2C,OAAA,CAC1D,IAAA,CAAK,qBAAA;EAEL,eAAA;EACA,cAAA;IACE,oBAAA,GAAuB,iCAAA;IACvB,kBAAA,GAAqB,gCAAA;EAAA;AAAA;;;UCsFR,oBAAA,SAA6B,IAAA,CAC5C,wBAAA;EVlCE;;;;;;;;;;;;;;AAgDJ;;;;;;;;AC/GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ES+JE,qBAAA,EAAuB,kCAAA;AAAA;;;;cAMZ,eAAA,EAAe,OAAA,CAAA,yBAAA,CAAA,oBAAA,GAAA,OAAA,CAAA,aAAA,CAAA,0BAAA"}
|