@copilotkit/react-textarea 1.1.3-feat-runtime-remote-actions.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -24
- package/dist/components/base-copilot-textarea/base-copilot-textarea.d.mts +43 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +1 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js +49 -114
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +1687 -36
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-element.d.mts +6 -0
- package/dist/components/base-copilot-textarea/render-element.d.ts +1 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +48 -4
- package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.d.mts +6 -0
- package/dist/components/base-copilot-textarea/render-placeholder.d.ts +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +46 -4
- 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.d.mts +8 -0
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +2 -4
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +1 -1
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +81 -5
- 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.d.mts +3 -0
- package/dist/components/base-copilot-textarea/use-add-branding-css.js.map +1 -1
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +54 -4
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.d.mts +165 -0
- package/dist/components/copilot-textarea/copilot-textarea.d.ts +2 -8
- package/dist/components/copilot-textarea/copilot-textarea.js +55 -119
- package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +2211 -44
- package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.mts +18 -0
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +13 -5
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.d.mts +17 -0
- package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +1 -2
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js +0 -21
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +111 -9
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.d.mts +12 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.js +31 -94
- package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +808 -19
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.mts +16 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.d.ts +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +21 -65
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +520 -14
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.mts +14 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +24 -68
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +543 -15
- 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.d.mts +4 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +24 -68
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +543 -16
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
- package/dist/components/index.d.mts +15 -0
- package/dist/components/index.js +55 -119
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2210 -46
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/manual-ui/chip-with-icon.d.mts +10 -0
- package/dist/components/manual-ui/chip-with-icon.d.ts +1 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +0 -2
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
- package/dist/components/source-search-box/source-search-box.d.mts +16 -0
- package/dist/components/source-search-box/source-search-box.d.ts +1 -1
- package/dist/components/source-search-box/source-search-box.js +2 -4
- package/dist/components/source-search-box/source-search-box.js.map +1 -1
- package/dist/components/source-search-box/source-search-box.mjs +200 -8
- package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
- package/dist/components/ui/button.d.mts +14 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.mjs +76 -6
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/command.d.mts +53 -0
- package/dist/components/ui/command.mjs +233 -14
- package/dist/components/ui/command.mjs.map +1 -1
- package/dist/components/ui/dialog.d.mts +19 -0
- package/dist/components/ui/dialog.mjs +135 -11
- package/dist/components/ui/dialog.mjs.map +1 -1
- package/dist/components/ui/label.d.mts +8 -0
- package/dist/components/ui/label.mjs +51 -5
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/context/index.d.mts +2 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.mjs +0 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.mts +15 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.d.ts +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +152 -7
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.d.mts +8 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +165 -5
- 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.d.mts +7 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +141 -6
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
- package/dist/hooks/index.d.mts +2 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +0 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.mts +22 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +2 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +139 -4
- 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.d.mts +23 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +2 -2
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +220 -4
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
- package/dist/hooks/misc/use-autosize-textarea.d.mts +5 -0
- package/dist/hooks/misc/use-autosize-textarea.mjs +12 -4
- package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
- package/dist/index.css +1 -644
- package/dist/index.d.mts +15 -0
- package/dist/index.js +62 -119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2217 -54
- package/dist/index.mjs.map +1 -1
- package/dist/lib/debouncer.d.mts +11 -0
- package/dist/lib/debouncer.d.ts +1 -1
- package/dist/lib/debouncer.js.map +1 -1
- package/dist/lib/debouncer.mjs +48 -4
- package/dist/lib/debouncer.mjs.map +1 -1
- package/dist/lib/editor-to-text.d.mts +7 -0
- package/dist/lib/editor-to-text.mjs +40 -4
- package/dist/lib/editor-to-text.mjs.map +1 -1
- package/dist/lib/get-text-around-cursor.d.mts +15 -0
- package/dist/lib/get-text-around-cursor.d.ts +1 -1
- package/dist/lib/get-text-around-cursor.mjs +96 -7
- package/dist/lib/get-text-around-cursor.mjs.map +1 -1
- package/dist/lib/retry.d.mts +3 -0
- package/dist/lib/retry.mjs +14 -4
- package/dist/lib/retry.mjs.map +1 -1
- package/dist/lib/slatejs-edits/add-autocompletions.d.mts +8 -0
- package/dist/lib/slatejs-edits/add-autocompletions.mjs +22 -4
- package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.d.mts +8 -0
- package/dist/lib/slatejs-edits/clear-autocompletions.js.map +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +17 -4
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/replace-text.d.mts +5 -0
- package/dist/lib/slatejs-edits/replace-text.mjs +24 -4
- package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.d.mts +8 -0
- package/dist/lib/slatejs-edits/with-partial-history.d.ts +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.mjs +102 -5
- package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
- package/dist/lib/stream-promise-flatten.d.mts +12 -0
- package/dist/lib/stream-promise-flatten.js.map +1 -1
- package/dist/lib/stream-promise-flatten.mjs +44 -4
- package/dist/lib/stream-promise-flatten.mjs.map +1 -1
- package/dist/lib/utils.d.mts +9 -0
- package/dist/lib/utils.mjs +58 -8
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.d.mts +2 -0
- package/dist/lib/utils.test.d.ts +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.mts +23 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.d.mts +20 -0
- package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +258 -9
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.d.mts +15 -0
- package/dist/types/autosuggestions-config/editing-api-config.d.ts +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +75 -6
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/index.d.mts +10 -0
- package/dist/types/autosuggestions-config/index.js.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +258 -10
- package/dist/types/autosuggestions-config/index.mjs.map +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.d.mts +15 -0
- package/dist/types/autosuggestions-config/insertions-api-config.d.ts +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.js.map +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +68 -6
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.mts +3 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +1 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.d.mts +14 -0
- package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +1 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs +56 -6
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
- package/dist/types/base/autosuggestion-state.d.mts +8 -0
- package/dist/types/base/autosuggestion-state.d.ts +1 -1
- package/dist/types/base/autosuggestions-bare-function.d.mts +19 -0
- package/dist/types/base/autosuggestions-bare-function.d.ts +1 -1
- package/dist/types/base/base-autosuggestions-config.d.mts +83 -0
- package/dist/types/base/base-autosuggestions-config.d.ts +1 -1
- package/dist/types/base/base-autosuggestions-config.mjs +25 -4
- package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
- package/dist/types/base/base-copilot-textarea-props.d.mts +5 -0
- package/dist/types/base/custom-editor.d.mts +29 -0
- package/dist/types/base/custom-editor.d.ts +1 -1
- package/dist/types/base/editor-autocomplete-state.d.mts +10 -0
- package/dist/types/base/editor-autocomplete-state.d.ts +1 -1
- package/dist/types/base/editor-autocomplete-state.mjs +9 -5
- package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
- package/dist/types/base/index.d.mts +54 -0
- package/dist/types/base/index.d.ts +1 -1
- package/dist/types/base/index.mjs +25 -5
- package/dist/types/base/index.mjs.map +1 -1
- package/dist/types/html-copilot-textarea-element.d.mts +7 -0
- package/dist/types/html-copilot-textarea-element.d.ts +1 -1
- package/dist/types/html-copilot-textarea-element.mjs +0 -1
- package/dist/types/index.d.mts +13 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +258 -14
- package/dist/types/index.mjs.map +1 -1
- package/package.json +17 -11
- package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +0 -1
- package/src/components/copilot-textarea/copilot-textarea.tsx +1 -7
- package/src/components/hovering-toolbar/hovering-toolbar-components.tsx +0 -17
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +4 -7
- package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +2 -2
- package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +2 -3
- package/src/styles.css +9 -2
- package/tsup.config.ts +63 -15
- package/dist/chunk-224UKA7C.mjs +0 -38
- package/dist/chunk-224UKA7C.mjs.map +0 -1
- package/dist/chunk-23Q6A46J.mjs +0 -103
- package/dist/chunk-23Q6A46J.mjs.map +0 -1
- package/dist/chunk-2C7O2EVM.mjs +0 -27
- package/dist/chunk-2C7O2EVM.mjs.map +0 -1
- package/dist/chunk-2QDCE7PD.mjs +0 -32
- package/dist/chunk-2QDCE7PD.mjs.map +0 -1
- package/dist/chunk-2XDYLKPH.mjs +0 -181
- package/dist/chunk-2XDYLKPH.mjs.map +0 -1
- package/dist/chunk-3PQ7GSFE.mjs +0 -17
- package/dist/chunk-3PQ7GSFE.mjs.map +0 -1
- package/dist/chunk-4AMCUMC7.mjs +0 -124
- package/dist/chunk-4AMCUMC7.mjs.map +0 -1
- package/dist/chunk-4CVSOOJY.mjs +0 -30
- package/dist/chunk-4CVSOOJY.mjs.map +0 -1
- package/dist/chunk-4NHVQZ67.mjs +0 -108
- package/dist/chunk-4NHVQZ67.mjs.map +0 -1
- package/dist/chunk-4PDYALMP.mjs +0 -52
- package/dist/chunk-4PDYALMP.mjs.map +0 -1
- package/dist/chunk-5UNJXFUO.mjs +0 -29
- package/dist/chunk-5UNJXFUO.mjs.map +0 -1
- package/dist/chunk-7LSRNPNI.mjs +0 -59
- package/dist/chunk-7LSRNPNI.mjs.map +0 -1
- package/dist/chunk-AJ5OMEXM.mjs +0 -13
- package/dist/chunk-AJ5OMEXM.mjs.map +0 -1
- package/dist/chunk-CF5GISTC.mjs +0 -113
- package/dist/chunk-CF5GISTC.mjs.map +0 -1
- package/dist/chunk-D2SUDM2O.mjs +0 -99
- package/dist/chunk-D2SUDM2O.mjs.map +0 -1
- package/dist/chunk-D47EKHIF.mjs +0 -26
- package/dist/chunk-D47EKHIF.mjs.map +0 -1
- package/dist/chunk-DE5K76I2.mjs +0 -1
- package/dist/chunk-DE5K76I2.mjs.map +0 -1
- package/dist/chunk-DFTV4TST.mjs +0 -36
- package/dist/chunk-DFTV4TST.mjs.map +0 -1
- package/dist/chunk-DRV2FOHZ.mjs +0 -70
- package/dist/chunk-DRV2FOHZ.mjs.map +0 -1
- package/dist/chunk-ECR45NSD.mjs +0 -104
- package/dist/chunk-ECR45NSD.mjs.map +0 -1
- package/dist/chunk-EJGGLWWR.mjs +0 -82
- package/dist/chunk-EJGGLWWR.mjs.map +0 -1
- package/dist/chunk-GQN2HYFJ.mjs +0 -22
- package/dist/chunk-GQN2HYFJ.mjs.map +0 -1
- package/dist/chunk-H4VKQGVU.mjs +0 -1
- package/dist/chunk-H4VKQGVU.mjs.map +0 -1
- package/dist/chunk-HL7EF7KA.mjs +0 -32
- package/dist/chunk-HL7EF7KA.mjs.map +0 -1
- package/dist/chunk-I3SPIGAI.mjs +0 -31
- package/dist/chunk-I3SPIGAI.mjs.map +0 -1
- package/dist/chunk-I72DKFHD.mjs +0 -114
- package/dist/chunk-I72DKFHD.mjs.map +0 -1
- package/dist/chunk-IU3WTXLQ.mjs +0 -1
- package/dist/chunk-IU3WTXLQ.mjs.map +0 -1
- package/dist/chunk-J62KUPFZ.mjs +0 -264
- package/dist/chunk-J62KUPFZ.mjs.map +0 -1
- package/dist/chunk-KMVGEY7Q.mjs +0 -51
- package/dist/chunk-KMVGEY7Q.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-LQ2OWQU7.mjs +0 -49
- package/dist/chunk-LQ2OWQU7.mjs.map +0 -1
- package/dist/chunk-LYB4B6MK.mjs +0 -19
- package/dist/chunk-LYB4B6MK.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-MRXNTQOX.mjs +0 -59
- package/dist/chunk-MRXNTQOX.mjs.map +0 -1
- package/dist/chunk-OFPAO25A.mjs +0 -60
- package/dist/chunk-OFPAO25A.mjs.map +0 -1
- package/dist/chunk-QJNFNPWH.mjs +0 -85
- package/dist/chunk-QJNFNPWH.mjs.map +0 -1
- package/dist/chunk-RUV6NBIF.mjs +0 -1
- package/dist/chunk-RUV6NBIF.mjs.map +0 -1
- package/dist/chunk-SDHH6DI6.mjs +0 -63
- package/dist/chunk-SDHH6DI6.mjs.map +0 -1
- package/dist/chunk-T6MTDQZ7.mjs +0 -45
- package/dist/chunk-T6MTDQZ7.mjs.map +0 -1
- package/dist/chunk-UGEKMSRR.mjs +0 -225
- package/dist/chunk-UGEKMSRR.mjs.map +0 -1
- package/dist/chunk-VSVQZUPW.mjs +0 -124
- package/dist/chunk-VSVQZUPW.mjs.map +0 -1
- package/dist/chunk-WADHCMPK.mjs +0 -1
- package/dist/chunk-WADHCMPK.mjs.map +0 -1
- package/dist/chunk-WGWQRALG.mjs +0 -83
- package/dist/chunk-WGWQRALG.mjs.map +0 -1
- package/dist/chunk-WJHSY5T6.mjs +0 -1
- package/dist/chunk-WJHSY5T6.mjs.map +0 -1
- package/dist/chunk-XW3ICO4S.mjs +0 -25
- package/dist/chunk-XW3ICO4S.mjs.map +0 -1
- package/dist/chunk-YLFAIYRY.mjs +0 -50
- package/dist/chunk-YLFAIYRY.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/copilot-textarea/copilot-textarea.css +0 -9
- package/dist/components/copilot-textarea/copilot-textarea.css.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 -133
- 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/index.css +0 -9
- package/dist/components/index.css.map +0 -1
- package/dist/index.css.map +0 -1
- package/src/components/base-copilot-textarea/base-copilot-textarea.css +0 -9
- package/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx +0 -55
package/CHANGELOG.md
CHANGED
|
@@ -1,40 +1,23 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.2.0
|
|
4
4
|
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
- Better message grouping
|
|
8
|
-
- Updated dependencies
|
|
9
|
-
- @copilotkit/runtime-client-gql@1.1.3-feat-runtime-remote-actions.2
|
|
10
|
-
- @copilotkit/react-core@1.1.3-feat-runtime-remote-actions.2
|
|
11
|
-
- @copilotkit/shared@1.1.3-feat-runtime-remote-actions.2
|
|
12
|
-
|
|
13
|
-
## 1.1.3-feat-runtime-remote-actions.1
|
|
14
|
-
|
|
15
|
-
### Patch Changes
|
|
16
|
-
|
|
17
|
-
- Reduce request size by skipping intermediate state
|
|
18
|
-
- Updated dependencies
|
|
19
|
-
- @copilotkit/runtime-client-gql@1.1.3-feat-runtime-remote-actions.1
|
|
20
|
-
- @copilotkit/react-core@1.1.3-feat-runtime-remote-actions.1
|
|
21
|
-
- @copilotkit/shared@1.1.3-feat-runtime-remote-actions.1
|
|
5
|
+
### Minor Changes
|
|
22
6
|
|
|
23
|
-
|
|
7
|
+
- Fix errors related to crypto not being found, and other bug fixes
|
|
24
8
|
|
|
25
9
|
### Patch Changes
|
|
26
10
|
|
|
27
11
|
- 638d51d: appendMessage fix 1
|
|
28
|
-
- Rename hooks and bugfixes
|
|
29
12
|
- faccbe1: state-abuse resistance for useCopilotChat
|
|
30
13
|
- b0cf700: remove unnecessary logging
|
|
31
|
-
- Updated dependencies [638d51d]
|
|
32
14
|
- Updated dependencies
|
|
15
|
+
- Updated dependencies [638d51d]
|
|
33
16
|
- Updated dependencies [faccbe1]
|
|
34
17
|
- Updated dependencies [b0cf700]
|
|
35
|
-
- @copilotkit/react-core@1.
|
|
36
|
-
- @copilotkit/runtime-client-gql@1.
|
|
37
|
-
- @copilotkit/shared@1.
|
|
18
|
+
- @copilotkit/react-core@1.2.0
|
|
19
|
+
- @copilotkit/runtime-client-gql@1.2.0
|
|
20
|
+
- @copilotkit/shared@1.2.0
|
|
38
21
|
|
|
39
22
|
## 1.1.2
|
|
40
23
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { BaseCopilotTextareaProps } from '../../types/base/index.mjs';
|
|
3
|
+
import '../../types/base/base-autosuggestions-config.mjs';
|
|
4
|
+
import '../../types/base/autosuggestions-bare-function.mjs';
|
|
5
|
+
import '@copilotkit/react-core';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Purpose: to be used as the `ref` type for `CopilotTextarea` and `BaseCopilotTextarea`.
|
|
9
|
+
*
|
|
10
|
+
* This interface extends `HTMLElement`, and is the subset of `HTMLTextAreaElement` that "actually matters".
|
|
11
|
+
* It provides the core functionality that consumers of `HTMLTextAreaElement` need 99.9% of the time:
|
|
12
|
+
* - `value`: the current value of the textarea
|
|
13
|
+
* - `focus`: make the textarea focused
|
|
14
|
+
* - `blur`: make the textarea unfocused
|
|
15
|
+
*/
|
|
16
|
+
interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
17
|
+
/**
|
|
18
|
+
* The current value of the textarea.
|
|
19
|
+
*/
|
|
20
|
+
value: string;
|
|
21
|
+
/**
|
|
22
|
+
* focus on the textarea
|
|
23
|
+
*/
|
|
24
|
+
focus: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* unfocus the textarea.
|
|
27
|
+
*
|
|
28
|
+
* Called `blur` for syntactic compatibility with `HTMLTextAreaElement`.
|
|
29
|
+
*/
|
|
30
|
+
blur: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Not intended for direct use. Use CopilotTextarea instead.
|
|
34
|
+
*
|
|
35
|
+
* The `BaseCopilotTextarea` includes the basic UX component,
|
|
36
|
+
* without the business logic / AI logic that makes the content useful and coherent.
|
|
37
|
+
*
|
|
38
|
+
* It is useful if you want to build your own backend, with fully custom business logic
|
|
39
|
+
* for figuring out which contnet to fill in.
|
|
40
|
+
*/
|
|
41
|
+
declare const BaseCopilotTextarea: React__default.ForwardRefExoticComponent<BaseCopilotTextareaProps & React__default.RefAttributes<HTMLCopilotTextAreaElement>>;
|
|
42
|
+
|
|
43
|
+
export { BaseCopilotTextarea, type HTMLCopilotTextAreaElement };
|
|
@@ -40,4 +40,4 @@ interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
|
40
40
|
*/
|
|
41
41
|
declare const BaseCopilotTextarea: React__default.ForwardRefExoticComponent<BaseCopilotTextareaProps & React__default.RefAttributes<HTMLCopilotTextAreaElement>>;
|
|
42
42
|
|
|
43
|
-
export { BaseCopilotTextarea, HTMLCopilotTextAreaElement };
|
|
43
|
+
export { BaseCopilotTextarea, type HTMLCopilotTextAreaElement };
|
|
@@ -782,10 +782,8 @@ function SourceSearchBox(props) {
|
|
|
782
782
|
setSelectedValue(value);
|
|
783
783
|
},
|
|
784
784
|
filter: (value, search) => {
|
|
785
|
-
if (props.searchTerm === "")
|
|
786
|
-
|
|
787
|
-
if (value.startsWith(props.searchTerm))
|
|
788
|
-
return 1;
|
|
785
|
+
if (props.searchTerm === "") return 1;
|
|
786
|
+
if (value.startsWith(props.searchTerm)) return 1;
|
|
789
787
|
return 0;
|
|
790
788
|
},
|
|
791
789
|
children: [
|
|
@@ -919,51 +917,9 @@ function streamPromiseFlatten(promise) {
|
|
|
919
917
|
});
|
|
920
918
|
}
|
|
921
919
|
|
|
922
|
-
// src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
|
|
923
|
-
var import_Chip = __toESM(require("@mui/material/Chip/Chip.js"));
|
|
924
|
-
var import_Avatar = __toESM(require("@mui/material/Avatar/Avatar.js"));
|
|
925
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
926
|
-
var IncludedFilesPreview = ({
|
|
927
|
-
includedFiles,
|
|
928
|
-
setIncludedFiles
|
|
929
|
-
}) => {
|
|
930
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-2 mt-2", children: [
|
|
931
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, { className: "", children: "Included context:" }),
|
|
932
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-wrap gap-2", children: includedFiles.map((filePointer, index) => {
|
|
933
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
934
|
-
FileChipPreview,
|
|
935
|
-
{
|
|
936
|
-
filePointer,
|
|
937
|
-
onDelete: () => {
|
|
938
|
-
setIncludedFiles((prev) => prev.filter((fp) => fp !== filePointer));
|
|
939
|
-
}
|
|
940
|
-
},
|
|
941
|
-
`file-${filePointer.sourceApplication}.${filePointer.name}`
|
|
942
|
-
);
|
|
943
|
-
}) })
|
|
944
|
-
] });
|
|
945
|
-
};
|
|
946
|
-
var FileChipPreview = ({ filePointer, onDelete }) => {
|
|
947
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
948
|
-
import_Chip.default,
|
|
949
|
-
{
|
|
950
|
-
label: filePointer.name,
|
|
951
|
-
onDelete,
|
|
952
|
-
avatar: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
953
|
-
import_Avatar.default,
|
|
954
|
-
{
|
|
955
|
-
src: filePointer.iconImageUri,
|
|
956
|
-
alt: filePointer.sourceApplication,
|
|
957
|
-
sx: { backgroundColor: "transparent" }
|
|
958
|
-
}
|
|
959
|
-
)
|
|
960
|
-
}
|
|
961
|
-
);
|
|
962
|
-
};
|
|
963
|
-
|
|
964
920
|
// src/components/hovering-toolbar/hovering-editor-provider.tsx
|
|
965
921
|
var import_react6 = require("react");
|
|
966
|
-
var
|
|
922
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
967
923
|
var HoveringEditorContext = (0, import_react6.createContext)({
|
|
968
924
|
isDisplayed: false,
|
|
969
925
|
setIsDisplayed: () => {
|
|
@@ -971,12 +927,13 @@ var HoveringEditorContext = (0, import_react6.createContext)({
|
|
|
971
927
|
});
|
|
972
928
|
var HoveringEditorProvider = ({ children }) => {
|
|
973
929
|
const [isDisplayed, setIsDisplayed] = (0, import_react6.useState)(false);
|
|
974
|
-
return /* @__PURE__ */ (0,
|
|
930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
|
|
975
931
|
};
|
|
976
932
|
var useHoveringEditorContext = () => (0, import_react6.useContext)(HoveringEditorContext);
|
|
977
933
|
|
|
978
934
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
979
|
-
var
|
|
935
|
+
var import_md = require("react-icons/md");
|
|
936
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
980
937
|
var HoveringInsertionPromptBoxCore = ({
|
|
981
938
|
performInsertion,
|
|
982
939
|
state,
|
|
@@ -1071,10 +1028,10 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1071
1028
|
const adjustmentLabel = textToEdit === "" ? "Describe the text you want to insert" : "Describe adjustments to the suggested text";
|
|
1072
1029
|
const placeholder = textToEdit === "" ? "e.g. 'summarize the client's top 3 pain-points from @CallTranscript'" : "e.g. 'make it more formal', 'be more specific', ...";
|
|
1073
1030
|
const { setIsDisplayed } = useHoveringEditorContext();
|
|
1074
|
-
const AdjustmentPromptComponent = /* @__PURE__ */ (0,
|
|
1075
|
-
/* @__PURE__ */ (0,
|
|
1076
|
-
/* @__PURE__ */ (0,
|
|
1077
|
-
/* @__PURE__ */ (0,
|
|
1031
|
+
const AdjustmentPromptComponent = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { className: "", children: adjustmentLabel }),
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative w-full flex items-center", children: [
|
|
1034
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1078
1035
|
"textarea",
|
|
1079
1036
|
{
|
|
1080
1037
|
disabled: suggestionIsLoading,
|
|
@@ -1099,29 +1056,29 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1099
1056
|
rows: 1
|
|
1100
1057
|
}
|
|
1101
1058
|
),
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1059
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1103
1060
|
"button",
|
|
1104
1061
|
{
|
|
1105
1062
|
onClick: beginGeneratingAdjustment,
|
|
1106
1063
|
className: "absolute right-2 bg-blue-500 text-white w-8 h-8 rounded-full flex items-center justify-center",
|
|
1107
|
-
children: /* @__PURE__ */ (0,
|
|
1064
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_md.MdArrowForward, { className: "text-2xl" })
|
|
1108
1065
|
}
|
|
1109
1066
|
)
|
|
1110
1067
|
] })
|
|
1111
1068
|
] });
|
|
1112
|
-
const SuggestionComponent = /* @__PURE__ */ (0,
|
|
1113
|
-
/* @__PURE__ */ (0,
|
|
1114
|
-
/* @__PURE__ */ (0,
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1069
|
+
const SuggestionComponent = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex justify-between items-end w-full", children: [
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, { className: "mt-4", children: "Suggested:" }),
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "ml-auto", children: isLoading && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1116
1073
|
"div",
|
|
1117
1074
|
{
|
|
1118
1075
|
className: "inline-block h-4 w-4 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
|
1119
1076
|
role: "status",
|
|
1120
|
-
children: /* @__PURE__ */ (0,
|
|
1077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "absolute -m-px h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]", children: "Loading..." })
|
|
1121
1078
|
}
|
|
1122
1079
|
) }) })
|
|
1123
1080
|
] }),
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1081
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1125
1082
|
"textarea",
|
|
1126
1083
|
{
|
|
1127
1084
|
ref: suggestionTextAreaRef,
|
|
@@ -1133,7 +1090,7 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1133
1090
|
}
|
|
1134
1091
|
)
|
|
1135
1092
|
] });
|
|
1136
|
-
const SubmitComponent = /* @__PURE__ */ (0,
|
|
1093
|
+
const SubmitComponent = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex w-full gap-4 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1137
1094
|
Button,
|
|
1138
1095
|
{
|
|
1139
1096
|
className: " bg-green-700 text-white",
|
|
@@ -1142,16 +1099,15 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1142
1099
|
},
|
|
1143
1100
|
children: [
|
|
1144
1101
|
"Insert ",
|
|
1145
|
-
/* @__PURE__ */ (0,
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_md.MdCheck, { className: "text-2xl" })
|
|
1146
1103
|
]
|
|
1147
1104
|
}
|
|
1148
1105
|
) });
|
|
1149
1106
|
const sourceSearchCandidate = adjustmentPrompt.split(" ").pop();
|
|
1150
1107
|
const sourceSearchWord = (sourceSearchCandidate == null ? void 0 : sourceSearchCandidate.startsWith("@")) ? sourceSearchCandidate.slice(1) : void 0;
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "w-full flex flex-col items-start relative gap-2", children: [
|
|
1152
1109
|
AdjustmentPromptComponent,
|
|
1153
|
-
|
|
1154
|
-
sourceSearchWord !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1110
|
+
sourceSearchWord !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1155
1111
|
SourceSearchBox,
|
|
1156
1112
|
{
|
|
1157
1113
|
searchTerm: sourceSearchWord,
|
|
@@ -1170,14 +1126,14 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
1170
1126
|
};
|
|
1171
1127
|
|
|
1172
1128
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
|
|
1173
|
-
var
|
|
1129
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1174
1130
|
var HoveringInsertionPromptBox = (props) => {
|
|
1175
|
-
return /* @__PURE__ */ (0,
|
|
1131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1176
1132
|
"div",
|
|
1177
1133
|
{
|
|
1178
1134
|
className: "flex flex-col justify-center items-center space-y-4 rounded-md border shadow-lg p-4 border-gray- bg-white",
|
|
1179
1135
|
style: { width: "35rem" },
|
|
1180
|
-
children: /* @__PURE__ */ (0,
|
|
1136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1181
1137
|
HoveringInsertionPromptBoxCore,
|
|
1182
1138
|
{
|
|
1183
1139
|
state: {
|
|
@@ -1196,7 +1152,7 @@ var HoveringInsertionPromptBox = (props) => {
|
|
|
1196
1152
|
var import_css = require("@emotion/css");
|
|
1197
1153
|
var import_react8 = __toESM(require("react"));
|
|
1198
1154
|
var import_react_dom = __toESM(require("react-dom"));
|
|
1199
|
-
var
|
|
1155
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1200
1156
|
var Button2 = import_react8.default.forwardRef(
|
|
1201
1157
|
(_a, ref) => {
|
|
1202
1158
|
var _b = _a, {
|
|
@@ -1208,7 +1164,7 @@ var Button2 = import_react8.default.forwardRef(
|
|
|
1208
1164
|
"active",
|
|
1209
1165
|
"reversed"
|
|
1210
1166
|
]);
|
|
1211
|
-
return /* @__PURE__ */ (0,
|
|
1167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1212
1168
|
"span",
|
|
1213
1169
|
__spreadProps(__spreadValues({}, props), {
|
|
1214
1170
|
ref,
|
|
@@ -1223,29 +1179,10 @@ var Button2 = import_react8.default.forwardRef(
|
|
|
1223
1179
|
);
|
|
1224
1180
|
}
|
|
1225
1181
|
);
|
|
1226
|
-
var Icon = import_react8.default.forwardRef(
|
|
1227
|
-
(_a, ref) => {
|
|
1228
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1229
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1230
|
-
"span",
|
|
1231
|
-
__spreadProps(__spreadValues({}, props), {
|
|
1232
|
-
ref,
|
|
1233
|
-
className: (0, import_css.cx)(
|
|
1234
|
-
"material-icons",
|
|
1235
|
-
className,
|
|
1236
|
-
import_css.css`
|
|
1237
|
-
font-size: 18px;
|
|
1238
|
-
vertical-align: text-bottom;
|
|
1239
|
-
`
|
|
1240
|
-
)
|
|
1241
|
-
})
|
|
1242
|
-
);
|
|
1243
|
-
}
|
|
1244
|
-
);
|
|
1245
1182
|
var Menu = import_react8.default.forwardRef(
|
|
1246
1183
|
(_a, ref) => {
|
|
1247
1184
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1248
|
-
return /* @__PURE__ */ (0,
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1249
1186
|
"div",
|
|
1250
1187
|
__spreadProps(__spreadValues({}, props), {
|
|
1251
1188
|
"data-test-id": "menu",
|
|
@@ -1272,7 +1209,7 @@ var Portal = ({ children }) => {
|
|
|
1272
1209
|
var Toolbar = import_react8.default.forwardRef(
|
|
1273
1210
|
(_a, ref) => {
|
|
1274
1211
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1275
|
-
return /* @__PURE__ */ (0,
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1276
1213
|
Menu,
|
|
1277
1214
|
__spreadProps(__spreadValues({}, props), {
|
|
1278
1215
|
ref,
|
|
@@ -1292,7 +1229,7 @@ var Toolbar = import_react8.default.forwardRef(
|
|
|
1292
1229
|
);
|
|
1293
1230
|
|
|
1294
1231
|
// src/components/hovering-toolbar/hovering-toolbar.tsx
|
|
1295
|
-
var
|
|
1232
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1296
1233
|
var HoveringToolbar = (props) => {
|
|
1297
1234
|
const ref = (0, import_react9.useRef)(null);
|
|
1298
1235
|
const editor = (0, import_slate_react3.useSlate)();
|
|
@@ -1355,12 +1292,12 @@ var HoveringToolbar = (props) => {
|
|
|
1355
1292
|
if (!isClient) {
|
|
1356
1293
|
return null;
|
|
1357
1294
|
}
|
|
1358
|
-
return /* @__PURE__ */ (0,
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1359
1296
|
Menu,
|
|
1360
1297
|
{
|
|
1361
1298
|
ref,
|
|
1362
1299
|
className: "copilot-kit-textarea-css-scope " + (props.hoverMenuClassname || "p-2 absolute z-10 top-[-10000px] left-[-10000px] mt-[-6px] opacity-0 transition-opacity duration-700"),
|
|
1363
|
-
children: isDisplayed && selection && /* @__PURE__ */ (0,
|
|
1300
|
+
children: isDisplayed && selection && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1364
1301
|
HoveringInsertionPromptBox,
|
|
1365
1302
|
{
|
|
1366
1303
|
editorState: editorState(editor, selection),
|
|
@@ -1394,22 +1331,22 @@ function editorState(editor, selection) {
|
|
|
1394
1331
|
}
|
|
1395
1332
|
|
|
1396
1333
|
// src/components/base-copilot-textarea/render-element.tsx
|
|
1397
|
-
var
|
|
1334
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1398
1335
|
function makeRenderElementFunction(suggestionsStyle) {
|
|
1399
1336
|
return (props) => {
|
|
1400
1337
|
switch (props.element.type) {
|
|
1401
1338
|
case "paragraph":
|
|
1402
|
-
return /* @__PURE__ */ (0,
|
|
1339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DefaultElement, __spreadValues({}, props));
|
|
1403
1340
|
case "suggestion":
|
|
1404
|
-
return /* @__PURE__ */ (0,
|
|
1341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SuggestionElement, __spreadProps(__spreadValues({}, props), { suggestionsStyle }));
|
|
1405
1342
|
}
|
|
1406
1343
|
};
|
|
1407
1344
|
}
|
|
1408
1345
|
var DefaultElement = (props) => {
|
|
1409
|
-
return /* @__PURE__ */ (0,
|
|
1346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", __spreadProps(__spreadValues({}, props.attributes), { children: props.children }));
|
|
1410
1347
|
};
|
|
1411
1348
|
var SuggestionElement = (props) => {
|
|
1412
|
-
return /* @__PURE__ */ (0,
|
|
1349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1413
1350
|
"span",
|
|
1414
1351
|
__spreadProps(__spreadValues({}, props.attributes), {
|
|
1415
1352
|
style: __spreadValues({}, props.suggestionsStyle),
|
|
@@ -1423,11 +1360,11 @@ var SuggestionElement = (props) => {
|
|
|
1423
1360
|
};
|
|
1424
1361
|
|
|
1425
1362
|
// src/components/base-copilot-textarea/render-placeholder.tsx
|
|
1426
|
-
var
|
|
1363
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1427
1364
|
function makeRenderPlaceholderFunction(placeholderStyle) {
|
|
1428
1365
|
return (props) => {
|
|
1429
1366
|
const _a = props.attributes, { style } = _a, restAttributes = __objRest(_a, ["style"]);
|
|
1430
|
-
return /* @__PURE__ */ (0,
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1431
1368
|
"div",
|
|
1432
1369
|
__spreadProps(__spreadValues({}, restAttributes), {
|
|
1433
1370
|
style: __spreadValues(__spreadValues({}, style), placeholderStyle),
|
|
@@ -1539,7 +1476,7 @@ var editorToText = (editor) => {
|
|
|
1539
1476
|
};
|
|
1540
1477
|
|
|
1541
1478
|
// src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx
|
|
1542
|
-
var
|
|
1479
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1543
1480
|
function TrackerTextEditedSinceLastCursorMovement(props) {
|
|
1544
1481
|
const cursorState = (0, import_slate_react4.useSlateSelector)((state) => ({
|
|
1545
1482
|
selection: state.selection,
|
|
@@ -1554,7 +1491,7 @@ function TrackerTextEditedSinceLastCursorMovement(props) {
|
|
|
1554
1491
|
props.setCursorMovedSinceLastTextChange(true);
|
|
1555
1492
|
}
|
|
1556
1493
|
}, [props.setCursorMovedSinceLastTextChange, cursorState]);
|
|
1557
|
-
return /* @__PURE__ */ (0,
|
|
1494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, {});
|
|
1558
1495
|
}
|
|
1559
1496
|
var cursorChangedWithoutTextChanged = (prev, next) => {
|
|
1560
1497
|
const isSelectionChanged = !isSelectionEqual(prev.selection, next.selection);
|
|
@@ -1562,10 +1499,8 @@ var cursorChangedWithoutTextChanged = (prev, next) => {
|
|
|
1562
1499
|
return isSelectionChanged && isTextSame;
|
|
1563
1500
|
};
|
|
1564
1501
|
var isSelectionEqual = (a, b) => {
|
|
1565
|
-
if (!a && !b)
|
|
1566
|
-
|
|
1567
|
-
if (!a || !b)
|
|
1568
|
-
return false;
|
|
1502
|
+
if (!a && !b) return true;
|
|
1503
|
+
if (!a || !b) return false;
|
|
1569
1504
|
return import_slate9.Range.equals(a, b);
|
|
1570
1505
|
};
|
|
1571
1506
|
function usePrevious(value) {
|
|
@@ -1577,10 +1512,10 @@ function usePrevious(value) {
|
|
|
1577
1512
|
}
|
|
1578
1513
|
|
|
1579
1514
|
// src/components/base-copilot-textarea/base-copilot-textarea.tsx
|
|
1580
|
-
var
|
|
1515
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1581
1516
|
var BaseCopilotTextarea = import_react12.default.forwardRef(
|
|
1582
1517
|
(props, ref) => {
|
|
1583
|
-
return /* @__PURE__ */ (0,
|
|
1518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(HoveringEditorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BaseCopilotTextareaWithHoveringContext, __spreadProps(__spreadValues({}, props), { ref })) });
|
|
1584
1519
|
}
|
|
1585
1520
|
);
|
|
1586
1521
|
var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
|
|
@@ -1708,7 +1643,7 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
|
|
|
1708
1643
|
const mergedClassName = (0, import_tailwind_merge2.twMerge)(defaultTailwindClassName, className != null ? className : "");
|
|
1709
1644
|
return `${baseClassName} ${brandingClass} ${mergedClassName}`;
|
|
1710
1645
|
})();
|
|
1711
|
-
return /* @__PURE__ */ (0,
|
|
1646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1712
1647
|
import_slate_react5.Slate,
|
|
1713
1648
|
{
|
|
1714
1649
|
editor,
|
|
@@ -1728,13 +1663,13 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
|
|
|
1728
1663
|
(_b = props.onChange) == null ? void 0 : _b.call(props, makeSemiFakeReactTextAreaEvent(fullEditorText));
|
|
1729
1664
|
},
|
|
1730
1665
|
children: [
|
|
1731
|
-
/* @__PURE__ */ (0,
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1732
1667
|
TrackerTextEditedSinceLastCursorMovement,
|
|
1733
1668
|
{
|
|
1734
1669
|
setCursorMovedSinceLastTextChange
|
|
1735
1670
|
}
|
|
1736
1671
|
),
|
|
1737
|
-
/* @__PURE__ */ (0,
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1738
1673
|
HoveringToolbar,
|
|
1739
1674
|
{
|
|
1740
1675
|
apiConfig: autosuggestionsConfig.apiConfig,
|
|
@@ -1742,7 +1677,7 @@ var BaseCopilotTextareaWithHoveringContext = import_react12.default.forwardRef(
|
|
|
1742
1677
|
hoverMenuClassname
|
|
1743
1678
|
}
|
|
1744
1679
|
),
|
|
1745
|
-
/* @__PURE__ */ (0,
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1746
1681
|
import_slate_react5.Editable,
|
|
1747
1682
|
__spreadValues({
|
|
1748
1683
|
renderElement: renderElementMemoized,
|