@copilotkit/react-textarea 1.51.4-next.7 → 1.51.4
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 +22 -0
- package/README.md +18 -12
- package/dist/{chunk-D47EKHIF.mjs → chunk-2X3CZVEP.mjs} +9 -3
- package/dist/chunk-2X3CZVEP.mjs.map +1 -0
- package/dist/{chunk-GU5LTWGL.mjs → chunk-3WLGLZTY.mjs} +19 -13
- package/dist/chunk-3WLGLZTY.mjs.map +1 -0
- package/dist/{chunk-DRV2FOHZ.mjs → chunk-7GZWOXE4.mjs} +2 -2
- package/dist/chunk-7GZWOXE4.mjs.map +1 -0
- package/dist/{chunk-NAFNY4FL.mjs → chunk-7V4ORVQX.mjs} +1 -1
- package/dist/chunk-7V4ORVQX.mjs.map +1 -0
- package/dist/{chunk-ECR45NSD.mjs → chunk-A6YGJFQI.mjs} +9 -2
- package/dist/chunk-A6YGJFQI.mjs.map +1 -0
- package/dist/{chunk-WGWQRALG.mjs → chunk-AHNPJMBR.mjs} +10 -3
- package/dist/chunk-AHNPJMBR.mjs.map +1 -0
- package/dist/{chunk-VSVQZUPW.mjs → chunk-ARLBRSB7.mjs} +23 -7
- package/dist/chunk-ARLBRSB7.mjs.map +1 -0
- package/dist/{chunk-72GJNLCO.mjs → chunk-AZ7RF6ED.mjs} +5 -5
- package/dist/chunk-AZ7RF6ED.mjs.map +1 -0
- package/dist/{chunk-I72DKFHD.mjs → chunk-CFCMZVQ2.mjs} +29 -7
- package/dist/chunk-CFCMZVQ2.mjs.map +1 -0
- package/dist/{chunk-T6MTDQZ7.mjs → chunk-CMKGYQFX.mjs} +1 -1
- package/dist/chunk-CMKGYQFX.mjs.map +1 -0
- package/dist/{chunk-DFTV4TST.mjs → chunk-DZMQBOPG.mjs} +1 -1
- package/dist/chunk-DZMQBOPG.mjs.map +1 -0
- package/dist/{chunk-CLGAJCZ5.mjs → chunk-E7C63KQP.mjs} +10 -6
- package/dist/chunk-E7C63KQP.mjs.map +1 -0
- package/dist/{chunk-GQN2HYFJ.mjs → chunk-EGBZSVLK.mjs} +5 -2
- package/dist/{chunk-GQN2HYFJ.mjs.map → chunk-EGBZSVLK.mjs.map} +1 -1
- package/dist/{chunk-3QJOFG3V.mjs → chunk-FTG7P3NP.mjs} +1 -1
- package/dist/chunk-FTG7P3NP.mjs.map +1 -0
- package/dist/{chunk-KMVGEY7Q.mjs → chunk-IBZTDP72.mjs} +9 -4
- package/dist/chunk-IBZTDP72.mjs.map +1 -0
- package/dist/{chunk-4PDYALMP.mjs → chunk-LYNGBKJR.mjs} +9 -3
- package/dist/chunk-LYNGBKJR.mjs.map +1 -0
- package/dist/{chunk-DL3JWL2E.mjs → chunk-M7GTVHFB.mjs} +26 -8
- package/dist/chunk-M7GTVHFB.mjs.map +1 -0
- package/dist/chunk-MQBPYOOZ.mjs +97 -0
- package/dist/chunk-MQBPYOOZ.mjs.map +1 -0
- package/dist/{chunk-6SGWO63I.mjs → chunk-MQXYWOE2.mjs} +3 -3
- package/dist/chunk-MQXYWOE2.mjs.map +1 -0
- package/dist/{chunk-F2ULK22F.mjs → chunk-NFMCLTJU.mjs} +1 -1
- package/dist/chunk-NFMCLTJU.mjs.map +1 -0
- package/dist/{chunk-F6RLSVG3.mjs → chunk-O4WCM57A.mjs} +1 -1
- package/dist/chunk-O4WCM57A.mjs.map +1 -0
- package/dist/{chunk-4NHVQZ67.mjs → chunk-PDFIUPCS.mjs} +1 -1
- package/dist/chunk-PDFIUPCS.mjs.map +1 -0
- package/dist/{chunk-7NOLZ5T3.mjs → chunk-SWX3MRZ4.mjs} +31 -22
- package/dist/chunk-SWX3MRZ4.mjs.map +1 -0
- package/dist/{chunk-QJNFNPWH.mjs → chunk-TGN3YVSO.mjs} +2 -2
- package/dist/chunk-TGN3YVSO.mjs.map +1 -0
- package/dist/{chunk-LYB4B6MK.mjs → chunk-UB4Y22EF.mjs} +4 -2
- package/dist/chunk-UB4Y22EF.mjs.map +1 -0
- package/dist/{chunk-ZQSEYPNN.mjs → chunk-UIBUYQPG.mjs} +7 -2
- package/dist/chunk-UIBUYQPG.mjs.map +1 -0
- package/dist/{chunk-AJ5OMEXM.mjs → chunk-VBPZTMXB.mjs} +2 -2
- package/dist/{chunk-EJGGLWWR.mjs → chunk-VH7INUR5.mjs} +1 -1
- package/dist/{chunk-EJGGLWWR.mjs.map → chunk-VH7INUR5.mjs.map} +1 -1
- package/dist/{chunk-7LSRNPNI.mjs → chunk-VVRGAA43.mjs} +1 -1
- package/dist/chunk-VVRGAA43.mjs.map +1 -0
- package/dist/{chunk-YLFAIYRY.mjs → chunk-VYLLLBUP.mjs} +1 -1
- package/dist/chunk-VYLLLBUP.mjs.map +1 -0
- package/dist/{chunk-2QDCE7PD.mjs → chunk-WXKPRNNO.mjs} +1 -1
- package/dist/chunk-WXKPRNNO.mjs.map +1 -0
- package/dist/{chunk-JLOABKLH.mjs → chunk-YINY56BI.mjs} +2 -2
- package/dist/{chunk-23Q6A46J.mjs → chunk-ZBP4SABT.mjs} +22 -8
- package/dist/chunk-ZBP4SABT.mjs.map +1 -0
- package/dist/{chunk-H5ZNEKUR.mjs → chunk-ZWI5KPQ5.mjs} +2 -2
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js +154 -86
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +29 -29
- package/dist/components/base-copilot-textarea/render-element.js.map +1 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.js.map +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +1 -1
- 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 +2 -2
- 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 +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.js +190 -95
- package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +34 -34
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.js +3 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.js.map +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js +57 -63
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.js +117 -77
- package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +15 -15
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +60 -14
- 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 +11 -11
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +60 -14
- 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 +12 -12
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.d.ts +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +14 -3
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +3 -3
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +60 -14
- 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 +12 -12
- package/dist/components/index.js +190 -95
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +34 -34
- package/dist/components/manual-ui/chip-with-icon.d.ts +1 -1
- package/dist/components/manual-ui/chip-with-icon.js +13 -2
- package/dist/components/manual-ui/chip-with-icon.js.map +1 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +13 -2
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
- package/dist/components/source-search-box/source-search-box.js +28 -5
- package/dist/components/source-search-box/source-search-box.js.map +1 -1
- package/dist/components/source-search-box/source-search-box.mjs +4 -4
- package/dist/components/ui/button.js +7 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/button.mjs +2 -2
- package/dist/components/ui/command.js +47 -9
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/command.mjs +3 -3
- package/dist/components/ui/dialog.js +27 -5
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dialog.mjs +2 -2
- package/dist/components/ui/label.js +7 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/label.mjs +2 -2
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js +18 -4
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +4 -4
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +2 -2
- 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 +2 -2
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +6 -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 +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +25 -7
- 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 +1 -1
- package/dist/hooks/misc/use-autosize-textarea.js.map +1 -1
- package/dist/hooks/misc/use-autosize-textarea.mjs +1 -1
- package/dist/index.js +190 -95
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -35
- package/dist/index.umd.js +16 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/debouncer.js.map +1 -1
- package/dist/lib/debouncer.mjs +1 -1
- package/dist/lib/editor-to-text.js.map +1 -1
- package/dist/lib/editor-to-text.mjs +1 -1
- package/dist/lib/get-text-around-cursor.js.map +1 -1
- package/dist/lib/get-text-around-cursor.mjs +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.js +4 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.js.map +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.js.map +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.mjs +1 -1
- package/dist/lib/stream-promise-flatten.js.map +1 -1
- package/dist/lib/stream-promise-flatten.mjs +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/utils.mjs +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +3 -3
- package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +1 -1
- package/dist/types/autosuggestions-config/index.js.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +3 -3
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js.map +1 -1
- package/dist/types/base/base-autosuggestions-config.js.map +1 -1
- package/dist/types/base/base-autosuggestions-config.mjs +1 -1
- package/dist/types/base/base-copilot-textarea-props.js.map +1 -1
- package/dist/types/base/editor-autocomplete-state.js.map +1 -1
- package/dist/types/base/editor-autocomplete-state.mjs +2 -2
- package/dist/types/base/index.js.map +1 -1
- package/dist/types/base/index.mjs +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +3 -3
- package/package.json +8 -8
- package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +30 -10
- package/src/components/base-copilot-textarea/render-element.tsx +6 -2
- package/src/components/base-copilot-textarea/render-placeholder.tsx +3 -1
- package/src/components/base-copilot-textarea/use-add-branding-css.tsx +3 -1
- package/src/components/copilot-textarea/copilot-textarea.tsx +15 -9
- package/src/components/hovering-toolbar/hovering-editor-provider.tsx +3 -1
- package/src/components/hovering-toolbar/hovering-toolbar-components.tsx +63 -52
- package/src/components/hovering-toolbar/hovering-toolbar.tsx +21 -5
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +13 -7
- package/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx +7 -2
- package/src/components/manual-ui/chip-with-icon.tsx +12 -3
- package/src/components/source-search-box/source-search-box.tsx +12 -2
- package/src/components/ui/button.tsx +13 -5
- package/src/components/ui/command.tsx +17 -4
- package/src/components/ui/dialog.tsx +23 -5
- package/src/components/ui/label.tsx +7 -2
- package/src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts +35 -9
- package/src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx +5 -1
- package/src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts +5 -1
- package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +9 -2
- package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +24 -6
- package/src/hooks/misc/use-autosize-textarea.tsx +4 -1
- package/src/lib/debouncer.ts +3 -1
- package/src/lib/editor-to-text.ts +5 -2
- package/src/lib/get-text-around-cursor.ts +14 -2
- package/src/lib/slatejs-edits/clear-autocompletions.ts +4 -1
- package/src/lib/slatejs-edits/with-partial-history.ts +10 -3
- package/src/lib/stream-promise-flatten.ts +3 -1
- package/src/lib/utils.ts +6 -2
- package/src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx +3 -2
- package/src/types/autosuggestions-config/autosuggestions-config.tsx +20 -5
- package/src/types/autosuggestions-config/editing-api-config.tsx +2 -1
- package/src/types/autosuggestions-config/subtypes/make-system-prompt.ts +4 -1
- package/src/types/base/base-autosuggestions-config.tsx +10 -4
- package/src/types/base/base-copilot-textarea-props.tsx +4 -2
- package/tsconfig.json +1 -1
- package/tsup.config.ts +5 -1
- package/dist/chunk-23Q6A46J.mjs.map +0 -1
- package/dist/chunk-2IWVZ4PP.mjs +0 -103
- package/dist/chunk-2IWVZ4PP.mjs.map +0 -1
- package/dist/chunk-2QDCE7PD.mjs.map +0 -1
- package/dist/chunk-3QJOFG3V.mjs.map +0 -1
- package/dist/chunk-4NHVQZ67.mjs.map +0 -1
- package/dist/chunk-4PDYALMP.mjs.map +0 -1
- package/dist/chunk-6SGWO63I.mjs.map +0 -1
- package/dist/chunk-72GJNLCO.mjs.map +0 -1
- package/dist/chunk-7LSRNPNI.mjs.map +0 -1
- package/dist/chunk-7NOLZ5T3.mjs.map +0 -1
- package/dist/chunk-CLGAJCZ5.mjs.map +0 -1
- package/dist/chunk-D47EKHIF.mjs.map +0 -1
- package/dist/chunk-DFTV4TST.mjs.map +0 -1
- package/dist/chunk-DL3JWL2E.mjs.map +0 -1
- package/dist/chunk-DRV2FOHZ.mjs.map +0 -1
- package/dist/chunk-ECR45NSD.mjs.map +0 -1
- package/dist/chunk-F2ULK22F.mjs.map +0 -1
- package/dist/chunk-F6RLSVG3.mjs.map +0 -1
- package/dist/chunk-GU5LTWGL.mjs.map +0 -1
- package/dist/chunk-I72DKFHD.mjs.map +0 -1
- package/dist/chunk-KMVGEY7Q.mjs.map +0 -1
- package/dist/chunk-LYB4B6MK.mjs.map +0 -1
- package/dist/chunk-NAFNY4FL.mjs.map +0 -1
- package/dist/chunk-QJNFNPWH.mjs.map +0 -1
- package/dist/chunk-T6MTDQZ7.mjs.map +0 -1
- package/dist/chunk-VSVQZUPW.mjs.map +0 -1
- package/dist/chunk-WGWQRALG.mjs.map +0 -1
- package/dist/chunk-YLFAIYRY.mjs.map +0 -1
- package/dist/chunk-ZQSEYPNN.mjs.map +0 -1
- /package/dist/{chunk-AJ5OMEXM.mjs.map → chunk-VBPZTMXB.mjs.map} +0 -0
- /package/dist/{chunk-JLOABKLH.mjs.map → chunk-YINY56BI.mjs.map} +0 -0
- /package/dist/{chunk-H5ZNEKUR.mjs.map → chunk-ZWI5KPQ5.mjs.map} +0 -0
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotTextarea
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-E7C63KQP.mjs";
|
|
4
|
+
import "../../chunk-UIBUYQPG.mjs";
|
|
5
|
+
import "../../chunk-M7GTVHFB.mjs";
|
|
6
6
|
import "../../chunk-RUV6NBIF.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-MQXYWOE2.mjs";
|
|
8
8
|
import "../../chunk-MCNXIA4Q.mjs";
|
|
9
9
|
import "../../chunk-QFXR6DOA.mjs";
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-DRV2FOHZ.mjs";
|
|
13
|
-
import "../../chunk-QJNFNPWH.mjs";
|
|
10
|
+
import "../../chunk-VH7INUR5.mjs";
|
|
11
|
+
import "../../chunk-SWX3MRZ4.mjs";
|
|
14
12
|
import "../../chunk-2C7O2EVM.mjs";
|
|
15
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-EGBZSVLK.mjs";
|
|
14
|
+
import "../../chunk-ZBP4SABT.mjs";
|
|
15
|
+
import "../../chunk-VBPZTMXB.mjs";
|
|
16
|
+
import "../../chunk-7GZWOXE4.mjs";
|
|
17
|
+
import "../../chunk-PDFIUPCS.mjs";
|
|
18
|
+
import "../../chunk-TGN3YVSO.mjs";
|
|
16
19
|
import "../../chunk-5UNJXFUO.mjs";
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-AJ5OMEXM.mjs";
|
|
20
|
-
import "../../chunk-7LSRNPNI.mjs";
|
|
21
|
-
import "../../chunk-72GJNLCO.mjs";
|
|
20
|
+
import "../../chunk-VVRGAA43.mjs";
|
|
21
|
+
import "../../chunk-AZ7RF6ED.mjs";
|
|
22
22
|
import "../../chunk-L7VVZH4Q.mjs";
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
30
|
-
import "../../chunk-
|
|
31
|
-
import "../../chunk-
|
|
32
|
-
import "../../chunk-
|
|
33
|
-
import "../../chunk-
|
|
34
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-ZWI5KPQ5.mjs";
|
|
24
|
+
import "../../chunk-3WLGLZTY.mjs";
|
|
25
|
+
import "../../chunk-IBZTDP72.mjs";
|
|
26
|
+
import "../../chunk-7V4ORVQX.mjs";
|
|
27
|
+
import "../../chunk-2X3CZVEP.mjs";
|
|
28
|
+
import "../../chunk-UB4Y22EF.mjs";
|
|
29
|
+
import "../../chunk-MQBPYOOZ.mjs";
|
|
30
|
+
import "../../chunk-AHNPJMBR.mjs";
|
|
31
|
+
import "../../chunk-ARLBRSB7.mjs";
|
|
32
|
+
import "../../chunk-CFCMZVQ2.mjs";
|
|
33
|
+
import "../../chunk-LYNGBKJR.mjs";
|
|
34
|
+
import "../../chunk-WXKPRNNO.mjs";
|
|
35
|
+
import "../../chunk-VYLLLBUP.mjs";
|
|
35
36
|
import "../../chunk-WJHSY5T6.mjs";
|
|
36
|
-
import "../../chunk-
|
|
37
|
-
import "../../chunk-
|
|
38
|
-
import "../../chunk-
|
|
39
|
-
import "../../chunk-
|
|
40
|
-
import "../../chunk-
|
|
41
|
-
import "../../chunk-
|
|
42
|
-
import "../../chunk-
|
|
37
|
+
import "../../chunk-O4WCM57A.mjs";
|
|
38
|
+
import "../../chunk-NFMCLTJU.mjs";
|
|
39
|
+
import "../../chunk-FTG7P3NP.mjs";
|
|
40
|
+
import "../../chunk-YINY56BI.mjs";
|
|
41
|
+
import "../../chunk-DZMQBOPG.mjs";
|
|
42
|
+
import "../../chunk-CMKGYQFX.mjs";
|
|
43
|
+
import "../../chunk-A6YGJFQI.mjs";
|
|
43
44
|
import "../../chunk-KNQIEOFP.mjs";
|
|
44
|
-
import "../../chunk-2QDCE7PD.mjs";
|
|
45
45
|
import "../../chunk-MRXNTQOX.mjs";
|
|
46
46
|
export {
|
|
47
47
|
CopilotTextarea
|
|
@@ -12,7 +12,7 @@ interface HoveringEditorProviderProps {
|
|
|
12
12
|
* A context provider for the hovering editor over the `CopilotTextarea`
|
|
13
13
|
* (used to edit and insert text into the `CopilotTextarea`).
|
|
14
14
|
*/
|
|
15
|
-
declare const HoveringEditorProvider: ({ children }: HoveringEditorProviderProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare const HoveringEditorProvider: ({ children, }: HoveringEditorProviderProps) => react_jsx_runtime.JSX.Element;
|
|
16
16
|
declare const useHoveringEditorContext: () => HoveringEditorContextProps;
|
|
17
17
|
|
|
18
18
|
export { HoveringEditorProvider, HoveringEditorProviderProps, useHoveringEditorContext };
|
|
@@ -31,7 +31,9 @@ var HoveringEditorContext = (0, import_react.createContext)({
|
|
|
31
31
|
setIsDisplayed: () => {
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
var HoveringEditorProvider = ({
|
|
34
|
+
var HoveringEditorProvider = ({
|
|
35
|
+
children
|
|
36
|
+
}) => {
|
|
35
37
|
const [isDisplayed, setIsDisplayed] = (0, import_react.useState)(false);
|
|
36
38
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HoveringEditorContext.Provider, { value: { isDisplayed, setIsDisplayed }, children });
|
|
37
39
|
};
|
|
@@ -1 +1 @@
|
|
|
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 = ({
|
|
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 = ({\n children,\n}: 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+D;AA0B3D;AAnBJ,IAAM,4BAAwB,4BAA0C;AAAA,EACtE,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AACzB,CAAC;AAUM,IAAM,yBAAyB,CAAC;AAAA,EACrC;AACF,MAAmC;AACjC,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAkB,KAAK;AAE7D,SACE,4CAAC,sBAAsB,UAAtB,EAA+B,OAAO,EAAE,aAAa,eAAe,GAClE,UACH;AAEJ;AAEO,IAAM,2BAA2B,UAAM,yBAAW,qBAAqB;","names":[]}
|
|
@@ -86,73 +86,67 @@ var Button = import_react.default.forwardRef((_a, ref) => {
|
|
|
86
86
|
})
|
|
87
87
|
);
|
|
88
88
|
});
|
|
89
|
-
var Icon = import_react.default.forwardRef(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
& > * {
|
|
120
|
-
display: inline-block;
|
|
121
|
-
}
|
|
89
|
+
var Icon = import_react.default.forwardRef((_a, ref) => {
|
|
90
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
"span",
|
|
93
|
+
__spreadProps(__spreadValues({}, props), {
|
|
94
|
+
ref,
|
|
95
|
+
className: (0, import_css.cx)(
|
|
96
|
+
"material-icons",
|
|
97
|
+
className,
|
|
98
|
+
import_css.css`
|
|
99
|
+
font-size: 18px;
|
|
100
|
+
vertical-align: text-bottom;
|
|
101
|
+
`
|
|
102
|
+
)
|
|
103
|
+
})
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
var Menu = import_react.default.forwardRef((_a, ref) => {
|
|
107
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
109
|
+
"div",
|
|
110
|
+
__spreadProps(__spreadValues({}, props), {
|
|
111
|
+
"data-testid": "menu",
|
|
112
|
+
ref,
|
|
113
|
+
className: (0, import_css.cx)(
|
|
114
|
+
className,
|
|
115
|
+
import_css.css`
|
|
116
|
+
& > * {
|
|
117
|
+
display: inline-block;
|
|
118
|
+
}
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
);
|
|
120
|
+
& > * + * {
|
|
121
|
+
margin-left: 15px;
|
|
122
|
+
}
|
|
123
|
+
`
|
|
124
|
+
)
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
});
|
|
132
128
|
var Portal = ({ children }) => {
|
|
133
129
|
return typeof document === "object" ? import_react_dom.default.createPortal(children, document.body) : null;
|
|
134
130
|
};
|
|
135
|
-
var Toolbar = import_react.default.forwardRef(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
className
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
);
|
|
131
|
+
var Toolbar = import_react.default.forwardRef((_a, ref) => {
|
|
132
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
+
Menu,
|
|
135
|
+
__spreadProps(__spreadValues({}, props), {
|
|
136
|
+
ref,
|
|
137
|
+
className: (0, import_css.cx)(
|
|
138
|
+
className,
|
|
139
|
+
import_css.css`
|
|
140
|
+
position: relative;
|
|
141
|
+
padding: 1px 18px 17px;
|
|
142
|
+
margin: 0 -20px;
|
|
143
|
+
border-bottom: 2px solid #eee;
|
|
144
|
+
margin-bottom: 20px;
|
|
145
|
+
`
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
});
|
|
156
150
|
// Annotate the CommonJS export names for ESM import in node:
|
|
157
151
|
0 && (module.exports = {
|
|
158
152
|
Button,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/hovering-toolbar/hovering-toolbar-components.tsx"],"sourcesContent":["import { css, cx } from \"@emotion/css\";\nimport React, { PropsWithChildren, Ref } from \"react\";\nimport ReactDOM from \"react-dom\";\n\ninterface BaseProps {\n className?: string;\n [key: string]: unknown;\n}\n\nexport const Button = React.forwardRef<\n HTMLSpanElement,\n PropsWithChildren<{ active: boolean; reversed: boolean } & BaseProps>\n>(({ className, active, reversed, ...props }, ref) => (\n <span\n {...props}\n ref={ref}\n className={cx(\n className as string,\n css`\n cursor: pointer;\n color: ${reversed
|
|
1
|
+
{"version":3,"sources":["../../../src/components/hovering-toolbar/hovering-toolbar-components.tsx"],"sourcesContent":["import { css, cx } from \"@emotion/css\";\nimport React, { PropsWithChildren, Ref } from \"react\";\nimport ReactDOM from \"react-dom\";\n\ninterface BaseProps {\n className?: string;\n [key: string]: unknown;\n}\n\nexport const Button = React.forwardRef<\n HTMLSpanElement,\n PropsWithChildren<{ active: boolean; reversed: boolean } & BaseProps>\n>(({ className, active, reversed, ...props }, ref) => (\n <span\n {...props}\n ref={ref}\n className={cx(\n className as string,\n css`\n cursor: pointer;\n color: ${reversed\n ? active\n ? \"white\"\n : \"#aaa\"\n : active\n ? \"black\"\n : \"#ccc\"};\n `,\n )}\n />\n));\n\nexport const Icon = React.forwardRef<\n HTMLSpanElement,\n PropsWithChildren<BaseProps>\n>(({ className, ...props }, ref) => (\n <span\n {...props}\n ref={ref}\n className={cx(\n \"material-icons\",\n className as string,\n css`\n font-size: 18px;\n vertical-align: text-bottom;\n `,\n )}\n />\n));\n\nexport const Menu = React.forwardRef<\n HTMLDivElement,\n PropsWithChildren<BaseProps>\n>(({ className, ...props }, ref) => {\n return (\n <div\n {...props}\n data-testid=\"menu\"\n ref={ref}\n className={cx(\n className as string,\n css`\n & > * {\n display: inline-block;\n }\n\n & > * + * {\n margin-left: 15px;\n }\n `,\n )}\n />\n );\n});\nexport const Portal = ({ children }: { children: React.ReactNode }) => {\n return typeof document === \"object\"\n ? ReactDOM.createPortal(children, document.body)\n : null;\n};\n\nexport const Toolbar = React.forwardRef<\n HTMLDivElement,\n PropsWithChildren<BaseProps>\n>(({ className, ...props }, ref) => (\n <Menu\n {...props}\n ref={ref}\n className={cx(\n className as string,\n css`\n position: relative;\n padding: 1px 18px 17px;\n margin: 0 -20px;\n border-bottom: 2px solid #eee;\n margin-bottom: 20px;\n `,\n )}\n />\n));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAwB;AACxB,mBAA8C;AAC9C,uBAAqB;AAWnB;AAJK,IAAM,SAAS,aAAAA,QAAM,WAG1B,CAAC,IAA2C,QAAK;AAAhD,eAAE,aAAW,QAAQ,SAZxB,IAYG,IAAkC,kBAAlC,IAAkC,CAAhC,aAAW,UAAQ;AACtB;AAAA,IAAC;AAAA,qCACK,QADL;AAAA,MAEC;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA;AAAA,iBAEW,WACL,SACE,UACA,SACF,SACE,UACA;AAAA;AAAA,MAEV;AAAA;AAAA,EACF;AAAA,CACD;AAEM,IAAM,OAAO,aAAAA,QAAM,WAGxB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAnCL,IAmCG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAC;AAAA,qCACK,QADL;AAAA,MAEC;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA;AAAA,MAIF;AAAA;AAAA,EACF;AAAA,CACD;AAEM,IAAM,OAAO,aAAAA,QAAM,WAGxB,CAAC,IAAyB,QAAQ;AAAjC,eAAE,YArDL,IAqDG,IAAgB,kBAAhB,IAAgB,CAAd;AACH,SACE;AAAA,IAAC;AAAA,qCACK,QADL;AAAA,MAEC,eAAY;AAAA,MACZ;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASF;AAAA;AAAA,EACF;AAEJ,CAAC;AACM,IAAM,SAAS,CAAC,EAAE,SAAS,MAAqC;AACrE,SAAO,OAAO,aAAa,WACvB,iBAAAC,QAAS,aAAa,UAAU,SAAS,IAAI,IAC7C;AACN;AAEO,IAAM,UAAU,aAAAD,QAAM,WAG3B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAnFL,IAmFG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAC;AAAA,qCACK,QADL;AAAA,MAEC;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOF;AAAA;AAAA,EACF;AAAA,CACD;","names":["React","ReactDOM"]}
|
|
@@ -192,73 +192,67 @@ var Button = import_react2.default.forwardRef((_a, ref) => {
|
|
|
192
192
|
})
|
|
193
193
|
);
|
|
194
194
|
});
|
|
195
|
-
var Icon = import_react2.default.forwardRef(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
& > * {
|
|
226
|
-
display: inline-block;
|
|
227
|
-
}
|
|
195
|
+
var Icon = import_react2.default.forwardRef((_a, ref) => {
|
|
196
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
198
|
+
"span",
|
|
199
|
+
__spreadProps(__spreadValues({}, props), {
|
|
200
|
+
ref,
|
|
201
|
+
className: (0, import_css.cx)(
|
|
202
|
+
"material-icons",
|
|
203
|
+
className,
|
|
204
|
+
import_css.css`
|
|
205
|
+
font-size: 18px;
|
|
206
|
+
vertical-align: text-bottom;
|
|
207
|
+
`
|
|
208
|
+
)
|
|
209
|
+
})
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
var Menu = import_react2.default.forwardRef((_a, ref) => {
|
|
213
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
215
|
+
"div",
|
|
216
|
+
__spreadProps(__spreadValues({}, props), {
|
|
217
|
+
"data-testid": "menu",
|
|
218
|
+
ref,
|
|
219
|
+
className: (0, import_css.cx)(
|
|
220
|
+
className,
|
|
221
|
+
import_css.css`
|
|
222
|
+
& > * {
|
|
223
|
+
display: inline-block;
|
|
224
|
+
}
|
|
228
225
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
);
|
|
226
|
+
& > * + * {
|
|
227
|
+
margin-left: 15px;
|
|
228
|
+
}
|
|
229
|
+
`
|
|
230
|
+
)
|
|
231
|
+
})
|
|
232
|
+
);
|
|
233
|
+
});
|
|
238
234
|
var Portal = ({ children }) => {
|
|
239
235
|
return typeof document === "object" ? import_react_dom.default.createPortal(children, document.body) : null;
|
|
240
236
|
};
|
|
241
|
-
var Toolbar = import_react2.default.forwardRef(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
className
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
);
|
|
237
|
+
var Toolbar = import_react2.default.forwardRef((_a, ref) => {
|
|
238
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
240
|
+
Menu,
|
|
241
|
+
__spreadProps(__spreadValues({}, props), {
|
|
242
|
+
ref,
|
|
243
|
+
className: (0, import_css.cx)(
|
|
244
|
+
className,
|
|
245
|
+
import_css.css`
|
|
246
|
+
position: relative;
|
|
247
|
+
padding: 1px 18px 17px;
|
|
248
|
+
margin: 0 -20px;
|
|
249
|
+
border-bottom: 2px solid #eee;
|
|
250
|
+
margin-bottom: 20px;
|
|
251
|
+
`
|
|
252
|
+
)
|
|
253
|
+
})
|
|
254
|
+
);
|
|
255
|
+
});
|
|
262
256
|
|
|
263
257
|
// src/hooks/misc/use-autosize-textarea.tsx
|
|
264
258
|
var import_react3 = require("react");
|
|
@@ -323,12 +317,21 @@ var CommandList = React2.forwardRef((_a, ref) => {
|
|
|
323
317
|
import_cmdk.Command.List,
|
|
324
318
|
__spreadValues({
|
|
325
319
|
ref,
|
|
326
|
-
className: cn(
|
|
320
|
+
className: cn(
|
|
321
|
+
"max-h-[300px] overflow-y-auto overflow-x-hidden pb-2",
|
|
322
|
+
className
|
|
323
|
+
)
|
|
327
324
|
}, props)
|
|
328
325
|
);
|
|
329
326
|
});
|
|
330
327
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
331
|
-
var CommandEmpty = React2.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
328
|
+
var CommandEmpty = React2.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
329
|
+
import_cmdk.Command.Empty,
|
|
330
|
+
__spreadValues({
|
|
331
|
+
ref,
|
|
332
|
+
className: "py-6 text-center text-sm"
|
|
333
|
+
}, props)
|
|
334
|
+
));
|
|
332
335
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
333
336
|
var CommandGroup = React2.forwardRef((_a, ref) => {
|
|
334
337
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
@@ -370,11 +373,18 @@ var CommandItem = React2.forwardRef((_a, ref) => {
|
|
|
370
373
|
});
|
|
371
374
|
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
|
372
375
|
var CommandShortcut = (_a) => {
|
|
373
|
-
var _b = _a, {
|
|
376
|
+
var _b = _a, {
|
|
377
|
+
className
|
|
378
|
+
} = _b, props = __objRest(_b, [
|
|
379
|
+
"className"
|
|
380
|
+
]);
|
|
374
381
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
375
382
|
"span",
|
|
376
383
|
__spreadValues({
|
|
377
|
-
className: cn(
|
|
384
|
+
className: cn(
|
|
385
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
386
|
+
className
|
|
387
|
+
)
|
|
378
388
|
}, props)
|
|
379
389
|
);
|
|
380
390
|
};
|
|
@@ -444,7 +454,14 @@ function Logo({
|
|
|
444
454
|
width,
|
|
445
455
|
height
|
|
446
456
|
}) {
|
|
447
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
458
|
+
"div",
|
|
459
|
+
{
|
|
460
|
+
className: "flex items-center justify-center",
|
|
461
|
+
style: { width, height },
|
|
462
|
+
children
|
|
463
|
+
}
|
|
464
|
+
);
|
|
448
465
|
}
|
|
449
466
|
|
|
450
467
|
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
@@ -484,7 +501,13 @@ var Button2 = React3.forwardRef(
|
|
|
484
501
|
(_a, ref) => {
|
|
485
502
|
var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
|
|
486
503
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
487
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
505
|
+
Comp,
|
|
506
|
+
__spreadValues({
|
|
507
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
508
|
+
ref
|
|
509
|
+
}, props)
|
|
510
|
+
);
|
|
488
511
|
}
|
|
489
512
|
);
|
|
490
513
|
Button2.displayName = "Button";
|
|
@@ -499,7 +522,13 @@ var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
|
499
522
|
);
|
|
500
523
|
var Label = React4.forwardRef((_a, ref) => {
|
|
501
524
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
502
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
526
|
+
LabelPrimitive.Root,
|
|
527
|
+
__spreadValues({
|
|
528
|
+
ref,
|
|
529
|
+
className: cn(labelVariants(), className)
|
|
530
|
+
}, props)
|
|
531
|
+
);
|
|
503
532
|
});
|
|
504
533
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
505
534
|
|
|
@@ -546,7 +575,9 @@ var IncludedFilesPreview = ({
|
|
|
546
575
|
{
|
|
547
576
|
filePointer,
|
|
548
577
|
onDelete: () => {
|
|
549
|
-
setIncludedFiles(
|
|
578
|
+
setIncludedFiles(
|
|
579
|
+
(prev) => prev.filter((fp) => fp !== filePointer)
|
|
580
|
+
);
|
|
550
581
|
}
|
|
551
582
|
},
|
|
552
583
|
`file-${filePointer.sourceApplication}.${filePointer.name}`
|
|
@@ -554,7 +585,10 @@ var IncludedFilesPreview = ({
|
|
|
554
585
|
}) })
|
|
555
586
|
] });
|
|
556
587
|
};
|
|
557
|
-
var FileChipPreview = ({
|
|
588
|
+
var FileChipPreview = ({
|
|
589
|
+
filePointer,
|
|
590
|
+
onDelete
|
|
591
|
+
}) => {
|
|
558
592
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
559
593
|
import_Chip.default,
|
|
560
594
|
{
|
|
@@ -584,9 +618,7 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
584
618
|
const [editSuggestion, setEditSuggestion] = (0, import_react5.useState)("");
|
|
585
619
|
const [suggestionIsLoading, setSuggestionIsLoading] = (0, import_react5.useState)(false);
|
|
586
620
|
const [adjustmentPrompt, setAdjustmentPrompt] = (0, import_react5.useState)("");
|
|
587
|
-
const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react5.useState)(
|
|
588
|
-
null
|
|
589
|
-
);
|
|
621
|
+
const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react5.useState)(null);
|
|
590
622
|
const adjustmentTextAreaRef = (0, import_react5.useRef)(null);
|
|
591
623
|
const suggestionTextAreaRef = (0, import_react5.useRef)(null);
|
|
592
624
|
const [filePointers, setFilePointers] = (0, import_react5.useState)([]);
|
|
@@ -748,7 +780,13 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
748
780
|
const sourceSearchWord = (sourceSearchCandidate == null ? void 0 : sourceSearchCandidate.startsWith("@")) ? sourceSearchCandidate.slice(1) : void 0;
|
|
749
781
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-full flex flex-col items-start relative gap-2", children: [
|
|
750
782
|
AdjustmentPromptComponent,
|
|
751
|
-
filePointers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
783
|
+
filePointers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
784
|
+
IncludedFilesPreview,
|
|
785
|
+
{
|
|
786
|
+
includedFiles: filePointers,
|
|
787
|
+
setIncludedFiles: setFilePointers
|
|
788
|
+
}
|
|
789
|
+
),
|
|
752
790
|
sourceSearchWord !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
753
791
|
SourceSearchBox,
|
|
754
792
|
{
|
|
@@ -756,7 +794,9 @@ var HoveringInsertionPromptBoxCore = ({
|
|
|
756
794
|
suggestedFiles,
|
|
757
795
|
onSelectedFile: (filePointer) => {
|
|
758
796
|
var _a;
|
|
759
|
-
setAdjustmentPrompt(
|
|
797
|
+
setAdjustmentPrompt(
|
|
798
|
+
adjustmentPrompt.replace(new RegExp(`@${sourceSearchWord}$`), "")
|
|
799
|
+
);
|
|
760
800
|
setFilePointers((prev) => [...prev, filePointer]);
|
|
761
801
|
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
762
802
|
}
|