@copilotkit/react-textarea 1.1.3-feat-runtime-remote-actions.1 → 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 -14
- 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 +54 -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 +54 -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 +1 -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 +61 -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 +1 -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-52SISOOU.mjs +0 -100
- package/dist/chunk-52SISOOU.mjs.map +0 -1
- package/dist/chunk-5UNJXFUO.mjs +0 -29
- package/dist/chunk-5UNJXFUO.mjs.map +0 -1
- package/dist/chunk-6OSHC73C.mjs +0 -60
- package/dist/chunk-6OSHC73C.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-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-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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/hovering-toolbar/hovering-editor-provider.tsx"],"sourcesContent":["import { createContext, useState, useContext, ReactNode } from \"react\";\n\ninterface HoveringEditorContextProps {\n isDisplayed: boolean;\n setIsDisplayed: (value: boolean) => void;\n}\n\nconst HoveringEditorContext = createContext<HoveringEditorContextProps>({\n isDisplayed: false,\n setIsDisplayed: () => {},\n});\n\nexport interface HoveringEditorProviderProps {\n children: ReactNode;\n}\n\n/**\n * A context provider for the hovering editor over the `CopilotTextarea`\n * (used to edit and insert text into the `CopilotTextarea`).\n */\nexport const HoveringEditorProvider = ({ children }: HoveringEditorProviderProps) => {\n const [isDisplayed, setIsDisplayed] = useState<boolean>(false);\n\n return (\n <HoveringEditorContext.Provider value={{ isDisplayed, setIsDisplayed }}>\n {children}\n </HoveringEditorContext.Provider>\n );\n};\n\nexport const useHoveringEditorContext = () => useContext(HoveringEditorContext);\n"],"mappings":";AAAA,SAAS,eAAe,UAAU,kBAA6B;AAwB3D;AAjBJ,IAAM,wBAAwB,cAA0C;AAAA,EACtE,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AACzB,CAAC;AAUM,IAAM,yBAAyB,CAAC,EAAE,SAAS,MAAmC;AACnF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkB,KAAK;AAE7D,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,aAAa,eAAe,GAClE,UACH;AAEJ;AAEO,IAAM,2BAA2B,MAAM,WAAW,qBAAqB;","names":[]}
|
package/dist/chunk-MCNXIA4Q.mjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// src/types/autosuggestions-config/insertions-api-config.tsx
|
|
2
|
-
import { Role, TextMessage } from "@copilotkit/runtime-client-gql";
|
|
3
|
-
var defaultInsertionsMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
4
|
-
return `You are a versatile writing assistant helping the user insert new text into their existing work.
|
|
5
|
-
|
|
6
|
-
The user is writing some text.
|
|
7
|
-
The purpose is: "${textareaPurpose}"
|
|
8
|
-
|
|
9
|
-
The following external context is also provided. Use it to inform your suggestions when relevant!!!
|
|
10
|
-
\`\`\`
|
|
11
|
-
${contextString}
|
|
12
|
-
\`\`\`
|
|
13
|
-
|
|
14
|
-
The user will provide you with a prompt for an INSERTION into the text they are writing.
|
|
15
|
-
Your job is to come up with an INSERTION into the text that the user would like to use, AS BEST YOU CAN.
|
|
16
|
-
Only insert a SHORT segment. Usually 1 sentence, or at most 1 paragraph.
|
|
17
|
-
|
|
18
|
-
Adjust yourself to the user's style and implied intent.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
The user will provide the text before and after the cursor, as well as the INSERTION prompt. You should use this to infer the best relevant insertion.
|
|
22
|
-
The conversation will be structured as follows:
|
|
23
|
-
<TextAfterCursor>
|
|
24
|
-
<TextBeforeCursor>
|
|
25
|
-
<InsertionPrompt>
|
|
26
|
-
|
|
27
|
-
<YourInsertionSuggestion>
|
|
28
|
-
`;
|
|
29
|
-
};
|
|
30
|
-
var defaultInsertionsFewShotMessages = [
|
|
31
|
-
new TextMessage({
|
|
32
|
-
role: Role.User,
|
|
33
|
-
content: "<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>"
|
|
34
|
-
}),
|
|
35
|
-
new TextMessage({
|
|
36
|
-
role: Role.User,
|
|
37
|
-
content: "<TextBeforeCursor>This morning I woke up and went straight to the grocery store.</TextBeforeCursor>"
|
|
38
|
-
}),
|
|
39
|
-
new TextMessage({
|
|
40
|
-
role: Role.User,
|
|
41
|
-
content: "<InsertionPrompt>I bought a big watermelon</InsertionPrompt>"
|
|
42
|
-
}),
|
|
43
|
-
new TextMessage({
|
|
44
|
-
role: Role.Assistant,
|
|
45
|
-
content: "When I arrived I went straight to the produce section and picked out a big watermelon."
|
|
46
|
-
}),
|
|
47
|
-
new TextMessage({
|
|
48
|
-
role: Role.User,
|
|
49
|
-
content: "<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>"
|
|
50
|
-
}),
|
|
51
|
-
new TextMessage({
|
|
52
|
-
role: Role.User,
|
|
53
|
-
content: `<TextBeforeCursor>The Optionholder, in the Optionholder's capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an "Equityholder" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an "Equityholder" thereunder;</TextBeforeCursor>`
|
|
54
|
-
}),
|
|
55
|
-
new TextMessage({
|
|
56
|
-
role: Role.User,
|
|
57
|
-
content: "<InsertionPrompt>add section about the optionholder's pro rata share</InsertionPrompt>"
|
|
58
|
-
}),
|
|
59
|
-
new TextMessage({
|
|
60
|
-
role: Role.Assistant,
|
|
61
|
-
content: ` (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder's "Pro Rata Share"; `
|
|
62
|
-
})
|
|
63
|
-
];
|
|
64
|
-
var defaultInsertionsApiConfig = {
|
|
65
|
-
makeSystemPrompt: defaultInsertionsMakeSystemPrompt,
|
|
66
|
-
fewShotMessages: defaultInsertionsFewShotMessages,
|
|
67
|
-
forwardedParams: void 0
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export {
|
|
71
|
-
defaultInsertionsMakeSystemPrompt,
|
|
72
|
-
defaultInsertionsFewShotMessages,
|
|
73
|
-
defaultInsertionsApiConfig
|
|
74
|
-
};
|
|
75
|
-
//# sourceMappingURL=chunk-MCNXIA4Q.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/autosuggestions-config/insertions-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface InsertionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultInsertionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant helping the user insert new text into their existing work.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe following external context is also provided. Use it to inform your suggestions when relevant!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThe user will provide you with a prompt for an INSERTION into the text they are writing. \nYour job is to come up with an INSERTION into the text that the user would like to use, AS BEST YOU CAN.\nOnly insert a SHORT segment. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\n\nThe user will provide the text before and after the cursor, as well as the INSERTION prompt. You should use this to infer the best relevant insertion.\nThe conversation will be structured as follows:\n<TextAfterCursor>\n<TextBeforeCursor>\n<InsertionPrompt>\n\n<YourInsertionSuggestion>\n`;\n};\n\nexport const defaultInsertionsFewShotMessages: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextBeforeCursor>This morning I woke up and went straight to the grocery store.</TextBeforeCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"<InsertionPrompt>I bought a big watermelon</InsertionPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \"When I arrived I went straight to the produce section and picked out a big watermelon.\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n '<TextBeforeCursor>The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;</TextBeforeCursor>',\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<InsertionPrompt>add section about the optionholder's pro rata share</InsertionPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n }),\n];\n\nexport const defaultInsertionsApiConfig: InsertionsApiConfig = {\n makeSystemPrompt: defaultInsertionsMakeSystemPrompt,\n fewShotMessages: defaultInsertionsFewShotMessages,\n forwardedParams: undefined,\n};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AASpC,IAAM,oCAAsD,CACjE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA,EAIlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBF;AAEO,IAAM,mCAA8C;AAAA,EACzD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,6BAAkD;AAAA,EAC7D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
|
package/dist/chunk-MMVDU6DF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-MMVDU6DF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-MRXNTQOX.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
__spreadValues,
|
|
55
|
-
__spreadProps,
|
|
56
|
-
__objRest,
|
|
57
|
-
__async
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=chunk-MRXNTQOX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-QJNFNPWH.mjs
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
replaceEditorText
|
|
3
|
-
} from "./chunk-5UNJXFUO.mjs";
|
|
4
|
-
import {
|
|
5
|
-
getFullEditorTextWithNewlines
|
|
6
|
-
} from "./chunk-ECR45NSD.mjs";
|
|
7
|
-
|
|
8
|
-
// src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { ReactEditor } from "slate-react";
|
|
11
|
-
function usePopulateCopilotTextareaRef(editor, ref) {
|
|
12
|
-
React.useImperativeHandle(ref, () => {
|
|
13
|
-
class Combined {
|
|
14
|
-
constructor(customMethods2, editorHtmlElement2) {
|
|
15
|
-
this.customMethods = customMethods2;
|
|
16
|
-
this.editorHtmlElement = editorHtmlElement2;
|
|
17
|
-
}
|
|
18
|
-
get(target, propKey) {
|
|
19
|
-
if (this.isKeyOfCustomMethods(propKey)) {
|
|
20
|
-
const value = this.customMethods[propKey];
|
|
21
|
-
if (typeof value === "function") {
|
|
22
|
-
return value.bind(this.customMethods);
|
|
23
|
-
}
|
|
24
|
-
return value;
|
|
25
|
-
} else if (this.isKeyOfHTMLElement(propKey)) {
|
|
26
|
-
const value = this.editorHtmlElement[propKey];
|
|
27
|
-
if (typeof value === "function") {
|
|
28
|
-
return value.bind(this.editorHtmlElement);
|
|
29
|
-
}
|
|
30
|
-
return value;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
set(target, propKey, value) {
|
|
34
|
-
if (this.isKeyOfCustomMethods(propKey)) {
|
|
35
|
-
this.customMethods[propKey] = value;
|
|
36
|
-
} else if (this.isKeyOfHTMLElement(propKey)) {
|
|
37
|
-
this.editorHtmlElement[propKey] = value;
|
|
38
|
-
} else {
|
|
39
|
-
target[propKey] = value;
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
isKeyOfCustomMethods(key) {
|
|
44
|
-
return key in this.customMethods;
|
|
45
|
-
}
|
|
46
|
-
isKeyOfHTMLElement(key) {
|
|
47
|
-
return key in this.editorHtmlElement;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const handler = {
|
|
51
|
-
get(target, propKey) {
|
|
52
|
-
return target.get(target, propKey);
|
|
53
|
-
},
|
|
54
|
-
set(target, propKey, value) {
|
|
55
|
-
return target.set(target, propKey, value);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
class CustomMethods {
|
|
59
|
-
constructor(editor2) {
|
|
60
|
-
this.editor = editor2;
|
|
61
|
-
}
|
|
62
|
-
focus() {
|
|
63
|
-
ReactEditor.focus(this.editor);
|
|
64
|
-
}
|
|
65
|
-
blur() {
|
|
66
|
-
ReactEditor.blur(this.editor);
|
|
67
|
-
}
|
|
68
|
-
get value() {
|
|
69
|
-
return getFullEditorTextWithNewlines(this.editor);
|
|
70
|
-
}
|
|
71
|
-
set value(value) {
|
|
72
|
-
replaceEditorText(this.editor, value);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const editorHtmlElement = ReactEditor.toDOMNode(editor, editor);
|
|
76
|
-
const customMethods = new CustomMethods(editor);
|
|
77
|
-
const combined = new Combined(customMethods, editorHtmlElement);
|
|
78
|
-
return new Proxy(combined, handler);
|
|
79
|
-
}, [editor]);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export {
|
|
83
|
-
usePopulateCopilotTextareaRef
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=chunk-QJNFNPWH.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts"],"sourcesContent":["import React from \"react\";\nimport { Editor } from \"slate\";\nimport { ReactEditor } from \"slate-react\";\nimport { getFullEditorTextWithNewlines } from \"../../lib/get-text-around-cursor\";\nimport { replaceEditorText } from \"../../lib/slatejs-edits/replace-text\";\nimport { HTMLCopilotTextAreaElement } from \"../../types\";\nimport { CustomEditor } from \"../../types/base/custom-editor\";\n\nexport function usePopulateCopilotTextareaRef(\n editor: Editor,\n ref: React.Ref<HTMLCopilotTextAreaElement>,\n) {\n React.useImperativeHandle(ref, () => {\n class Combined {\n constructor(\n private customMethods: CustomMethods,\n private editorHtmlElement: HTMLElement,\n ) {}\n\n [key: string]: any;\n\n get(target: any, propKey: string): any {\n if (this.isKeyOfCustomMethods(propKey)) {\n const value = this.customMethods[propKey];\n if (typeof value === \"function\") {\n return value.bind(this.customMethods);\n }\n return value;\n } else if (this.isKeyOfHTMLElement(propKey)) {\n const value = this.editorHtmlElement[propKey];\n if (typeof value === \"function\") {\n return value.bind(this.editorHtmlElement);\n }\n return value;\n }\n }\n\n set(target: any, propKey: string, value: any): boolean {\n if (this.isKeyOfCustomMethods(propKey)) {\n (this.customMethods as any)[propKey] = value;\n } else if (this.isKeyOfHTMLElement(propKey)) {\n (this.editorHtmlElement as any)[propKey] = value;\n } else {\n // Default behavior (optional)\n target[propKey] = value;\n }\n return true;\n }\n\n private isKeyOfCustomMethods(key: string): key is keyof CustomMethods {\n return key in this.customMethods;\n }\n\n private isKeyOfHTMLElement(key: string): key is keyof HTMLElement {\n return key in this.editorHtmlElement;\n }\n }\n\n const handler = {\n get(target: any, propKey: keyof CustomMethods | keyof HTMLElement) {\n return target.get(target, propKey);\n },\n set(target: any, propKey: keyof CustomMethods | keyof HTMLElement, value: any) {\n return target.set(target, propKey, value);\n },\n };\n\n class CustomMethods {\n constructor(private editor: CustomEditor) {}\n\n focus() {\n ReactEditor.focus(this.editor);\n }\n\n blur() {\n ReactEditor.blur(this.editor);\n }\n\n get value() {\n return getFullEditorTextWithNewlines(this.editor);\n }\n set value(value: string) {\n replaceEditorText(this.editor, value);\n }\n }\n\n const editorHtmlElement = ReactEditor.toDOMNode(editor, editor);\n const customMethods = new CustomMethods(editor);\n\n const combined = new Combined(customMethods, editorHtmlElement);\n return new Proxy(combined, handler);\n }, [editor]);\n}\n"],"mappings":";;;;;;;;AAAA,OAAO,WAAW;AAElB,SAAS,mBAAmB;AAMrB,SAAS,8BACd,QACA,KACA;AACA,QAAM,oBAAoB,KAAK,MAAM;AACnC,UAAM,SAAS;AAAA,MACb,YACUA,gBACAC,oBACR;AAFQ,6BAAAD;AACA,iCAAAC;AAAA,MACP;AAAA,MAIH,IAAI,QAAa,SAAsB;AACrC,YAAI,KAAK,qBAAqB,OAAO,GAAG;AACtC,gBAAM,QAAQ,KAAK,cAAc,OAAO;AACxC,cAAI,OAAO,UAAU,YAAY;AAC/B,mBAAO,MAAM,KAAK,KAAK,aAAa;AAAA,UACtC;AACA,iBAAO;AAAA,QACT,WAAW,KAAK,mBAAmB,OAAO,GAAG;AAC3C,gBAAM,QAAQ,KAAK,kBAAkB,OAAO;AAC5C,cAAI,OAAO,UAAU,YAAY;AAC/B,mBAAO,MAAM,KAAK,KAAK,iBAAiB;AAAA,UAC1C;AACA,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,MAEA,IAAI,QAAa,SAAiB,OAAqB;AACrD,YAAI,KAAK,qBAAqB,OAAO,GAAG;AACtC,UAAC,KAAK,cAAsB,OAAO,IAAI;AAAA,QACzC,WAAW,KAAK,mBAAmB,OAAO,GAAG;AAC3C,UAAC,KAAK,kBAA0B,OAAO,IAAI;AAAA,QAC7C,OAAO;AAEL,iBAAO,OAAO,IAAI;AAAA,QACpB;AACA,eAAO;AAAA,MACT;AAAA,MAEQ,qBAAqB,KAAyC;AACpE,eAAO,OAAO,KAAK;AAAA,MACrB;AAAA,MAEQ,mBAAmB,KAAuC;AAChE,eAAO,OAAO,KAAK;AAAA,MACrB;AAAA,IACF;AAEA,UAAM,UAAU;AAAA,MACd,IAAI,QAAa,SAAkD;AACjE,eAAO,OAAO,IAAI,QAAQ,OAAO;AAAA,MACnC;AAAA,MACA,IAAI,QAAa,SAAkD,OAAY;AAC7E,eAAO,OAAO,IAAI,QAAQ,SAAS,KAAK;AAAA,MAC1C;AAAA,IACF;AAEA,UAAM,cAAc;AAAA,MAClB,YAAoBC,SAAsB;AAAtB,sBAAAA;AAAA,MAAuB;AAAA,MAE3C,QAAQ;AACN,oBAAY,MAAM,KAAK,MAAM;AAAA,MAC/B;AAAA,MAEA,OAAO;AACL,oBAAY,KAAK,KAAK,MAAM;AAAA,MAC9B;AAAA,MAEA,IAAI,QAAQ;AACV,eAAO,8BAA8B,KAAK,MAAM;AAAA,MAClD;AAAA,MACA,IAAI,MAAM,OAAe;AACvB,0BAAkB,KAAK,QAAQ,KAAK;AAAA,MACtC;AAAA,IACF;AAEA,UAAM,oBAAoB,YAAY,UAAU,QAAQ,MAAM;AAC9D,UAAM,gBAAgB,IAAI,cAAc,MAAM;AAE9C,UAAM,WAAW,IAAI,SAAS,eAAe,iBAAiB;AAC9D,WAAO,IAAI,MAAM,UAAU,OAAO;AAAA,EACpC,GAAG,CAAC,MAAM,CAAC;AACb;","names":["customMethods","editorHtmlElement","editor"]}
|
package/dist/chunk-RUV6NBIF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-RUV6NBIF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-SDHH6DI6.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/types/autosuggestions-config/suggestions-api-config.tsx
|
|
2
|
-
import { Role, TextMessage } from "@copilotkit/runtime-client-gql";
|
|
3
|
-
var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
4
|
-
return `You are a versatile writing assistant.
|
|
5
|
-
|
|
6
|
-
The user is writing some text.
|
|
7
|
-
The purpose is: "${textareaPurpose}"
|
|
8
|
-
|
|
9
|
-
Your job is to guess what the user will write next AS BEST YOU CAN.
|
|
10
|
-
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
11
|
-
|
|
12
|
-
Adjust yourself to the user's style and implied intent.
|
|
13
|
-
|
|
14
|
-
The user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.
|
|
15
|
-
<TextAfterCursor>
|
|
16
|
-
<TextBeforeCursor>
|
|
17
|
-
<YourSuggestion>
|
|
18
|
-
|
|
19
|
-
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
|
|
20
|
-
|
|
21
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
22
|
-
\`\`\`
|
|
23
|
-
${contextString}
|
|
24
|
-
\`\`\`
|
|
25
|
-
`;
|
|
26
|
-
};
|
|
27
|
-
var defaultSuggestionsFewShotMessages = [
|
|
28
|
-
new TextMessage({
|
|
29
|
-
role: Role.User,
|
|
30
|
-
content: "<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>"
|
|
31
|
-
}),
|
|
32
|
-
new TextMessage({
|
|
33
|
-
role: Role.User,
|
|
34
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
35
|
-
}),
|
|
36
|
-
new TextMessage({
|
|
37
|
-
role: Role.Assistant,
|
|
38
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
39
|
-
}),
|
|
40
|
-
new TextMessage({
|
|
41
|
-
role: Role.User,
|
|
42
|
-
content: "<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>"
|
|
43
|
-
}),
|
|
44
|
-
new TextMessage({
|
|
45
|
-
role: Role.User,
|
|
46
|
-
content: `<TextBeforeCursor>The Optionholder, in the Optionholder's capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an "Equityholder" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an "Equityholder" thereunder;</TextBeforeCursor>`
|
|
47
|
-
}),
|
|
48
|
-
new TextMessage({
|
|
49
|
-
role: Role.Assistant,
|
|
50
|
-
content: ` (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder's "Pro Rata Share"; `
|
|
51
|
-
})
|
|
52
|
-
];
|
|
53
|
-
var defaultSuggestionsApiConfig = {
|
|
54
|
-
makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
|
|
55
|
-
fewShotMessages: defaultSuggestionsFewShotMessages
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
defaultSuggestionsMakeSystemPrompt,
|
|
60
|
-
defaultSuggestionsFewShotMessages,
|
|
61
|
-
defaultSuggestionsApiConfig
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=chunk-SDHH6DI6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/autosuggestions-config/suggestions-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n maxTokens?: number;\n stop?: string[];\n}\n\nexport const defaultSuggestionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nYour job is to guess what the user will write next AS BEST YOU CAN.\nOnly guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.\n<TextAfterCursor>\n<TextBeforeCursor>\n<YourSuggestion>\n\nIf we need to add a whitespace character to the suggested text, make sure to explicitly add it in.\n\nThe following external context is also provided. Use it to help you make better suggestions!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n`;\n};\n\nexport const defaultSuggestionsFewShotMessages: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"This morning I woke up and went straight to the grocery store.\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n '<TextBeforeCursor>The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;</TextBeforeCursor>',\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n }),\n];\n\nexport const defaultSuggestionsApiConfig: SuggestionsApiConfig = {\n makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,\n fewShotMessages: defaultSuggestionsFewShotMessages,\n};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AAUpC,IAAM,qCAAuD,CAClE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBlB;AAAA;AAAA;AAGF;AAEO,IAAM,oCAA+C;AAAA,EAC1D,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;","names":[]}
|
package/dist/chunk-T6MTDQZ7.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// src/lib/editor-to-text.ts
|
|
2
|
-
import { Element } from "slate";
|
|
3
|
-
function nodeChildrenToTextComponents(editor, nodes) {
|
|
4
|
-
const indeciesOfInlineElements = new Set(
|
|
5
|
-
nodes.map((node, index) => {
|
|
6
|
-
if (Element.isElement(node) && editor.isInline(node)) {
|
|
7
|
-
return index;
|
|
8
|
-
}
|
|
9
|
-
return -1;
|
|
10
|
-
}).filter((index) => index !== -1)
|
|
11
|
-
);
|
|
12
|
-
const nonIgnorableItems = nodes.filter((node, index) => {
|
|
13
|
-
const isInline = indeciesOfInlineElements.has(index);
|
|
14
|
-
if (isInline) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
const isNeighbourOfInline = indeciesOfInlineElements.has(index - 1) || indeciesOfInlineElements.has(index + 1);
|
|
18
|
-
if (isNeighbourOfInline) {
|
|
19
|
-
return node.text !== "";
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
});
|
|
23
|
-
return nonIgnorableItems.map((node) => {
|
|
24
|
-
if (Element.isElement(node)) {
|
|
25
|
-
switch (node.type) {
|
|
26
|
-
case "paragraph":
|
|
27
|
-
return nodeChildrenToTextComponents(editor, node.children);
|
|
28
|
-
case "suggestion":
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
return [node];
|
|
33
|
-
}
|
|
34
|
-
}).reduce((acc, val) => acc.concat(val), []);
|
|
35
|
-
}
|
|
36
|
-
var editorToText = (editor) => {
|
|
37
|
-
const flattened = nodeChildrenToTextComponents(editor, editor.children);
|
|
38
|
-
const text = flattened.map((textComponent) => textComponent.text).join("\n");
|
|
39
|
-
return text;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
editorToText
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=chunk-T6MTDQZ7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/editor-to-text.ts"],"sourcesContent":["import { BaseEditor, Descendant, Element } from \"slate\";\nimport { HistoryEditor } from \"slate-history\";\nimport { ReactEditor } from \"slate-react\";\nimport { SuggestionAwareText } from \"../types/base/custom-editor\";\n\nfunction nodeChildrenToTextComponents(\n editor: BaseEditor & ReactEditor & HistoryEditor,\n nodes: Descendant[],\n): SuggestionAwareText[] {\n // find inlineable elements\n const indeciesOfInlineElements = new Set(\n nodes\n .map((node, index) => {\n if (Element.isElement(node) && editor.isInline(node)) {\n return index;\n }\n return -1;\n })\n .filter((index) => index !== -1),\n );\n\n // ignorable elements = inline elements,\n // or neighbors of inline elements that are {text: \"\"}\n const nonIgnorableItems = nodes.filter((node, index) => {\n const isInline = indeciesOfInlineElements.has(index);\n if (isInline) {\n return false;\n }\n\n const isNeighbourOfInline =\n indeciesOfInlineElements.has(index - 1) || indeciesOfInlineElements.has(index + 1);\n if (isNeighbourOfInline) {\n return (node as any).text !== \"\";\n }\n\n return true;\n });\n\n return nonIgnorableItems\n .map((node) => {\n if (Element.isElement(node)) {\n switch (node.type) {\n case \"paragraph\":\n return nodeChildrenToTextComponents(editor, node.children);\n case \"suggestion\":\n return [];\n }\n } else {\n return [node];\n }\n })\n .reduce((acc, val) => acc.concat(val), []);\n}\n\nexport const editorToText = (editor: BaseEditor & ReactEditor & HistoryEditor) => {\n const flattened = nodeChildrenToTextComponents(editor, editor.children);\n\n const text = flattened.map((textComponent) => textComponent.text).join(\"\\n\");\n\n return text;\n};\n"],"mappings":";AAAA,SAAiC,eAAe;AAKhD,SAAS,6BACP,QACA,OACuB;AAEvB,QAAM,2BAA2B,IAAI;AAAA,IACnC,MACG,IAAI,CAAC,MAAM,UAAU;AACpB,UAAI,QAAQ,UAAU,IAAI,KAAK,OAAO,SAAS,IAAI,GAAG;AACpD,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT,CAAC,EACA,OAAO,CAAC,UAAU,UAAU,EAAE;AAAA,EACnC;AAIA,QAAM,oBAAoB,MAAM,OAAO,CAAC,MAAM,UAAU;AACtD,UAAM,WAAW,yBAAyB,IAAI,KAAK;AACnD,QAAI,UAAU;AACZ,aAAO;AAAA,IACT;AAEA,UAAM,sBACJ,yBAAyB,IAAI,QAAQ,CAAC,KAAK,yBAAyB,IAAI,QAAQ,CAAC;AACnF,QAAI,qBAAqB;AACvB,aAAQ,KAAa,SAAS;AAAA,IAChC;AAEA,WAAO;AAAA,EACT,CAAC;AAED,SAAO,kBACJ,IAAI,CAAC,SAAS;AACb,QAAI,QAAQ,UAAU,IAAI,GAAG;AAC3B,cAAQ,KAAK,MAAM;AAAA,QACjB,KAAK;AACH,iBAAO,6BAA6B,QAAQ,KAAK,QAAQ;AAAA,QAC3D,KAAK;AACH,iBAAO,CAAC;AAAA,MACZ;AAAA,IACF,OAAO;AACL,aAAO,CAAC,IAAI;AAAA,IACd;AAAA,EACF,CAAC,EACA,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,GAAG,GAAG,CAAC,CAAC;AAC7C;AAEO,IAAM,eAAe,CAAC,WAAqD;AAChF,QAAM,YAAY,6BAA6B,QAAQ,OAAO,QAAQ;AAEtE,QAAM,OAAO,UAAU,IAAI,CAAC,kBAAkB,cAAc,IAAI,EAAE,KAAK,IAAI;AAE3E,SAAO;AACT;","names":[]}
|
package/dist/chunk-UGEKMSRR.mjs
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IncludedFilesPreview
|
|
3
|
-
} from "./chunk-KMVGEY7Q.mjs";
|
|
4
|
-
import {
|
|
5
|
-
use_autosize_textarea_default
|
|
6
|
-
} from "./chunk-3PQ7GSFE.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Button
|
|
9
|
-
} from "./chunk-4PDYALMP.mjs";
|
|
10
|
-
import {
|
|
11
|
-
Label
|
|
12
|
-
} from "./chunk-D47EKHIF.mjs";
|
|
13
|
-
import {
|
|
14
|
-
useHoveringEditorContext
|
|
15
|
-
} from "./chunk-LYB4B6MK.mjs";
|
|
16
|
-
import {
|
|
17
|
-
SourceSearchBox
|
|
18
|
-
} from "./chunk-WGWQRALG.mjs";
|
|
19
|
-
import {
|
|
20
|
-
streamPromiseFlatten
|
|
21
|
-
} from "./chunk-2QDCE7PD.mjs";
|
|
22
|
-
import {
|
|
23
|
-
__async
|
|
24
|
-
} from "./chunk-MRXNTQOX.mjs";
|
|
25
|
-
|
|
26
|
-
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
27
|
-
import { useCopilotContext } from "@copilotkit/react-core";
|
|
28
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
29
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
-
var HoveringInsertionPromptBoxCore = ({
|
|
31
|
-
performInsertion,
|
|
32
|
-
state,
|
|
33
|
-
insertionOrEditingFunction,
|
|
34
|
-
contextCategories
|
|
35
|
-
}) => {
|
|
36
|
-
const { getDocumentsContext } = useCopilotContext();
|
|
37
|
-
const [editSuggestion, setEditSuggestion] = useState("");
|
|
38
|
-
const [suggestionIsLoading, setSuggestionIsLoading] = useState(false);
|
|
39
|
-
const [adjustmentPrompt, setAdjustmentPrompt] = useState("");
|
|
40
|
-
const [generatingSuggestion, setGeneratingSuggestion] = useState(
|
|
41
|
-
null
|
|
42
|
-
);
|
|
43
|
-
const adjustmentTextAreaRef = useRef(null);
|
|
44
|
-
const suggestionTextAreaRef = useRef(null);
|
|
45
|
-
const [filePointers, setFilePointers] = useState([]);
|
|
46
|
-
const [suggestedFiles, setSuggestedFiles] = useState([]);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
setSuggestedFiles(getDocumentsContext(contextCategories));
|
|
49
|
-
}, [contextCategories, getDocumentsContext]);
|
|
50
|
-
use_autosize_textarea_default(suggestionTextAreaRef, editSuggestion || "");
|
|
51
|
-
use_autosize_textarea_default(adjustmentTextAreaRef, adjustmentPrompt || "");
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
var _a;
|
|
54
|
-
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
55
|
-
}, []);
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (!generatingSuggestion) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (generatingSuggestion.locked) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
setEditSuggestion("");
|
|
64
|
-
const reader = generatingSuggestion.getReader();
|
|
65
|
-
const read = () => __async(void 0, null, function* () {
|
|
66
|
-
setSuggestionIsLoading(true);
|
|
67
|
-
while (true) {
|
|
68
|
-
const { done, value } = yield reader.read();
|
|
69
|
-
if (done) {
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
setEditSuggestion((prev) => {
|
|
73
|
-
const newSuggestion = prev + value;
|
|
74
|
-
if (suggestionTextAreaRef.current) {
|
|
75
|
-
suggestionTextAreaRef.current.scrollTop = suggestionTextAreaRef.current.scrollHeight;
|
|
76
|
-
}
|
|
77
|
-
return newSuggestion;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
setSuggestionIsLoading(false);
|
|
81
|
-
});
|
|
82
|
-
read();
|
|
83
|
-
return () => {
|
|
84
|
-
const releaseLockIfNotClosed = () => __async(void 0, null, function* () {
|
|
85
|
-
try {
|
|
86
|
-
yield reader.closed;
|
|
87
|
-
} catch (e) {
|
|
88
|
-
reader.releaseLock();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
releaseLockIfNotClosed();
|
|
92
|
-
};
|
|
93
|
-
}, [generatingSuggestion]);
|
|
94
|
-
const beginGeneratingAdjustment = useCallback(() => __async(void 0, null, function* () {
|
|
95
|
-
if (!adjustmentPrompt.trim()) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
let modificationState = state.editorState;
|
|
99
|
-
if (editSuggestion !== "") {
|
|
100
|
-
modificationState.selectedText = editSuggestion;
|
|
101
|
-
}
|
|
102
|
-
const adjustmentSuggestionTextStreamPromise = insertionOrEditingFunction(
|
|
103
|
-
modificationState,
|
|
104
|
-
adjustmentPrompt,
|
|
105
|
-
filePointers,
|
|
106
|
-
new AbortController().signal
|
|
107
|
-
);
|
|
108
|
-
const adjustmentSuggestionTextStream = streamPromiseFlatten(
|
|
109
|
-
adjustmentSuggestionTextStreamPromise
|
|
110
|
-
);
|
|
111
|
-
setGeneratingSuggestion(adjustmentSuggestionTextStream);
|
|
112
|
-
}), [
|
|
113
|
-
adjustmentPrompt,
|
|
114
|
-
editSuggestion,
|
|
115
|
-
state.editorState,
|
|
116
|
-
insertionOrEditingFunction,
|
|
117
|
-
filePointers
|
|
118
|
-
]);
|
|
119
|
-
const isLoading = suggestionIsLoading;
|
|
120
|
-
const textToEdit = editSuggestion || state.editorState.selectedText;
|
|
121
|
-
const adjustmentLabel = textToEdit === "" ? "Describe the text you want to insert" : "Describe adjustments to the suggested text";
|
|
122
|
-
const placeholder = textToEdit === "" ? "e.g. 'summarize the client's top 3 pain-points from @CallTranscript'" : "e.g. 'make it more formal', 'be more specific', ...";
|
|
123
|
-
const { setIsDisplayed } = useHoveringEditorContext();
|
|
124
|
-
const AdjustmentPromptComponent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
125
|
-
/* @__PURE__ */ jsx(Label, { className: "", children: adjustmentLabel }),
|
|
126
|
-
/* @__PURE__ */ jsxs("div", { className: "relative w-full flex items-center", children: [
|
|
127
|
-
/* @__PURE__ */ jsx(
|
|
128
|
-
"textarea",
|
|
129
|
-
{
|
|
130
|
-
disabled: suggestionIsLoading,
|
|
131
|
-
ref: adjustmentTextAreaRef,
|
|
132
|
-
value: adjustmentPrompt,
|
|
133
|
-
onChange: (e) => setAdjustmentPrompt(e.target.value),
|
|
134
|
-
onKeyDown: (e) => {
|
|
135
|
-
if (e.key === "Enter" && e.shiftKey) {
|
|
136
|
-
e.preventDefault();
|
|
137
|
-
setAdjustmentPrompt(adjustmentPrompt + "\n");
|
|
138
|
-
} else if (e.key === "Enter") {
|
|
139
|
-
e.preventDefault();
|
|
140
|
-
beginGeneratingAdjustment();
|
|
141
|
-
} else if (e.key == "Escape") {
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
setIsDisplayed(false);
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
placeholder,
|
|
147
|
-
style: { minHeight: "3rem" },
|
|
148
|
-
className: "w-full bg-slate-100 h-auto h-min-14 text-sm p-2 rounded-md resize-none overflow-visible focus:outline-none focus:ring-0 focus:border-non pr-[3rem]",
|
|
149
|
-
rows: 1
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
153
|
-
"button",
|
|
154
|
-
{
|
|
155
|
-
onClick: beginGeneratingAdjustment,
|
|
156
|
-
className: "absolute right-2 bg-blue-500 text-white w-8 h-8 rounded-full flex items-center justify-center",
|
|
157
|
-
children: /* @__PURE__ */ jsx("i", { className: "material-icons", children: "arrow_forward" })
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
] })
|
|
161
|
-
] });
|
|
162
|
-
const SuggestionComponent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
163
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-end w-full", children: [
|
|
164
|
-
/* @__PURE__ */ jsx(Label, { className: "mt-4", children: "Suggested:" }),
|
|
165
|
-
/* @__PURE__ */ jsx("div", { className: "ml-auto", children: isLoading && /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ jsx(
|
|
166
|
-
"div",
|
|
167
|
-
{
|
|
168
|
-
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]",
|
|
169
|
-
role: "status",
|
|
170
|
-
children: /* @__PURE__ */ 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..." })
|
|
171
|
-
}
|
|
172
|
-
) }) })
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ jsx(
|
|
175
|
-
"textarea",
|
|
176
|
-
{
|
|
177
|
-
ref: suggestionTextAreaRef,
|
|
178
|
-
value: editSuggestion,
|
|
179
|
-
disabled: suggestionIsLoading,
|
|
180
|
-
onChange: (e) => setEditSuggestion(e.target.value),
|
|
181
|
-
className: "w-full text-base p-2 border border-gray-300 rounded-md resize-none bg-green-50",
|
|
182
|
-
style: { overflow: "auto", maxHeight: "10em" }
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
] });
|
|
186
|
-
const SubmitComponent = /* @__PURE__ */ jsx("div", { className: "flex w-full gap-4 justify-start", children: /* @__PURE__ */ jsxs(
|
|
187
|
-
Button,
|
|
188
|
-
{
|
|
189
|
-
className: " bg-green-700 text-white",
|
|
190
|
-
onClick: () => {
|
|
191
|
-
performInsertion(editSuggestion);
|
|
192
|
-
},
|
|
193
|
-
children: [
|
|
194
|
-
"Insert ",
|
|
195
|
-
/* @__PURE__ */ jsx("i", { className: "material-icons", children: "check" })
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
) });
|
|
199
|
-
const sourceSearchCandidate = adjustmentPrompt.split(" ").pop();
|
|
200
|
-
const sourceSearchWord = (sourceSearchCandidate == null ? void 0 : sourceSearchCandidate.startsWith("@")) ? sourceSearchCandidate.slice(1) : void 0;
|
|
201
|
-
return /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col items-start relative gap-2", children: [
|
|
202
|
-
AdjustmentPromptComponent,
|
|
203
|
-
filePointers.length > 0 && /* @__PURE__ */ jsx(IncludedFilesPreview, { includedFiles: filePointers, setIncludedFiles: setFilePointers }),
|
|
204
|
-
sourceSearchWord !== void 0 && /* @__PURE__ */ jsx(
|
|
205
|
-
SourceSearchBox,
|
|
206
|
-
{
|
|
207
|
-
searchTerm: sourceSearchWord,
|
|
208
|
-
suggestedFiles,
|
|
209
|
-
onSelectedFile: (filePointer) => {
|
|
210
|
-
var _a;
|
|
211
|
-
setAdjustmentPrompt(adjustmentPrompt.replace(new RegExp(`@${sourceSearchWord}$`), ""));
|
|
212
|
-
setFilePointers((prev) => [...prev, filePointer]);
|
|
213
|
-
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
),
|
|
217
|
-
generatingSuggestion ? SuggestionComponent : null,
|
|
218
|
-
generatingSuggestion ? SubmitComponent : null
|
|
219
|
-
] });
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
export {
|
|
223
|
-
HoveringInsertionPromptBoxCore
|
|
224
|
-
};
|
|
225
|
-
//# sourceMappingURL=chunk-UGEKMSRR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx"],"sourcesContent":["import useAutosizeTextArea from \"../../../hooks/misc/use-autosize-textarea\";\nimport {\n EditingEditorState,\n Generator_InsertionOrEditingSuggestion,\n} from \"../../../types/base/autosuggestions-bare-function\";\nimport { SourceSearchBox } from \"../../source-search-box/source-search-box\";\nimport { DocumentPointer, useCopilotContext } from \"@copilotkit/react-core\";\nimport { Button } from \"../../ui/button\";\nimport { Label } from \"../../ui/label\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { streamPromiseFlatten } from \"../../../lib/stream-promise-flatten\";\nimport { IncludedFilesPreview } from \"./included-files-preview\";\nimport { useHoveringEditorContext } from \"../hovering-editor-provider\";\n\nexport type SuggestionState = {\n editorState: EditingEditorState;\n};\n\nexport interface HoveringInsertionPromptBoxCoreProps {\n state: SuggestionState;\n performInsertion: (insertedText: string) => void;\n insertionOrEditingFunction: Generator_InsertionOrEditingSuggestion;\n contextCategories: string[];\n}\n\nexport const HoveringInsertionPromptBoxCore = ({\n performInsertion,\n state,\n insertionOrEditingFunction,\n contextCategories,\n}: HoveringInsertionPromptBoxCoreProps) => {\n const { getDocumentsContext } = useCopilotContext();\n\n const [editSuggestion, setEditSuggestion] = useState<string>(\"\");\n const [suggestionIsLoading, setSuggestionIsLoading] = useState<boolean>(false);\n\n const [adjustmentPrompt, setAdjustmentPrompt] = useState<string>(\"\");\n\n const [generatingSuggestion, setGeneratingSuggestion] = useState<ReadableStream<string> | null>(\n null,\n );\n\n const adjustmentTextAreaRef = useRef<HTMLTextAreaElement>(null);\n const suggestionTextAreaRef = useRef<HTMLTextAreaElement>(null);\n\n const [filePointers, setFilePointers] = useState<DocumentPointer[]>([]);\n\n const [suggestedFiles, setSuggestedFiles] = useState<DocumentPointer[]>([]);\n useEffect(() => {\n setSuggestedFiles(getDocumentsContext(contextCategories));\n }, [contextCategories, getDocumentsContext]);\n\n useAutosizeTextArea(suggestionTextAreaRef, editSuggestion || \"\");\n useAutosizeTextArea(adjustmentTextAreaRef, adjustmentPrompt || \"\");\n\n // initially focus on the adjustment prompt text area\n useEffect(() => {\n adjustmentTextAreaRef.current?.focus();\n }, []);\n\n // continuously read the generating suggestion stream and update the edit suggestion\n useEffect(() => {\n // if no generating suggestion, do nothing\n if (!generatingSuggestion) {\n return;\n }\n\n // Check if the stream is already locked (i.e. already reading from it)\n if (generatingSuggestion.locked) {\n return;\n }\n\n // reset the edit suggestion\n setEditSuggestion(\"\");\n\n // read the generating suggestion stream and continuously update the edit suggestion\n const reader = generatingSuggestion.getReader();\n const read = async () => {\n setSuggestionIsLoading(true);\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n setEditSuggestion((prev) => {\n const newSuggestion = prev + value;\n\n // Scroll to the bottom of the textarea. We call this here to make sure scroll-to-bottom is synchronous with the state update.\n if (suggestionTextAreaRef.current) {\n suggestionTextAreaRef.current.scrollTop = suggestionTextAreaRef.current.scrollHeight;\n }\n return newSuggestion;\n });\n }\n\n setSuggestionIsLoading(false);\n };\n read();\n\n return () => {\n // release the lock if the reader is not closed on unmount\n const releaseLockIfNotClosed = async () => {\n try {\n await reader.closed;\n } catch {\n reader.releaseLock();\n }\n };\n\n releaseLockIfNotClosed();\n };\n }, [generatingSuggestion]);\n\n // generate an adjustment to the completed text, based on the adjustment prompt\n const beginGeneratingAdjustment = useCallback(async () => {\n // don't generate text if the prompt is empty\n if (!adjustmentPrompt.trim()) {\n return;\n }\n\n // editor state includes the text being edited, and the text before/after the selection\n // if the current edit suggestion is not empty, then use *it* as the \"selected text\" - instead of the editor state's selected text\n let modificationState = state.editorState;\n if (editSuggestion !== \"\") {\n modificationState.selectedText = editSuggestion;\n }\n\n // generate the adjustment suggestion\n const adjustmentSuggestionTextStreamPromise = insertionOrEditingFunction(\n modificationState,\n adjustmentPrompt,\n filePointers,\n new AbortController().signal,\n );\n const adjustmentSuggestionTextStream = streamPromiseFlatten(\n adjustmentSuggestionTextStreamPromise,\n );\n\n setGeneratingSuggestion(adjustmentSuggestionTextStream);\n }, [\n adjustmentPrompt,\n editSuggestion,\n state.editorState,\n insertionOrEditingFunction,\n filePointers,\n ]);\n\n const isLoading = suggestionIsLoading;\n\n const textToEdit = editSuggestion || state.editorState.selectedText;\n const adjustmentLabel =\n textToEdit === \"\"\n ? \"Describe the text you want to insert\"\n : \"Describe adjustments to the suggested text\";\n const placeholder =\n textToEdit === \"\"\n ? \"e.g. 'summarize the client's top 3 pain-points from @CallTranscript'\"\n : \"e.g. 'make it more formal', 'be more specific', ...\";\n\n const { setIsDisplayed } = useHoveringEditorContext();\n\n const AdjustmentPromptComponent = (\n <>\n <Label className=\"\">{adjustmentLabel}</Label>\n <div className=\"relative w-full flex items-center\">\n <textarea\n disabled={suggestionIsLoading}\n ref={adjustmentTextAreaRef}\n value={adjustmentPrompt}\n onChange={(e) => setAdjustmentPrompt(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && e.shiftKey) {\n e.preventDefault();\n setAdjustmentPrompt(adjustmentPrompt + \"\\n\");\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n beginGeneratingAdjustment();\n } else if (e.key == \"Escape\") {\n e.preventDefault();\n setIsDisplayed(false);\n }\n }}\n placeholder={placeholder}\n style={{ minHeight: \"3rem\" }}\n className=\"w-full bg-slate-100 h-auto h-min-14 text-sm p-2 rounded-md resize-none overflow-visible focus:outline-none focus:ring-0 focus:border-non pr-[3rem]\"\n rows={1}\n />\n <button\n onClick={beginGeneratingAdjustment}\n className=\"absolute right-2 bg-blue-500 text-white w-8 h-8 rounded-full flex items-center justify-center\"\n >\n <i className=\"material-icons\">arrow_forward</i>\n </button>\n </div>\n </>\n );\n\n const SuggestionComponent = (\n <>\n <div className=\"flex justify-between items-end w-full\">\n <Label className=\"mt-4\">Suggested:</Label>\n <div className=\"ml-auto\">\n {isLoading && (\n <div className=\"flex justify-center items-center\">\n <div\n 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]\"\n role=\"status\"\n >\n <span className=\"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]\">\n Loading...\n </span>\n </div>\n </div>\n )}\n </div>\n </div>\n <textarea\n ref={suggestionTextAreaRef}\n value={editSuggestion}\n disabled={suggestionIsLoading}\n onChange={(e) => setEditSuggestion(e.target.value)}\n className=\"w-full text-base p-2 border border-gray-300 rounded-md resize-none bg-green-50\"\n style={{ overflow: \"auto\", maxHeight: \"10em\" }}\n />\n </>\n );\n\n const SubmitComponent = (\n <div className=\"flex w-full gap-4 justify-start\">\n <Button\n className=\" bg-green-700 text-white\"\n onClick={() => {\n performInsertion(editSuggestion);\n }}\n >\n Insert <i className=\"material-icons\">check</i>\n </Button>\n </div>\n );\n\n // show source search if the last word in the adjustment prompt BEGINS with an @\n const sourceSearchCandidate = adjustmentPrompt.split(\" \").pop();\n // if the candidate is @someCandidate, then 'someCandidate', otherwise undefined\n const sourceSearchWord = sourceSearchCandidate?.startsWith(\"@\")\n ? sourceSearchCandidate.slice(1)\n : undefined;\n\n return (\n <div className=\"w-full flex flex-col items-start relative gap-2\">\n {AdjustmentPromptComponent}\n {filePointers.length > 0 && (\n <IncludedFilesPreview includedFiles={filePointers} setIncludedFiles={setFilePointers} />\n )}\n {sourceSearchWord !== undefined && (\n <SourceSearchBox\n searchTerm={sourceSearchWord}\n suggestedFiles={suggestedFiles}\n onSelectedFile={(filePointer) => {\n setAdjustmentPrompt(adjustmentPrompt.replace(new RegExp(`@${sourceSearchWord}$`), \"\"));\n setFilePointers((prev) => [...prev, filePointer]);\n\n // focus back on the adjustment prompt, and move the cursor to the end\n adjustmentTextAreaRef.current?.focus();\n }}\n />\n )}\n {generatingSuggestion ? SuggestionComponent : null}\n {generatingSuggestion ? SubmitComponent : null}\n </div>\n );\n};\n"],"mappings":"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","names":[]}
|