@copilotkitnext/react 0.0.22-alpha.3 → 0.0.22-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +635 -46
- package/dist/index.d.ts +635 -46
- package/dist/index.js +325 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4286 -109
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-32YJ5VJ4.mjs +0 -157
- package/dist/chunk-32YJ5VJ4.mjs.map +0 -1
- package/dist/chunk-36HFWACS.mjs +0 -1
- package/dist/chunk-36HFWACS.mjs.map +0 -1
- package/dist/chunk-3TA5QBSZ.mjs +0 -122
- package/dist/chunk-3TA5QBSZ.mjs.map +0 -1
- package/dist/chunk-46BZRXWT.mjs +0 -16
- package/dist/chunk-46BZRXWT.mjs.map +0 -1
- package/dist/chunk-4UDBR75C.mjs +0 -106
- package/dist/chunk-4UDBR75C.mjs.map +0 -1
- package/dist/chunk-4XJK5IVQ.mjs +0 -83
- package/dist/chunk-4XJK5IVQ.mjs.map +0 -1
- package/dist/chunk-5AAT4Z3C.mjs +0 -107
- package/dist/chunk-5AAT4Z3C.mjs.map +0 -1
- package/dist/chunk-5JNWVLQI.mjs +0 -72
- package/dist/chunk-5JNWVLQI.mjs.map +0 -1
- package/dist/chunk-5SC3CO5Q.mjs +0 -69
- package/dist/chunk-5SC3CO5Q.mjs.map +0 -1
- package/dist/chunk-6VUKDHOD.mjs +0 -1
- package/dist/chunk-6VUKDHOD.mjs.map +0 -1
- package/dist/chunk-AEFM73CL.mjs +0 -32
- package/dist/chunk-AEFM73CL.mjs.map +0 -1
- package/dist/chunk-AI3Z3CHN.mjs +0 -97
- package/dist/chunk-AI3Z3CHN.mjs.map +0 -1
- package/dist/chunk-AXFRCGH6.mjs +0 -107
- package/dist/chunk-AXFRCGH6.mjs.map +0 -1
- package/dist/chunk-BT6C5OPU.mjs +0 -278
- package/dist/chunk-BT6C5OPU.mjs.map +0 -1
- package/dist/chunk-CGLGXQAU.mjs +0 -78
- package/dist/chunk-CGLGXQAU.mjs.map +0 -1
- package/dist/chunk-CSHBUHRW.mjs +0 -69
- package/dist/chunk-CSHBUHRW.mjs.map +0 -1
- package/dist/chunk-CZ3GI3IF.mjs +0 -283
- package/dist/chunk-CZ3GI3IF.mjs.map +0 -1
- package/dist/chunk-DVUQO72Z.mjs +0 -1
- package/dist/chunk-DVUQO72Z.mjs.map +0 -1
- package/dist/chunk-E4HD4M7R.mjs +0 -76
- package/dist/chunk-E4HD4M7R.mjs.map +0 -1
- package/dist/chunk-E56GYBP3.mjs +0 -101
- package/dist/chunk-E56GYBP3.mjs.map +0 -1
- package/dist/chunk-EJ5ZEAAN.mjs +0 -57
- package/dist/chunk-EJ5ZEAAN.mjs.map +0 -1
- package/dist/chunk-ETWJDCGE.mjs +0 -1
- package/dist/chunk-ETWJDCGE.mjs.map +0 -1
- package/dist/chunk-F43IPGPA.mjs +0 -311
- package/dist/chunk-F43IPGPA.mjs.map +0 -1
- package/dist/chunk-FIBK3DYE.mjs +0 -26
- package/dist/chunk-FIBK3DYE.mjs.map +0 -1
- package/dist/chunk-FVURPXQK.mjs +0 -45
- package/dist/chunk-FVURPXQK.mjs.map +0 -1
- package/dist/chunk-FZR2XQKR.mjs +0 -44
- package/dist/chunk-FZR2XQKR.mjs.map +0 -1
- package/dist/chunk-IA4CLXDM.mjs +0 -76
- package/dist/chunk-IA4CLXDM.mjs.map +0 -1
- package/dist/chunk-IH5VFJ4L.mjs +0 -60
- package/dist/chunk-IH5VFJ4L.mjs.map +0 -1
- package/dist/chunk-IICUCI5S.mjs +0 -43
- package/dist/chunk-IICUCI5S.mjs.map +0 -1
- package/dist/chunk-JLVGSNAO.mjs +0 -311
- package/dist/chunk-JLVGSNAO.mjs.map +0 -1
- package/dist/chunk-JWOIINVV.mjs +0 -237
- package/dist/chunk-JWOIINVV.mjs.map +0 -1
- package/dist/chunk-KCVDFZJX.mjs +0 -873
- package/dist/chunk-KCVDFZJX.mjs.map +0 -1
- package/dist/chunk-KPRUSQ3K.mjs +0 -1
- package/dist/chunk-KPRUSQ3K.mjs.map +0 -1
- package/dist/chunk-MWC5OV7Z.mjs +0 -1
- package/dist/chunk-MWC5OV7Z.mjs.map +0 -1
- package/dist/chunk-N5EP5OD5.mjs +0 -1
- package/dist/chunk-N5EP5OD5.mjs.map +0 -1
- package/dist/chunk-NASFZS3N.mjs +0 -43
- package/dist/chunk-NASFZS3N.mjs.map +0 -1
- package/dist/chunk-NB2GZAKG.mjs +0 -131
- package/dist/chunk-NB2GZAKG.mjs.map +0 -1
- package/dist/chunk-NB4DFAZH.mjs +0 -185
- package/dist/chunk-NB4DFAZH.mjs.map +0 -1
- package/dist/chunk-NNAYEAP2.mjs +0 -49
- package/dist/chunk-NNAYEAP2.mjs.map +0 -1
- package/dist/chunk-NNPKBGD6.mjs +0 -37
- package/dist/chunk-NNPKBGD6.mjs.map +0 -1
- package/dist/chunk-OMPVTGXH.mjs +0 -122
- package/dist/chunk-OMPVTGXH.mjs.map +0 -1
- package/dist/chunk-QFBM3ZT2.mjs +0 -45
- package/dist/chunk-QFBM3ZT2.mjs.map +0 -1
- package/dist/chunk-QJ6DZ645.mjs +0 -78
- package/dist/chunk-QJ6DZ645.mjs.map +0 -1
- package/dist/chunk-R5OLAA3L.mjs +0 -135
- package/dist/chunk-R5OLAA3L.mjs.map +0 -1
- package/dist/chunk-RF2CGPHQ.mjs +0 -215
- package/dist/chunk-RF2CGPHQ.mjs.map +0 -1
- package/dist/chunk-RGD2L3Z4.mjs +0 -96
- package/dist/chunk-RGD2L3Z4.mjs.map +0 -1
- package/dist/chunk-RK5P2LG6.mjs +0 -57
- package/dist/chunk-RK5P2LG6.mjs.map +0 -1
- package/dist/chunk-RRXDJCXI.mjs +0 -60
- package/dist/chunk-RRXDJCXI.mjs.map +0 -1
- package/dist/chunk-SPDE34WC.mjs +0 -283
- package/dist/chunk-SPDE34WC.mjs.map +0 -1
- package/dist/chunk-TAUOEJH2.mjs +0 -120
- package/dist/chunk-TAUOEJH2.mjs.map +0 -1
- package/dist/chunk-TKFOXPXF.mjs +0 -157
- package/dist/chunk-TKFOXPXF.mjs.map +0 -1
- package/dist/chunk-UOX5D73C.mjs +0 -22
- package/dist/chunk-UOX5D73C.mjs.map +0 -1
- package/dist/chunk-US4KNAAV.mjs +0 -1
- package/dist/chunk-US4KNAAV.mjs.map +0 -1
- package/dist/chunk-UZB3CTOY.mjs +0 -873
- package/dist/chunk-UZB3CTOY.mjs.map +0 -1
- package/dist/chunk-VBI6JXPC.mjs +0 -1
- package/dist/chunk-VBI6JXPC.mjs.map +0 -1
- package/dist/chunk-VE3SBLU7.mjs +0 -215
- package/dist/chunk-VE3SBLU7.mjs.map +0 -1
- package/dist/chunk-VUHFLJWI.mjs +0 -185
- package/dist/chunk-VUHFLJWI.mjs.map +0 -1
- package/dist/chunk-VVAXSF3M.mjs +0 -61
- package/dist/chunk-VVAXSF3M.mjs.map +0 -1
- package/dist/chunk-W5DUKRCI.mjs +0 -97
- package/dist/chunk-W5DUKRCI.mjs.map +0 -1
- package/dist/chunk-WNRDFAZ5.mjs +0 -22
- package/dist/chunk-WNRDFAZ5.mjs.map +0 -1
- package/dist/chunk-XO4IRKSC.mjs +0 -11
- package/dist/chunk-XO4IRKSC.mjs.map +0 -1
- package/dist/chunk-XU5CEPYQ.mjs +0 -75
- package/dist/chunk-XU5CEPYQ.mjs.map +0 -1
- package/dist/chunk-YPH4BHOY.mjs +0 -39
- package/dist/chunk-YPH4BHOY.mjs.map +0 -1
- package/dist/chunk-YVPPF62K.mjs +0 -32
- package/dist/chunk-YVPPF62K.mjs.map +0 -1
- package/dist/chunk-YZUPVMHC.mjs +0 -1
- package/dist/chunk-YZUPVMHC.mjs.map +0 -1
- package/dist/chunk-Z3OIGQCZ.mjs +0 -75
- package/dist/chunk-Z3OIGQCZ.mjs.map +0 -1
- package/dist/chunk-ZIDT52TM.mjs +0 -131
- package/dist/chunk-ZIDT52TM.mjs.map +0 -1
- package/dist/components/CopilotKitInspector.d.mts +0 -13
- package/dist/components/CopilotKitInspector.d.ts +0 -13
- package/dist/components/CopilotKitInspector.js +0 -69
- package/dist/components/CopilotKitInspector.js.map +0 -1
- package/dist/components/CopilotKitInspector.mjs +0 -7
- package/dist/components/CopilotKitInspector.mjs.map +0 -1
- package/dist/components/WildcardToolCallRender.d.mts +0 -7
- package/dist/components/WildcardToolCallRender.d.ts +0 -7
- package/dist/components/WildcardToolCallRender.js +0 -106
- package/dist/components/WildcardToolCallRender.js.map +0 -1
- package/dist/components/WildcardToolCallRender.mjs +0 -8
- package/dist/components/WildcardToolCallRender.mjs.map +0 -1
- package/dist/components/chat/CopilotChat.d.mts +0 -30
- package/dist/components/chat/CopilotChat.d.ts +0 -30
- package/dist/components/chat/CopilotChat.js +0 -2934
- package/dist/components/chat/CopilotChat.js.map +0 -1
- package/dist/components/chat/CopilotChat.mjs +0 -37
- package/dist/components/chat/CopilotChat.mjs.map +0 -1
- package/dist/components/chat/CopilotChatAssistantMessage.d.mts +0 -45
- package/dist/components/chat/CopilotChatAssistantMessage.d.ts +0 -45
- package/dist/components/chat/CopilotChatAssistantMessage.js +0 -735
- package/dist/components/chat/CopilotChatAssistantMessage.js.map +0 -1
- package/dist/components/chat/CopilotChatAssistantMessage.mjs +0 -29
- package/dist/components/chat/CopilotChatAssistantMessage.mjs.map +0 -1
- package/dist/components/chat/CopilotChatAudioRecorder.d.mts +0 -11
- package/dist/components/chat/CopilotChatAudioRecorder.d.ts +0 -11
- package/dist/components/chat/CopilotChatAudioRecorder.js +0 -131
- package/dist/components/chat/CopilotChatAudioRecorder.js.map +0 -1
- package/dist/components/chat/CopilotChatAudioRecorder.mjs +0 -9
- package/dist/components/chat/CopilotChatAudioRecorder.mjs.map +0 -1
- package/dist/components/chat/CopilotChatInput.d.mts +0 -67
- package/dist/components/chat/CopilotChatInput.d.ts +0 -67
- package/dist/components/chat/CopilotChatInput.js +0 -1305
- package/dist/components/chat/CopilotChatInput.js.map +0 -1
- package/dist/components/chat/CopilotChatInput.mjs +0 -16
- package/dist/components/chat/CopilotChatInput.mjs.map +0 -1
- package/dist/components/chat/CopilotChatMessageView.d.mts +0 -29
- package/dist/components/chat/CopilotChatMessageView.d.ts +0 -29
- package/dist/components/chat/CopilotChatMessageView.js +0 -1164
- package/dist/components/chat/CopilotChatMessageView.js.map +0 -1
- package/dist/components/chat/CopilotChatMessageView.mjs +0 -31
- package/dist/components/chat/CopilotChatMessageView.mjs.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionPill.d.mts +0 -11
- package/dist/components/chat/CopilotChatSuggestionPill.d.ts +0 -11
- package/dist/components/chat/CopilotChatSuggestionPill.js +0 -76
- package/dist/components/chat/CopilotChatSuggestionPill.js.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionPill.mjs +0 -10
- package/dist/components/chat/CopilotChatSuggestionPill.mjs.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionView.d.mts +0 -33
- package/dist/components/chat/CopilotChatSuggestionView.d.ts +0 -33
- package/dist/components/chat/CopilotChatSuggestionView.js +0 -179
- package/dist/components/chat/CopilotChatSuggestionView.js.map +0 -1
- package/dist/components/chat/CopilotChatSuggestionView.mjs +0 -12
- package/dist/components/chat/CopilotChatSuggestionView.mjs.map +0 -1
- package/dist/components/chat/CopilotChatToggleButton.d.mts +0 -14
- package/dist/components/chat/CopilotChatToggleButton.d.ts +0 -14
- package/dist/components/chat/CopilotChatToggleButton.js +0 -222
- package/dist/components/chat/CopilotChatToggleButton.js.map +0 -1
- package/dist/components/chat/CopilotChatToggleButton.mjs +0 -16
- package/dist/components/chat/CopilotChatToggleButton.mjs.map +0 -1
- package/dist/components/chat/CopilotChatToolCallsView.d.mts +0 -10
- package/dist/components/chat/CopilotChatToolCallsView.d.ts +0 -10
- package/dist/components/chat/CopilotChatToolCallsView.js +0 -264
- package/dist/components/chat/CopilotChatToolCallsView.js.map +0 -1
- package/dist/components/chat/CopilotChatToolCallsView.mjs +0 -24
- package/dist/components/chat/CopilotChatToolCallsView.mjs.map +0 -1
- package/dist/components/chat/CopilotChatUserMessage.d.mts +0 -52
- package/dist/components/chat/CopilotChatUserMessage.d.ts +0 -52
- package/dist/components/chat/CopilotChatUserMessage.js +0 -523
- package/dist/components/chat/CopilotChatUserMessage.js.map +0 -1
- package/dist/components/chat/CopilotChatUserMessage.mjs +0 -14
- package/dist/components/chat/CopilotChatUserMessage.mjs.map +0 -1
- package/dist/components/chat/CopilotChatView.d.mts +0 -54
- package/dist/components/chat/CopilotChatView.d.ts +0 -54
- package/dist/components/chat/CopilotChatView.js +0 -2640
- package/dist/components/chat/CopilotChatView.js.map +0 -1
- package/dist/components/chat/CopilotChatView.mjs +0 -38
- package/dist/components/chat/CopilotChatView.mjs.map +0 -1
- package/dist/components/chat/CopilotModalHeader.d.mts +0 -22
- package/dist/components/chat/CopilotModalHeader.d.ts +0 -22
- package/dist/components/chat/CopilotModalHeader.js +0 -186
- package/dist/components/chat/CopilotModalHeader.js.map +0 -1
- package/dist/components/chat/CopilotModalHeader.mjs +0 -12
- package/dist/components/chat/CopilotModalHeader.mjs.map +0 -1
- package/dist/components/chat/CopilotPopup.d.mts +0 -33
- package/dist/components/chat/CopilotPopup.d.ts +0 -33
- package/dist/components/chat/CopilotPopup.js +0 -3343
- package/dist/components/chat/CopilotPopup.js.map +0 -1
- package/dist/components/chat/CopilotPopup.mjs +0 -43
- package/dist/components/chat/CopilotPopup.mjs.map +0 -1
- package/dist/components/chat/CopilotPopupView.d.mts +0 -30
- package/dist/components/chat/CopilotPopupView.d.ts +0 -30
- package/dist/components/chat/CopilotPopupView.js +0 -3003
- package/dist/components/chat/CopilotPopupView.js.map +0 -1
- package/dist/components/chat/CopilotPopupView.mjs +0 -41
- package/dist/components/chat/CopilotPopupView.mjs.map +0 -1
- package/dist/components/chat/CopilotSidebar.d.mts +0 -31
- package/dist/components/chat/CopilotSidebar.d.ts +0 -31
- package/dist/components/chat/CopilotSidebar.js +0 -3266
- package/dist/components/chat/CopilotSidebar.js.map +0 -1
- package/dist/components/chat/CopilotSidebar.mjs +0 -43
- package/dist/components/chat/CopilotSidebar.mjs.map +0 -1
- package/dist/components/chat/CopilotSidebarView.d.mts +0 -28
- package/dist/components/chat/CopilotSidebarView.d.ts +0 -28
- package/dist/components/chat/CopilotSidebarView.js +0 -2941
- package/dist/components/chat/CopilotSidebarView.js.map +0 -1
- package/dist/components/chat/CopilotSidebarView.mjs +0 -41
- package/dist/components/chat/CopilotSidebarView.mjs.map +0 -1
- package/dist/components/chat/index.d.mts +0 -23
- package/dist/components/chat/index.d.ts +0 -23
- package/dist/components/chat/index.js +0 -3503
- package/dist/components/chat/index.js.map +0 -1
- package/dist/components/chat/index.mjs +0 -95
- package/dist/components/chat/index.mjs.map +0 -1
- package/dist/components/index.d.mts +0 -29
- package/dist/components/index.d.ts +0 -29
- package/dist/components/index.js +0 -3583
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -104
- package/dist/components/index.mjs.map +0 -1
- package/dist/components/ui/button.d.mts +0 -14
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.js +0 -150
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/button.mjs +0 -10
- package/dist/components/ui/button.mjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.mts +0 -28
- package/dist/components/ui/dropdown-menu.d.ts +0 -28
- package/dist/components/ui/dropdown-menu.js +0 -291
- package/dist/components/ui/dropdown-menu.js.map +0 -1
- package/dist/components/ui/dropdown-menu.mjs +0 -37
- package/dist/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/ui/tooltip.d.mts +0 -10
- package/dist/components/ui/tooltip.d.ts +0 -10
- package/dist/components/ui/tooltip.js +0 -103
- package/dist/components/ui/tooltip.js.map +0 -1
- package/dist/components/ui/tooltip.mjs +0 -14
- package/dist/components/ui/tooltip.mjs.map +0 -1
- package/dist/hooks/index.d.mts +0 -19
- package/dist/hooks/index.d.ts +0 -19
- package/dist/hooks/index.js +0 -691
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/index.mjs +0 -45
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/hooks/use-agent-context.d.mts +0 -5
- package/dist/hooks/use-agent-context.d.ts +0 -5
- package/dist/hooks/use-agent-context.js +0 -116
- package/dist/hooks/use-agent-context.js.map +0 -1
- package/dist/hooks/use-agent-context.mjs +0 -10
- package/dist/hooks/use-agent-context.mjs.map +0 -1
- package/dist/hooks/use-agent.d.mts +0 -16
- package/dist/hooks/use-agent.d.ts +0 -16
- package/dist/hooks/use-agent.js +0 -171
- package/dist/hooks/use-agent.js.map +0 -1
- package/dist/hooks/use-agent.mjs +0 -12
- package/dist/hooks/use-agent.mjs.map +0 -1
- package/dist/hooks/use-configure-suggestions.d.mts +0 -13
- package/dist/hooks/use-configure-suggestions.d.ts +0 -13
- package/dist/hooks/use-configure-suggestions.js +0 -232
- package/dist/hooks/use-configure-suggestions.js.map +0 -1
- package/dist/hooks/use-configure-suggestions.mjs +0 -11
- package/dist/hooks/use-configure-suggestions.mjs.map +0 -1
- package/dist/hooks/use-frontend-tool.d.mts +0 -8
- package/dist/hooks/use-frontend-tool.d.ts +0 -8
- package/dist/hooks/use-frontend-tool.js +0 -137
- package/dist/hooks/use-frontend-tool.js.map +0 -1
- package/dist/hooks/use-frontend-tool.mjs +0 -10
- package/dist/hooks/use-frontend-tool.mjs.map +0 -1
- package/dist/hooks/use-human-in-the-loop.d.mts +0 -7
- package/dist/hooks/use-human-in-the-loop.d.ts +0 -7
- package/dist/hooks/use-human-in-the-loop.js +0 -206
- package/dist/hooks/use-human-in-the-loop.js.map +0 -1
- package/dist/hooks/use-human-in-the-loop.mjs +0 -11
- package/dist/hooks/use-human-in-the-loop.mjs.map +0 -1
- package/dist/hooks/use-keyboard-height.d.mts +0 -15
- package/dist/hooks/use-keyboard-height.d.ts +0 -15
- package/dist/hooks/use-keyboard-height.js +0 -68
- package/dist/hooks/use-keyboard-height.js.map +0 -1
- package/dist/hooks/use-keyboard-height.mjs +0 -7
- package/dist/hooks/use-keyboard-height.mjs.map +0 -1
- package/dist/hooks/use-render-activity-message.d.mts +0 -5
- package/dist/hooks/use-render-activity-message.d.ts +0 -5
- package/dist/hooks/use-render-activity-message.js +0 -158
- package/dist/hooks/use-render-activity-message.js.map +0 -1
- package/dist/hooks/use-render-activity-message.mjs +0 -12
- package/dist/hooks/use-render-activity-message.mjs.map +0 -1
- package/dist/hooks/use-render-custom-messages.d.mts +0 -11
- package/dist/hooks/use-render-custom-messages.d.ts +0 -11
- package/dist/hooks/use-render-custom-messages.js +0 -170
- package/dist/hooks/use-render-custom-messages.js.map +0 -1
- package/dist/hooks/use-render-custom-messages.mjs +0 -12
- package/dist/hooks/use-render-custom-messages.mjs.map +0 -1
- package/dist/hooks/use-render-tool-call.d.mts +0 -16
- package/dist/hooks/use-render-tool-call.d.ts +0 -16
- package/dist/hooks/use-render-tool-call.js +0 -208
- package/dist/hooks/use-render-tool-call.js.map +0 -1
- package/dist/hooks/use-render-tool-call.mjs +0 -11
- package/dist/hooks/use-render-tool-call.mjs.map +0 -1
- package/dist/hooks/use-suggestions.d.mts +0 -14
- package/dist/hooks/use-suggestions.d.ts +0 -14
- package/dist/hooks/use-suggestions.js +0 -176
- package/dist/hooks/use-suggestions.js.map +0 -1
- package/dist/hooks/use-suggestions.mjs +0 -11
- package/dist/hooks/use-suggestions.mjs.map +0 -1
- package/dist/lib/react-core.d.mts +0 -33
- package/dist/lib/react-core.d.ts +0 -33
- package/dist/lib/react-core.js +0 -73
- package/dist/lib/react-core.js.map +0 -1
- package/dist/lib/react-core.mjs +0 -7
- package/dist/lib/react-core.mjs.map +0 -1
- package/dist/lib/slots.d.mts +0 -16
- package/dist/lib/slots.d.ts +0 -16
- package/dist/lib/slots.js +0 -60
- package/dist/lib/slots.js.map +0 -1
- package/dist/lib/slots.mjs +0 -7
- package/dist/lib/slots.mjs.map +0 -1
- package/dist/lib/utils.d.mts +0 -5
- package/dist/lib/utils.d.ts +0 -5
- package/dist/lib/utils.js +0 -35
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/utils.mjs +0 -7
- package/dist/lib/utils.mjs.map +0 -1
- package/dist/providers/CopilotChatConfigurationProvider.d.mts +0 -43
- package/dist/providers/CopilotChatConfigurationProvider.d.ts +0 -43
- package/dist/providers/CopilotChatConfigurationProvider.js +0 -109
- package/dist/providers/CopilotChatConfigurationProvider.js.map +0 -1
- package/dist/providers/CopilotChatConfigurationProvider.mjs +0 -11
- package/dist/providers/CopilotChatConfigurationProvider.mjs.map +0 -1
- package/dist/providers/CopilotKitProvider.d.mts +0 -33
- package/dist/providers/CopilotKitProvider.d.ts +0 -33
- package/dist/providers/CopilotKitProvider.js +0 -314
- package/dist/providers/CopilotKitProvider.js.map +0 -1
- package/dist/providers/CopilotKitProvider.mjs +0 -12
- package/dist/providers/CopilotKitProvider.mjs.map +0 -1
- package/dist/providers/index.d.mts +0 -13
- package/dist/providers/index.d.ts +0 -13
- package/dist/providers/index.js +0 -396
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/index.mjs +0 -18
- package/dist/providers/index.mjs.map +0 -1
- package/dist/types/defineToolCallRenderer.d.mts +0 -41
- package/dist/types/defineToolCallRenderer.d.ts +0 -41
- package/dist/types/defineToolCallRenderer.js +0 -40
- package/dist/types/defineToolCallRenderer.js.map +0 -1
- package/dist/types/defineToolCallRenderer.mjs +0 -7
- package/dist/types/defineToolCallRenderer.mjs.map +0 -1
- package/dist/types/frontend-tool.d.mts +0 -9
- package/dist/types/frontend-tool.d.ts +0 -9
- package/dist/types/frontend-tool.js +0 -19
- package/dist/types/frontend-tool.js.map +0 -1
- package/dist/types/frontend-tool.mjs +0 -2
- package/dist/types/frontend-tool.mjs.map +0 -1
- package/dist/types/human-in-the-loop.d.mts +0 -29
- package/dist/types/human-in-the-loop.d.ts +0 -29
- package/dist/types/human-in-the-loop.js +0 -19
- package/dist/types/human-in-the-loop.js.map +0 -1
- package/dist/types/human-in-the-loop.mjs +0 -2
- package/dist/types/human-in-the-loop.mjs.map +0 -1
- package/dist/types/index.d.mts +0 -11
- package/dist/types/index.d.ts +0 -11
- package/dist/types/index.js +0 -42
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -13
- package/dist/types/index.mjs.map +0 -1
- package/dist/types/react-activity-message-renderer.d.mts +0 -29
- package/dist/types/react-activity-message-renderer.d.ts +0 -29
- package/dist/types/react-activity-message-renderer.js +0 -19
- package/dist/types/react-activity-message-renderer.js.map +0 -1
- package/dist/types/react-activity-message-renderer.mjs +0 -2
- package/dist/types/react-activity-message-renderer.mjs.map +0 -1
- package/dist/types/react-custom-message-renderer.d.mts +0 -18
- package/dist/types/react-custom-message-renderer.d.ts +0 -18
- package/dist/types/react-custom-message-renderer.js +0 -19
- package/dist/types/react-custom-message-renderer.js.map +0 -1
- package/dist/types/react-custom-message-renderer.mjs +0 -2
- package/dist/types/react-custom-message-renderer.mjs.map +0 -1
- package/dist/types/react-tool-call-renderer.d.mts +0 -30
- package/dist/types/react-tool-call-renderer.d.ts +0 -30
- package/dist/types/react-tool-call-renderer.js +0 -19
- package/dist/types/react-tool-call-renderer.js.map +0 -1
- package/dist/types/react-tool-call-renderer.mjs +0 -2
- package/dist/types/react-tool-call-renderer.mjs.map +0 -1
package/dist/chunk-F43IPGPA.mjs
DELETED
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotChatInput_default
|
|
3
|
-
} from "./chunk-KCVDFZJX.mjs";
|
|
4
|
-
import {
|
|
5
|
-
CopilotChatMessageView_default
|
|
6
|
-
} from "./chunk-W5DUKRCI.mjs";
|
|
7
|
-
import {
|
|
8
|
-
CopilotChatSuggestionView_default
|
|
9
|
-
} from "./chunk-RGD2L3Z4.mjs";
|
|
10
|
-
import {
|
|
11
|
-
Button
|
|
12
|
-
} from "./chunk-TAUOEJH2.mjs";
|
|
13
|
-
import {
|
|
14
|
-
useKeyboardHeight
|
|
15
|
-
} from "./chunk-FZR2XQKR.mjs";
|
|
16
|
-
import {
|
|
17
|
-
renderSlot
|
|
18
|
-
} from "./chunk-FIBK3DYE.mjs";
|
|
19
|
-
import {
|
|
20
|
-
cn
|
|
21
|
-
} from "./chunk-XO4IRKSC.mjs";
|
|
22
|
-
import {
|
|
23
|
-
CopilotChatDefaultLabels,
|
|
24
|
-
useCopilotChatConfiguration
|
|
25
|
-
} from "./chunk-4XJK5IVQ.mjs";
|
|
26
|
-
|
|
27
|
-
// src/components/chat/CopilotChatView.tsx
|
|
28
|
-
import React, { useRef, useState, useEffect } from "react";
|
|
29
|
-
import { twMerge } from "tailwind-merge";
|
|
30
|
-
import { StickToBottom, useStickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
31
|
-
import { ChevronDown } from "lucide-react";
|
|
32
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
-
function CopilotChatView({
|
|
34
|
-
messageView,
|
|
35
|
-
input,
|
|
36
|
-
scrollView,
|
|
37
|
-
scrollToBottomButton,
|
|
38
|
-
feather,
|
|
39
|
-
inputContainer,
|
|
40
|
-
disclaimer,
|
|
41
|
-
suggestionView,
|
|
42
|
-
messages = [],
|
|
43
|
-
autoScroll = true,
|
|
44
|
-
inputProps,
|
|
45
|
-
isRunning = false,
|
|
46
|
-
suggestions,
|
|
47
|
-
suggestionLoadingIndexes,
|
|
48
|
-
onSelectSuggestion,
|
|
49
|
-
children,
|
|
50
|
-
className,
|
|
51
|
-
...props
|
|
52
|
-
}) {
|
|
53
|
-
const inputContainerRef = useRef(null);
|
|
54
|
-
const [inputContainerHeight, setInputContainerHeight] = useState(0);
|
|
55
|
-
const [isResizing, setIsResizing] = useState(false);
|
|
56
|
-
const resizeTimeoutRef = useRef(null);
|
|
57
|
-
const { isKeyboardOpen, keyboardHeight, availableHeight } = useKeyboardHeight();
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
const element = inputContainerRef.current;
|
|
60
|
-
if (!element) return;
|
|
61
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
62
|
-
for (const entry of entries) {
|
|
63
|
-
const newHeight = entry.contentRect.height;
|
|
64
|
-
setInputContainerHeight((prevHeight) => {
|
|
65
|
-
if (newHeight !== prevHeight) {
|
|
66
|
-
setIsResizing(true);
|
|
67
|
-
if (resizeTimeoutRef.current) {
|
|
68
|
-
clearTimeout(resizeTimeoutRef.current);
|
|
69
|
-
}
|
|
70
|
-
resizeTimeoutRef.current = setTimeout(() => {
|
|
71
|
-
setIsResizing(false);
|
|
72
|
-
}, 250);
|
|
73
|
-
return newHeight;
|
|
74
|
-
}
|
|
75
|
-
return prevHeight;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
resizeObserver.observe(element);
|
|
80
|
-
setInputContainerHeight(element.offsetHeight);
|
|
81
|
-
return () => {
|
|
82
|
-
resizeObserver.disconnect();
|
|
83
|
-
if (resizeTimeoutRef.current) {
|
|
84
|
-
clearTimeout(resizeTimeoutRef.current);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}, []);
|
|
88
|
-
const BoundMessageView = renderSlot(messageView, CopilotChatMessageView_default, {
|
|
89
|
-
messages,
|
|
90
|
-
isRunning
|
|
91
|
-
});
|
|
92
|
-
const BoundInput = renderSlot(input, CopilotChatInput_default, inputProps ?? {});
|
|
93
|
-
const hasSuggestions = Array.isArray(suggestions) && suggestions.length > 0;
|
|
94
|
-
const BoundSuggestionView = hasSuggestions ? renderSlot(
|
|
95
|
-
suggestionView,
|
|
96
|
-
CopilotChatSuggestionView_default,
|
|
97
|
-
{
|
|
98
|
-
suggestions,
|
|
99
|
-
loadingIndexes: suggestionLoadingIndexes,
|
|
100
|
-
onSelectSuggestion,
|
|
101
|
-
className: "mb-3 lg:ml-4 lg:mr-4 ml-0 mr-0"
|
|
102
|
-
}
|
|
103
|
-
) : null;
|
|
104
|
-
const BoundFeather = renderSlot(feather, CopilotChatView.Feather, {});
|
|
105
|
-
const BoundScrollView = renderSlot(scrollView, CopilotChatView.ScrollView, {
|
|
106
|
-
autoScroll,
|
|
107
|
-
scrollToBottomButton,
|
|
108
|
-
inputContainerHeight,
|
|
109
|
-
isResizing,
|
|
110
|
-
children: /* @__PURE__ */ jsx("div", { style: { paddingBottom: `${inputContainerHeight + (hasSuggestions ? 4 : 32)}px` }, children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [
|
|
111
|
-
BoundMessageView,
|
|
112
|
-
hasSuggestions ? /* @__PURE__ */ jsx("div", { className: "pl-0 pr-4 sm:px-0 mt-4", children: BoundSuggestionView }) : null
|
|
113
|
-
] }) })
|
|
114
|
-
});
|
|
115
|
-
const BoundScrollToBottomButton = renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, {});
|
|
116
|
-
const BoundDisclaimer = renderSlot(disclaimer, CopilotChatView.Disclaimer, {});
|
|
117
|
-
const BoundInputContainer = renderSlot(inputContainer, CopilotChatView.InputContainer, {
|
|
118
|
-
ref: inputContainerRef,
|
|
119
|
-
keyboardHeight: isKeyboardOpen ? keyboardHeight : 0,
|
|
120
|
-
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
121
|
-
/* @__PURE__ */ jsx("div", { className: "max-w-3xl mx-auto py-0 px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6 pointer-events-auto", children: BoundInput }),
|
|
122
|
-
BoundDisclaimer
|
|
123
|
-
] })
|
|
124
|
-
});
|
|
125
|
-
if (children) {
|
|
126
|
-
return children({
|
|
127
|
-
messageView: BoundMessageView,
|
|
128
|
-
input: BoundInput,
|
|
129
|
-
scrollView: BoundScrollView,
|
|
130
|
-
scrollToBottomButton: BoundScrollToBottomButton,
|
|
131
|
-
feather: BoundFeather,
|
|
132
|
-
inputContainer: BoundInputContainer,
|
|
133
|
-
disclaimer: BoundDisclaimer,
|
|
134
|
-
suggestionView: BoundSuggestionView ?? /* @__PURE__ */ jsx(Fragment, {})
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return /* @__PURE__ */ jsxs("div", { className: twMerge("relative h-full", className), ...props, children: [
|
|
138
|
-
BoundScrollView,
|
|
139
|
-
BoundFeather,
|
|
140
|
-
BoundInputContainer
|
|
141
|
-
] });
|
|
142
|
-
}
|
|
143
|
-
((CopilotChatView2) => {
|
|
144
|
-
const ScrollContent = ({ children, scrollToBottomButton, inputContainerHeight, isResizing }) => {
|
|
145
|
-
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
146
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
147
|
-
/* @__PURE__ */ jsx(StickToBottom.Content, { className: "overflow-y-scroll overflow-x-hidden", children: /* @__PURE__ */ jsx("div", { className: "px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6", children }) }),
|
|
148
|
-
!isAtBottom && !isResizing && /* @__PURE__ */ jsx(
|
|
149
|
-
"div",
|
|
150
|
-
{
|
|
151
|
-
className: "absolute inset-x-0 flex justify-center z-10 pointer-events-none",
|
|
152
|
-
style: {
|
|
153
|
-
bottom: `${inputContainerHeight + 16}px`
|
|
154
|
-
},
|
|
155
|
-
children: renderSlot(scrollToBottomButton, CopilotChatView2.ScrollToBottomButton, {
|
|
156
|
-
onClick: () => scrollToBottom()
|
|
157
|
-
})
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
] });
|
|
161
|
-
};
|
|
162
|
-
CopilotChatView2.ScrollView = ({
|
|
163
|
-
children,
|
|
164
|
-
autoScroll = true,
|
|
165
|
-
scrollToBottomButton,
|
|
166
|
-
inputContainerHeight = 0,
|
|
167
|
-
isResizing = false,
|
|
168
|
-
className,
|
|
169
|
-
...props
|
|
170
|
-
}) => {
|
|
171
|
-
const [hasMounted, setHasMounted] = useState(false);
|
|
172
|
-
const { scrollRef, contentRef, scrollToBottom } = useStickToBottom();
|
|
173
|
-
const [showScrollButton, setShowScrollButton] = useState(false);
|
|
174
|
-
useEffect(() => {
|
|
175
|
-
setHasMounted(true);
|
|
176
|
-
}, []);
|
|
177
|
-
useEffect(() => {
|
|
178
|
-
if (autoScroll) return;
|
|
179
|
-
const scrollElement = scrollRef.current;
|
|
180
|
-
if (!scrollElement) return;
|
|
181
|
-
const checkScroll = () => {
|
|
182
|
-
const atBottom = scrollElement.scrollHeight - scrollElement.scrollTop - scrollElement.clientHeight < 10;
|
|
183
|
-
setShowScrollButton(!atBottom);
|
|
184
|
-
};
|
|
185
|
-
checkScroll();
|
|
186
|
-
scrollElement.addEventListener("scroll", checkScroll);
|
|
187
|
-
const resizeObserver = new ResizeObserver(checkScroll);
|
|
188
|
-
resizeObserver.observe(scrollElement);
|
|
189
|
-
return () => {
|
|
190
|
-
scrollElement.removeEventListener("scroll", checkScroll);
|
|
191
|
-
resizeObserver.disconnect();
|
|
192
|
-
};
|
|
193
|
-
}, [scrollRef, autoScroll]);
|
|
194
|
-
if (!hasMounted) {
|
|
195
|
-
return /* @__PURE__ */ jsx("div", { className: "h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden", children: /* @__PURE__ */ jsx("div", { className: "px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6", children }) });
|
|
196
|
-
}
|
|
197
|
-
if (!autoScroll) {
|
|
198
|
-
return /* @__PURE__ */ jsxs(
|
|
199
|
-
"div",
|
|
200
|
-
{
|
|
201
|
-
ref: scrollRef,
|
|
202
|
-
className: cn(
|
|
203
|
-
"h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden relative",
|
|
204
|
-
className
|
|
205
|
-
),
|
|
206
|
-
...props,
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ jsx("div", { ref: contentRef, className: "px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6", children }),
|
|
209
|
-
showScrollButton && !isResizing && /* @__PURE__ */ jsx(
|
|
210
|
-
"div",
|
|
211
|
-
{
|
|
212
|
-
className: "absolute inset-x-0 flex justify-center z-10 pointer-events-none",
|
|
213
|
-
style: {
|
|
214
|
-
bottom: `${inputContainerHeight + 16}px`
|
|
215
|
-
},
|
|
216
|
-
children: renderSlot(scrollToBottomButton, CopilotChatView2.ScrollToBottomButton, {
|
|
217
|
-
onClick: () => scrollToBottom()
|
|
218
|
-
})
|
|
219
|
-
}
|
|
220
|
-
)
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
return /* @__PURE__ */ jsx(
|
|
226
|
-
StickToBottom,
|
|
227
|
-
{
|
|
228
|
-
className: cn("h-full max-h-full flex flex-col min-h-0 relative", className),
|
|
229
|
-
resize: "smooth",
|
|
230
|
-
initial: "smooth",
|
|
231
|
-
...props,
|
|
232
|
-
children: /* @__PURE__ */ jsx(
|
|
233
|
-
ScrollContent,
|
|
234
|
-
{
|
|
235
|
-
scrollToBottomButton,
|
|
236
|
-
inputContainerHeight,
|
|
237
|
-
isResizing,
|
|
238
|
-
children
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
}
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
CopilotChatView2.ScrollToBottomButton = ({
|
|
245
|
-
className,
|
|
246
|
-
...props
|
|
247
|
-
}) => /* @__PURE__ */ jsx(
|
|
248
|
-
Button,
|
|
249
|
-
{
|
|
250
|
-
variant: "outline",
|
|
251
|
-
size: "sm",
|
|
252
|
-
className: twMerge(
|
|
253
|
-
"rounded-full w-10 h-10 p-0 pointer-events-auto",
|
|
254
|
-
"bg-white dark:bg-gray-900",
|
|
255
|
-
"shadow-lg border border-gray-200 dark:border-gray-700",
|
|
256
|
-
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
257
|
-
"flex items-center justify-center cursor-pointer",
|
|
258
|
-
className
|
|
259
|
-
),
|
|
260
|
-
...props,
|
|
261
|
-
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4 text-gray-600 dark:text-white" })
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
CopilotChatView2.Feather = ({ className, style, ...props }) => /* @__PURE__ */ jsx(
|
|
265
|
-
"div",
|
|
266
|
-
{
|
|
267
|
-
className: cn(
|
|
268
|
-
"absolute bottom-0 left-0 right-4 h-24 pointer-events-none z-10 bg-gradient-to-t",
|
|
269
|
-
"from-white via-white to-transparent",
|
|
270
|
-
"dark:from-[rgb(33,33,33)] dark:via-[rgb(33,33,33)]",
|
|
271
|
-
className
|
|
272
|
-
),
|
|
273
|
-
style,
|
|
274
|
-
...props
|
|
275
|
-
}
|
|
276
|
-
);
|
|
277
|
-
CopilotChatView2.InputContainer = React.forwardRef(({ children, className, keyboardHeight = 0, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
278
|
-
"div",
|
|
279
|
-
{
|
|
280
|
-
ref,
|
|
281
|
-
className: cn("absolute bottom-0 left-0 right-0 z-20 pointer-events-none", className),
|
|
282
|
-
style: {
|
|
283
|
-
// Adjust position when keyboard is open to keep input visible
|
|
284
|
-
transform: keyboardHeight > 0 ? `translateY(-${keyboardHeight}px)` : void 0,
|
|
285
|
-
transition: "transform 0.2s ease-out"
|
|
286
|
-
},
|
|
287
|
-
...props,
|
|
288
|
-
children
|
|
289
|
-
}
|
|
290
|
-
));
|
|
291
|
-
CopilotChatView2.InputContainer.displayName = "CopilotChatView.InputContainer";
|
|
292
|
-
CopilotChatView2.Disclaimer = ({ className, ...props }) => {
|
|
293
|
-
const config = useCopilotChatConfiguration();
|
|
294
|
-
const labels = config?.labels ?? CopilotChatDefaultLabels;
|
|
295
|
-
return /* @__PURE__ */ jsx(
|
|
296
|
-
"div",
|
|
297
|
-
{
|
|
298
|
-
className: cn("text-center text-xs text-muted-foreground py-3 px-4 max-w-3xl mx-auto", className),
|
|
299
|
-
...props,
|
|
300
|
-
children: labels.chatDisclaimerText
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
};
|
|
304
|
-
})(CopilotChatView || (CopilotChatView = {}));
|
|
305
|
-
var CopilotChatView_default = CopilotChatView;
|
|
306
|
-
|
|
307
|
-
export {
|
|
308
|
-
CopilotChatView,
|
|
309
|
-
CopilotChatView_default
|
|
310
|
-
};
|
|
311
|
-
//# sourceMappingURL=chunk-F43IPGPA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/CopilotChatView.tsx"],"sourcesContent":["import React, { useRef, useState, useEffect } from \"react\";\nimport { WithSlots, renderSlot } from \"@/lib/slots\";\nimport CopilotChatMessageView from \"./CopilotChatMessageView\";\nimport CopilotChatInput, { CopilotChatInputProps } from \"./CopilotChatInput\";\nimport CopilotChatSuggestionView, { CopilotChatSuggestionViewProps } from \"./CopilotChatSuggestionView\";\nimport { Suggestion } from \"@copilotkitnext/core\";\nimport { Message } from \"@ag-ui/core\";\nimport { twMerge } from \"tailwind-merge\";\nimport { StickToBottom, useStickToBottom, useStickToBottomContext } from \"use-stick-to-bottom\";\nimport { ChevronDown } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport { useCopilotChatConfiguration, CopilotChatDefaultLabels } from \"@/providers/CopilotChatConfigurationProvider\";\nimport { useKeyboardHeight } from \"@/hooks/use-keyboard-height\";\n\nexport type CopilotChatViewProps = WithSlots<\n {\n messageView: typeof CopilotChatMessageView;\n scrollView: React.FC<React.HTMLAttributes<HTMLDivElement>>;\n scrollToBottomButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n input: typeof CopilotChatInput;\n inputContainer: React.FC<React.HTMLAttributes<HTMLDivElement> & { children: React.ReactNode }>;\n feather: React.FC<React.HTMLAttributes<HTMLDivElement>>;\n disclaimer: React.FC<React.HTMLAttributes<HTMLDivElement>>;\n suggestionView: typeof CopilotChatSuggestionView;\n },\n {\n messages?: Message[];\n autoScroll?: boolean;\n inputProps?: Partial<Omit<CopilotChatInputProps, \"children\">>;\n isRunning?: boolean;\n suggestions?: Suggestion[];\n suggestionLoadingIndexes?: ReadonlyArray<number>;\n onSelectSuggestion?: (suggestion: Suggestion, index: number) => void;\n } & React.HTMLAttributes<HTMLDivElement>\n>;\n\nexport function CopilotChatView({\n messageView,\n input,\n scrollView,\n scrollToBottomButton,\n feather,\n inputContainer,\n disclaimer,\n suggestionView,\n messages = [],\n autoScroll = true,\n inputProps,\n isRunning = false,\n suggestions,\n suggestionLoadingIndexes,\n onSelectSuggestion,\n children,\n className,\n ...props\n}: CopilotChatViewProps) {\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const [inputContainerHeight, setInputContainerHeight] = useState(0);\n const [isResizing, setIsResizing] = useState(false);\n const resizeTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n // Track keyboard state for mobile\n const { isKeyboardOpen, keyboardHeight, availableHeight } = useKeyboardHeight();\n\n // Track input container height changes\n useEffect(() => {\n const element = inputContainerRef.current;\n if (!element) return;\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const newHeight = entry.contentRect.height;\n\n // Update height and set resizing state\n setInputContainerHeight((prevHeight) => {\n if (newHeight !== prevHeight) {\n setIsResizing(true);\n\n // Clear existing timeout\n if (resizeTimeoutRef.current) {\n clearTimeout(resizeTimeoutRef.current);\n }\n\n // Set isResizing to false after a short delay\n resizeTimeoutRef.current = setTimeout(() => {\n setIsResizing(false);\n }, 250);\n\n return newHeight;\n }\n return prevHeight;\n });\n }\n });\n\n resizeObserver.observe(element);\n\n // Set initial height\n setInputContainerHeight(element.offsetHeight);\n\n return () => {\n resizeObserver.disconnect();\n if (resizeTimeoutRef.current) {\n clearTimeout(resizeTimeoutRef.current);\n }\n };\n }, []);\n\n const BoundMessageView = renderSlot(messageView, CopilotChatMessageView, {\n messages,\n isRunning,\n });\n\n const BoundInput = renderSlot(input, CopilotChatInput, (inputProps ?? {}) as CopilotChatInputProps);\n const hasSuggestions = Array.isArray(suggestions) && suggestions.length > 0;\n const BoundSuggestionView = hasSuggestions\n ? renderSlot<typeof CopilotChatSuggestionView, CopilotChatSuggestionViewProps>(\n suggestionView,\n CopilotChatSuggestionView,\n {\n suggestions,\n loadingIndexes: suggestionLoadingIndexes,\n onSelectSuggestion,\n className: \"mb-3 lg:ml-4 lg:mr-4 ml-0 mr-0\",\n },\n )\n : null;\n const BoundFeather = renderSlot(feather, CopilotChatView.Feather, {});\n const BoundScrollView = renderSlot(scrollView, CopilotChatView.ScrollView, {\n autoScroll,\n scrollToBottomButton,\n inputContainerHeight,\n isResizing,\n children: (\n <div style={{ paddingBottom: `${inputContainerHeight + (hasSuggestions ? 4 : 32)}px` }}>\n <div className=\"max-w-3xl mx-auto\">\n {BoundMessageView}\n {hasSuggestions ? <div className=\"pl-0 pr-4 sm:px-0 mt-4\">{BoundSuggestionView}</div> : null}\n </div>\n </div>\n ),\n });\n\n const BoundScrollToBottomButton = renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, {});\n\n const BoundDisclaimer = renderSlot(disclaimer, CopilotChatView.Disclaimer, {});\n\n const BoundInputContainer = renderSlot(inputContainer, CopilotChatView.InputContainer, {\n ref: inputContainerRef,\n keyboardHeight: isKeyboardOpen ? keyboardHeight : 0,\n children: (\n <>\n <div className=\"max-w-3xl mx-auto py-0 px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6 pointer-events-auto\">\n {BoundInput}\n </div>\n {BoundDisclaimer}\n </>\n ),\n });\n\n if (children) {\n return children({\n messageView: BoundMessageView,\n input: BoundInput,\n scrollView: BoundScrollView,\n scrollToBottomButton: BoundScrollToBottomButton,\n feather: BoundFeather,\n inputContainer: BoundInputContainer,\n disclaimer: BoundDisclaimer,\n suggestionView: BoundSuggestionView ?? <></>,\n });\n }\n\n return (\n <div className={twMerge(\"relative h-full\", className)} {...props}>\n {BoundScrollView}\n\n {BoundFeather}\n\n {BoundInputContainer}\n </div>\n );\n}\n\nexport namespace CopilotChatView {\n // Inner component that has access to StickToBottom context\n const ScrollContent: React.FC<{\n children: React.ReactNode;\n scrollToBottomButton?: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n inputContainerHeight: number;\n isResizing: boolean;\n }> = ({ children, scrollToBottomButton, inputContainerHeight, isResizing }) => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n return (\n <>\n <StickToBottom.Content className=\"overflow-y-scroll overflow-x-hidden\">\n <div className=\"px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6\">{children}</div>\n </StickToBottom.Content>\n\n {/* Scroll to bottom button - hidden during resize */}\n {!isAtBottom && !isResizing && (\n <div\n className=\"absolute inset-x-0 flex justify-center z-10 pointer-events-none\"\n style={{\n bottom: `${inputContainerHeight + 16}px`,\n }}\n >\n {renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, {\n onClick: () => scrollToBottom(),\n })}\n </div>\n )}\n </>\n );\n };\n\n export const ScrollView: React.FC<\n React.HTMLAttributes<HTMLDivElement> & {\n autoScroll?: boolean;\n scrollToBottomButton?: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;\n inputContainerHeight?: number;\n isResizing?: boolean;\n }\n > = ({\n children,\n autoScroll = true,\n scrollToBottomButton,\n inputContainerHeight = 0,\n isResizing = false,\n className,\n ...props\n }) => {\n const [hasMounted, setHasMounted] = useState(false);\n const { scrollRef, contentRef, scrollToBottom } = useStickToBottom();\n const [showScrollButton, setShowScrollButton] = useState(false);\n\n useEffect(() => {\n setHasMounted(true);\n }, []);\n\n // Monitor scroll position for non-autoscroll mode\n useEffect(() => {\n if (autoScroll) return; // Skip for autoscroll mode\n\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const checkScroll = () => {\n const atBottom = scrollElement.scrollHeight - scrollElement.scrollTop - scrollElement.clientHeight < 10;\n setShowScrollButton(!atBottom);\n };\n\n checkScroll();\n scrollElement.addEventListener(\"scroll\", checkScroll);\n\n // Also check on resize\n const resizeObserver = new ResizeObserver(checkScroll);\n resizeObserver.observe(scrollElement);\n\n return () => {\n scrollElement.removeEventListener(\"scroll\", checkScroll);\n resizeObserver.disconnect();\n };\n }, [scrollRef, autoScroll]);\n\n if (!hasMounted) {\n return (\n <div className=\"h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden\">\n <div className=\"px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6\">{children}</div>\n </div>\n );\n }\n\n // When autoScroll is false, we don't use StickToBottom\n if (!autoScroll) {\n return (\n <div\n ref={scrollRef}\n className={cn(\n \"h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden relative\",\n className,\n )}\n {...props}\n >\n <div ref={contentRef} className=\"px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6\">\n {children}\n </div>\n\n {/* Scroll to bottom button for manual mode */}\n {showScrollButton && !isResizing && (\n <div\n className=\"absolute inset-x-0 flex justify-center z-10 pointer-events-none\"\n style={{\n bottom: `${inputContainerHeight + 16}px`,\n }}\n >\n {renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, {\n onClick: () => scrollToBottom(),\n })}\n </div>\n )}\n </div>\n );\n }\n\n return (\n <StickToBottom\n className={cn(\"h-full max-h-full flex flex-col min-h-0 relative\", className)}\n resize=\"smooth\"\n initial=\"smooth\"\n {...props}\n >\n <ScrollContent\n scrollToBottomButton={scrollToBottomButton}\n inputContainerHeight={inputContainerHeight}\n isResizing={isResizing}\n >\n {children}\n </ScrollContent>\n </StickToBottom>\n );\n };\n\n export const ScrollToBottomButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>> = ({\n className,\n ...props\n }) => (\n <Button\n variant=\"outline\"\n size=\"sm\"\n className={twMerge(\n \"rounded-full w-10 h-10 p-0 pointer-events-auto\",\n \"bg-white dark:bg-gray-900\",\n \"shadow-lg border border-gray-200 dark:border-gray-700\",\n \"hover:bg-gray-50 dark:hover:bg-gray-800\",\n \"flex items-center justify-center cursor-pointer\",\n className,\n )}\n {...props}\n >\n <ChevronDown className=\"w-4 h-4 text-gray-600 dark:text-white\" />\n </Button>\n );\n\n export const Feather: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({ className, style, ...props }) => (\n <div\n className={cn(\n \"absolute bottom-0 left-0 right-4 h-24 pointer-events-none z-10 bg-gradient-to-t\",\n \"from-white via-white to-transparent\",\n \"dark:from-[rgb(33,33,33)] dark:via-[rgb(33,33,33)]\",\n className,\n )}\n style={style}\n {...props}\n />\n );\n\n export const InputContainer = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { children: React.ReactNode; keyboardHeight?: number }\n >(({ children, className, keyboardHeight = 0, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"absolute bottom-0 left-0 right-0 z-20 pointer-events-none\", className)}\n style={{\n // Adjust position when keyboard is open to keep input visible\n transform: keyboardHeight > 0 ? `translateY(-${keyboardHeight}px)` : undefined,\n transition: \"transform 0.2s ease-out\",\n }}\n {...props}\n >\n {children}\n </div>\n ));\n\n InputContainer.displayName = \"CopilotChatView.InputContainer\";\n\n export const Disclaimer: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({ className, ...props }) => {\n const config = useCopilotChatConfiguration();\n const labels = config?.labels ?? CopilotChatDefaultLabels;\n\n return (\n <div\n className={cn(\"text-center text-xs text-muted-foreground py-3 px-4 max-w-3xl mx-auto\", className)}\n {...props}\n >\n {labels.chatDisclaimerText}\n </div>\n );\n };\n}\n\nexport default CopilotChatView;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAS,QAAQ,UAAU,iBAAiB;AAOnD,SAAS,eAAe;AACxB,SAAS,eAAe,kBAAkB,+BAA+B;AACzE,SAAS,mBAAmB;AA+HpB,SAgBF,UAdsB,KAFpB;AAnGD,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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AU,yCAAwC;AAAA;AAAA,EACjE;AAGK,EAAMA,iBAAA,UAA0D,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,MACnG;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAGK,EAAMA,iBAAA,iBAAiB,MAAM,WAGlC,CAAC,EAAE,UAAU,WAAW,iBAAiB,GAAG,GAAG,MAAM,GAAG,QACxD;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,6DAA6D,SAAS;AAAA,MACpF,OAAO;AAAA;AAAA,QAEL,WAAW,iBAAiB,IAAI,eAAe,cAAc,QAAQ;AAAA,QACrE,YAAY;AAAA,MACd;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,CACD;AAED,EAAAA,iBAAA,eAAe,cAAc;AAEtB,EAAMA,iBAAA,aAA6D,CAAC,EAAE,WAAW,GAAG,MAAM,MAAM;AACrG,UAAM,SAAS,4BAA4B;AAC3C,UAAM,SAAS,QAAQ,UAAU;AAEjC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,yEAAyE,SAAS;AAAA,QAC/F,GAAG;AAAA,QAEH,iBAAO;AAAA;AAAA,IACV;AAAA,EAEJ;AAAA,GA9Me;AAiNjB,IAAO,0BAAQ;","names":["CopilotChatView"]}
|
package/dist/chunk-FIBK3DYE.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/lib/slots.tsx
|
|
2
|
-
import React from "react";
|
|
3
|
-
function renderSlot(slot, DefaultComponent, props) {
|
|
4
|
-
if (typeof slot === "string") {
|
|
5
|
-
return React.createElement(DefaultComponent, {
|
|
6
|
-
...props,
|
|
7
|
-
className: slot
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
if (typeof slot === "function") {
|
|
11
|
-
const Comp = slot;
|
|
12
|
-
return React.createElement(Comp, props);
|
|
13
|
-
}
|
|
14
|
-
if (slot && typeof slot === "object" && !React.isValidElement(slot)) {
|
|
15
|
-
return React.createElement(DefaultComponent, {
|
|
16
|
-
...props,
|
|
17
|
-
...slot
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return React.createElement(DefaultComponent, props);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
renderSlot
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=chunk-FIBK3DYE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/slots.tsx"],"sourcesContent":["import React from \"react\";\n\n// /** Utility: Create a component type with specific props omitted */\n// export type OmitSlotProps<\n// C extends React.ComponentType<any>,\n// K extends keyof React.ComponentProps<C>,\n// > = React.ComponentType<Omit<React.ComponentProps<C>, K>>;\n\n/** Existing union (unchanged) */\nexport type SlotValue<C extends React.ComponentType<any>> =\n | C\n | string\n | Partial<React.ComponentProps<C>>;\n\n/** Utility: concrete React elements for every slot */\ntype SlotElements<S> = { [K in keyof S]: React.ReactElement };\n\nexport type WithSlots<\n S extends Record<string, React.ComponentType<any>>,\n Rest = {},\n> = {\n /** Per‑slot overrides */\n [K in keyof S]?: SlotValue<S[K]>;\n} & {\n children?: (props: SlotElements<S> & Rest) => React.ReactNode;\n} & Omit<Rest, \"children\">;\n\nexport function renderSlot<\n C extends React.ComponentType<any>,\n P = React.ComponentProps<C>,\n>(\n slot: SlotValue<C> | undefined,\n DefaultComponent: C,\n props: P\n): React.ReactElement {\n if (typeof slot === \"string\") {\n return React.createElement(DefaultComponent, {\n ...(props as P),\n className: slot,\n });\n }\n if (typeof slot === \"function\") {\n const Comp = slot as C;\n return React.createElement(Comp, props as P);\n }\n\n if (slot && typeof slot === \"object\" && !React.isValidElement(slot)) {\n return React.createElement(DefaultComponent, {\n ...(props as P),\n ...slot,\n });\n }\n\n return React.createElement(DefaultComponent, props as P);\n}\n"],"mappings":";AAAA,OAAO,WAAW;AA2BX,SAAS,WAId,MACA,kBACA,OACoB;AACpB,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,MAAM,cAAc,kBAAkB;AAAA,MAC3C,GAAI;AAAA,MACJ,WAAW;AAAA,IACb,CAAC;AAAA,EACH;AACA,MAAI,OAAO,SAAS,YAAY;AAC9B,UAAM,OAAO;AACb,WAAO,MAAM,cAAc,MAAM,KAAU;AAAA,EAC7C;AAEA,MAAI,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,eAAe,IAAI,GAAG;AACnE,WAAO,MAAM,cAAc,kBAAkB;AAAA,MAC3C,GAAI;AAAA,MACJ,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAEA,SAAO,MAAM,cAAc,kBAAkB,KAAU;AACzD;","names":[]}
|
package/dist/chunk-FVURPXQK.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotSidebarView
|
|
3
|
-
} from "./chunk-OMPVTGXH.mjs";
|
|
4
|
-
import {
|
|
5
|
-
CopilotChat
|
|
6
|
-
} from "./chunk-32YJ5VJ4.mjs";
|
|
7
|
-
import {
|
|
8
|
-
CopilotChatView_default
|
|
9
|
-
} from "./chunk-JLVGSNAO.mjs";
|
|
10
|
-
|
|
11
|
-
// src/components/chat/CopilotSidebar.tsx
|
|
12
|
-
import { useMemo } from "react";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
function CopilotSidebar({ header, defaultOpen, width, ...chatProps }) {
|
|
15
|
-
const SidebarViewOverride = useMemo(() => {
|
|
16
|
-
const Component = (viewProps) => {
|
|
17
|
-
const { header: viewHeader, width: viewWidth, ...restProps } = viewProps;
|
|
18
|
-
return /* @__PURE__ */ jsx(
|
|
19
|
-
CopilotSidebarView,
|
|
20
|
-
{
|
|
21
|
-
...restProps,
|
|
22
|
-
header: header ?? viewHeader,
|
|
23
|
-
width: width ?? viewWidth
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
return Object.assign(Component, CopilotChatView_default);
|
|
28
|
-
}, [header, width]);
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
CopilotChat,
|
|
31
|
-
{
|
|
32
|
-
...chatProps,
|
|
33
|
-
chatView: SidebarViewOverride,
|
|
34
|
-
isModalDefaultOpen: defaultOpen
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
CopilotSidebar.displayName = "CopilotSidebar";
|
|
39
|
-
var CopilotSidebar_default = CopilotSidebar;
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
CopilotSidebar,
|
|
43
|
-
CopilotSidebar_default
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=chunk-FVURPXQK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/CopilotSidebar.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport { CopilotChat, CopilotChatProps } from \"./CopilotChat\";\nimport CopilotChatView, { CopilotChatViewProps } from \"./CopilotChatView\";\nimport { CopilotSidebarView, CopilotSidebarViewProps } from \"./CopilotSidebarView\";\n\nexport type CopilotSidebarProps = Omit<CopilotChatProps, \"chatView\"> & {\n header?: CopilotSidebarViewProps[\"header\"];\n defaultOpen?: boolean;\n width?: number | string;\n};\n\nexport function CopilotSidebar({ header, defaultOpen, width, ...chatProps }: CopilotSidebarProps) {\n const SidebarViewOverride = useMemo(() => {\n const Component: React.FC<CopilotChatViewProps> = (viewProps) => {\n const { header: viewHeader, width: viewWidth, ...restProps } = viewProps as CopilotSidebarViewProps;\n\n return (\n <CopilotSidebarView\n {...(restProps as CopilotSidebarViewProps)}\n header={header ?? viewHeader}\n width={width ?? viewWidth}\n />\n );\n };\n\n return Object.assign(Component, CopilotChatView);\n }, [header, width]);\n\n return (\n <CopilotChat\n {...chatProps}\n chatView={SidebarViewOverride}\n isModalDefaultOpen={defaultOpen}\n />\n );\n}\n\nCopilotSidebar.displayName = \"CopilotSidebar\";\n\nexport default CopilotSidebar;\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,eAAe;AAkBvB;AAND,SAAS,eAAe,EAAE,QAAQ,aAAa,OAAO,GAAG,UAAU,GAAwB;AAChG,QAAM,sBAAsB,QAAQ,MAAM;AACxC,UAAM,YAA4C,CAAC,cAAc;AAC/D,YAAM,EAAE,QAAQ,YAAY,OAAO,WAAW,GAAG,UAAU,IAAI;AAE/D,aACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAI;AAAA,UACL,QAAQ,UAAU;AAAA,UAClB,OAAO,SAAS;AAAA;AAAA,MAClB;AAAA,IAEJ;AAEA,WAAO,OAAO,OAAO,WAAW,uBAAe;AAAA,EACjD,GAAG,CAAC,QAAQ,KAAK,CAAC;AAElB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACV,oBAAoB;AAAA;AAAA,EACtB;AAEJ;AAEA,eAAe,cAAc;AAE7B,IAAO,yBAAQ;","names":[]}
|
package/dist/chunk-FZR2XQKR.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// src/hooks/use-keyboard-height.tsx
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
function useKeyboardHeight() {
|
|
4
|
-
const [keyboardState, setKeyboardState] = useState({
|
|
5
|
-
isKeyboardOpen: false,
|
|
6
|
-
keyboardHeight: 0,
|
|
7
|
-
availableHeight: typeof window !== "undefined" ? window.innerHeight : 0,
|
|
8
|
-
viewportHeight: typeof window !== "undefined" ? window.innerHeight : 0
|
|
9
|
-
});
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (typeof window === "undefined") {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const visualViewport = window.visualViewport;
|
|
15
|
-
if (!visualViewport) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const updateKeyboardState = () => {
|
|
19
|
-
const layoutHeight = window.innerHeight;
|
|
20
|
-
const visualHeight = visualViewport.height;
|
|
21
|
-
const keyboardHeight = Math.max(0, layoutHeight - visualHeight);
|
|
22
|
-
const isKeyboardOpen = keyboardHeight > 150;
|
|
23
|
-
setKeyboardState({
|
|
24
|
-
isKeyboardOpen,
|
|
25
|
-
keyboardHeight,
|
|
26
|
-
availableHeight: visualHeight,
|
|
27
|
-
viewportHeight: layoutHeight
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
updateKeyboardState();
|
|
31
|
-
visualViewport.addEventListener("resize", updateKeyboardState);
|
|
32
|
-
visualViewport.addEventListener("scroll", updateKeyboardState);
|
|
33
|
-
return () => {
|
|
34
|
-
visualViewport.removeEventListener("resize", updateKeyboardState);
|
|
35
|
-
visualViewport.removeEventListener("scroll", updateKeyboardState);
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
return keyboardState;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
useKeyboardHeight
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=chunk-FZR2XQKR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-keyboard-height.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nexport interface KeyboardState {\n isKeyboardOpen: boolean;\n keyboardHeight: number;\n availableHeight: number;\n viewportHeight: number;\n}\n\n/**\n * Hook to detect mobile keyboard appearance and calculate available viewport height.\n * Uses the Visual Viewport API to track keyboard state on mobile devices.\n *\n * @returns KeyboardState object with keyboard information\n */\nexport function useKeyboardHeight(): KeyboardState {\n const [keyboardState, setKeyboardState] = useState<KeyboardState>({\n isKeyboardOpen: false,\n keyboardHeight: 0,\n availableHeight: typeof window !== \"undefined\" ? window.innerHeight : 0,\n viewportHeight: typeof window !== \"undefined\" ? window.innerHeight : 0,\n });\n\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n // Check if Visual Viewport API is available\n const visualViewport = window.visualViewport;\n if (!visualViewport) {\n return;\n }\n\n const updateKeyboardState = () => {\n const layoutHeight = window.innerHeight;\n const visualHeight = visualViewport.height;\n\n // Calculate keyboard height (difference between layout and visual viewport)\n const keyboardHeight = Math.max(0, layoutHeight - visualHeight);\n\n // Keyboard is considered open if the height difference is significant (> 150px)\n const isKeyboardOpen = keyboardHeight > 150;\n\n setKeyboardState({\n isKeyboardOpen,\n keyboardHeight,\n availableHeight: visualHeight,\n viewportHeight: layoutHeight,\n });\n };\n\n // Initial state\n updateKeyboardState();\n\n // Listen for viewport changes\n visualViewport.addEventListener(\"resize\", updateKeyboardState);\n visualViewport.addEventListener(\"scroll\", updateKeyboardState);\n\n return () => {\n visualViewport.removeEventListener(\"resize\", updateKeyboardState);\n visualViewport.removeEventListener(\"scroll\", updateKeyboardState);\n };\n }, []);\n\n return keyboardState;\n}\n"],"mappings":";AAAA,SAAS,UAAU,iBAAiB;AAe7B,SAAS,oBAAmC;AACjD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB;AAAA,IAChE,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,iBAAiB,OAAO,WAAW,cAAc,OAAO,cAAc;AAAA,IACtE,gBAAgB,OAAO,WAAW,cAAc,OAAO,cAAc;AAAA,EACvE,CAAC;AAED,YAAU,MAAM;AACd,QAAI,OAAO,WAAW,aAAa;AACjC;AAAA,IACF;AAGA,UAAM,iBAAiB,OAAO;AAC9B,QAAI,CAAC,gBAAgB;AACnB;AAAA,IACF;AAEA,UAAM,sBAAsB,MAAM;AAChC,YAAM,eAAe,OAAO;AAC5B,YAAM,eAAe,eAAe;AAGpC,YAAM,iBAAiB,KAAK,IAAI,GAAG,eAAe,YAAY;AAG9D,YAAM,iBAAiB,iBAAiB;AAExC,uBAAiB;AAAA,QACf;AAAA,QACA;AAAA,QACA,iBAAiB;AAAA,QACjB,gBAAgB;AAAA,MAClB,CAAC;AAAA,IACH;AAGA,wBAAoB;AAGpB,mBAAe,iBAAiB,UAAU,mBAAmB;AAC7D,mBAAe,iBAAiB,UAAU,mBAAmB;AAE7D,WAAO,MAAM;AACX,qBAAe,oBAAoB,UAAU,mBAAmB;AAChE,qBAAe,oBAAoB,UAAU,mBAAmB;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;","names":[]}
|
package/dist/chunk-IA4CLXDM.mjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useCopilotKit
|
|
3
|
-
} from "./chunk-RF2CGPHQ.mjs";
|
|
4
|
-
|
|
5
|
-
// src/hooks/use-agent.tsx
|
|
6
|
-
import { useMemo, useEffect, useReducer } from "react";
|
|
7
|
-
import { DEFAULT_AGENT_ID } from "@copilotkitnext/shared";
|
|
8
|
-
var UseAgentUpdate = /* @__PURE__ */ ((UseAgentUpdate2) => {
|
|
9
|
-
UseAgentUpdate2["OnMessagesChanged"] = "OnMessagesChanged";
|
|
10
|
-
UseAgentUpdate2["OnStateChanged"] = "OnStateChanged";
|
|
11
|
-
UseAgentUpdate2["OnRunStatusChanged"] = "OnRunStatusChanged";
|
|
12
|
-
return UseAgentUpdate2;
|
|
13
|
-
})(UseAgentUpdate || {});
|
|
14
|
-
var ALL_UPDATES = [
|
|
15
|
-
"OnMessagesChanged" /* OnMessagesChanged */,
|
|
16
|
-
"OnStateChanged" /* OnStateChanged */,
|
|
17
|
-
"OnRunStatusChanged" /* OnRunStatusChanged */
|
|
18
|
-
];
|
|
19
|
-
function useAgent({ agentId, updates } = {}) {
|
|
20
|
-
agentId ??= DEFAULT_AGENT_ID;
|
|
21
|
-
const { copilotkit } = useCopilotKit();
|
|
22
|
-
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
23
|
-
const updateFlags = useMemo(
|
|
24
|
-
() => updates ?? ALL_UPDATES,
|
|
25
|
-
[JSON.stringify(updates)]
|
|
26
|
-
);
|
|
27
|
-
const agent = useMemo(() => {
|
|
28
|
-
return copilotkit.getAgent(agentId);
|
|
29
|
-
}, [
|
|
30
|
-
agentId,
|
|
31
|
-
copilotkit.agents,
|
|
32
|
-
copilotkit.runtimeConnectionStatus,
|
|
33
|
-
copilotkit
|
|
34
|
-
]);
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (!agent) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (updateFlags.length === 0) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const handlers = {};
|
|
43
|
-
if (updateFlags.includes("OnMessagesChanged" /* OnMessagesChanged */)) {
|
|
44
|
-
handlers.onMessagesChanged = () => {
|
|
45
|
-
forceUpdate();
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (updateFlags.includes("OnStateChanged" /* OnStateChanged */)) {
|
|
49
|
-
handlers.onStateChanged = () => {
|
|
50
|
-
forceUpdate();
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
if (updateFlags.includes("OnRunStatusChanged" /* OnRunStatusChanged */)) {
|
|
54
|
-
handlers.onRunInitialized = () => {
|
|
55
|
-
forceUpdate();
|
|
56
|
-
};
|
|
57
|
-
handlers.onRunFinalized = () => {
|
|
58
|
-
forceUpdate();
|
|
59
|
-
};
|
|
60
|
-
handlers.onRunFailed = () => {
|
|
61
|
-
forceUpdate();
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const subscription = agent.subscribe(handlers);
|
|
65
|
-
return () => subscription.unsubscribe();
|
|
66
|
-
}, [agent, forceUpdate, JSON.stringify(updateFlags)]);
|
|
67
|
-
return {
|
|
68
|
-
agent
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export {
|
|
73
|
-
UseAgentUpdate,
|
|
74
|
-
useAgent
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=chunk-IA4CLXDM.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-agent.tsx"],"sourcesContent":["import { useCopilotKit } from \"@/providers/CopilotKitProvider\";\nimport { useMemo, useEffect, useReducer } from \"react\";\nimport { DEFAULT_AGENT_ID } from \"@copilotkitnext/shared\";\nimport { AbstractAgent } from \"@ag-ui/client\";\n\nexport enum UseAgentUpdate {\n OnMessagesChanged = \"OnMessagesChanged\",\n OnStateChanged = \"OnStateChanged\",\n OnRunStatusChanged = \"OnRunStatusChanged\",\n}\n\nconst ALL_UPDATES: UseAgentUpdate[] = [\n UseAgentUpdate.OnMessagesChanged,\n UseAgentUpdate.OnStateChanged,\n UseAgentUpdate.OnRunStatusChanged,\n];\n\nexport interface UseAgentProps {\n agentId?: string;\n updates?: UseAgentUpdate[];\n}\n\nexport function useAgent({ agentId, updates }: UseAgentProps = {}) {\n agentId ??= DEFAULT_AGENT_ID;\n\n const { copilotkit } = useCopilotKit();\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n const updateFlags = useMemo(\n () => updates ?? ALL_UPDATES,\n [JSON.stringify(updates)]\n );\n\n const agent: AbstractAgent | undefined = useMemo(() => {\n return copilotkit.getAgent(agentId);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n agentId,\n copilotkit.agents,\n copilotkit.runtimeConnectionStatus,\n copilotkit,\n ]);\n\n useEffect(() => {\n if (!agent) {\n return;\n }\n\n if (updateFlags.length === 0) {\n return;\n }\n\n const handlers: Parameters<AbstractAgent[\"subscribe\"]>[0] = {};\n\n if (updateFlags.includes(UseAgentUpdate.OnMessagesChanged)) {\n handlers.onMessagesChanged = () => {\n forceUpdate();\n };\n }\n\n if (updateFlags.includes(UseAgentUpdate.OnStateChanged)) {\n handlers.onStateChanged = () => {\n forceUpdate();\n };\n }\n\n if (updateFlags.includes(UseAgentUpdate.OnRunStatusChanged)) {\n handlers.onRunInitialized = () => {\n forceUpdate();\n };\n handlers.onRunFinalized = () => {\n forceUpdate();\n };\n handlers.onRunFailed = () => {\n forceUpdate();\n };\n }\n\n const subscription = agent.subscribe(handlers);\n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B,oBAAY;AAAA,MACd;AACA,eAAS,cAAc,MAAM;AAC3B,oBAAY;AAAA,MACd;AAAA,IACF;AAEA,UAAM,eAAe,MAAM,UAAU,QAAQ;AAC7C,WAAO,MAAM,aAAa,YAAY;AAAA,EACxC,GAAG,CAAC,OAAO,aAAa,KAAK,UAAU,WAAW,CAAC,CAAC;AAEpD,SAAO;AAAA,IACL;AAAA,EACF;AACF;","names":["UseAgentUpdate"]}
|
package/dist/chunk-IH5VFJ4L.mjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CopilotPopupView
|
|
3
|
-
} from "./chunk-VUHFLJWI.mjs";
|
|
4
|
-
import {
|
|
5
|
-
CopilotChat
|
|
6
|
-
} from "./chunk-TKFOXPXF.mjs";
|
|
7
|
-
import {
|
|
8
|
-
CopilotChatView_default
|
|
9
|
-
} from "./chunk-F43IPGPA.mjs";
|
|
10
|
-
|
|
11
|
-
// src/components/chat/CopilotPopup.tsx
|
|
12
|
-
import { useMemo } from "react";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
function CopilotPopup({
|
|
15
|
-
header,
|
|
16
|
-
defaultOpen,
|
|
17
|
-
width,
|
|
18
|
-
height,
|
|
19
|
-
clickOutsideToClose,
|
|
20
|
-
...chatProps
|
|
21
|
-
}) {
|
|
22
|
-
const PopupViewOverride = useMemo(() => {
|
|
23
|
-
const Component = (viewProps) => {
|
|
24
|
-
const {
|
|
25
|
-
header: viewHeader,
|
|
26
|
-
width: viewWidth,
|
|
27
|
-
height: viewHeight,
|
|
28
|
-
clickOutsideToClose: viewClickOutsideToClose,
|
|
29
|
-
...restProps
|
|
30
|
-
} = viewProps;
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
-
CopilotPopupView,
|
|
33
|
-
{
|
|
34
|
-
...restProps,
|
|
35
|
-
header: header ?? viewHeader,
|
|
36
|
-
width: width ?? viewWidth,
|
|
37
|
-
height: height ?? viewHeight,
|
|
38
|
-
clickOutsideToClose: clickOutsideToClose ?? viewClickOutsideToClose
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
return Object.assign(Component, CopilotChatView_default);
|
|
43
|
-
}, [clickOutsideToClose, header, height, width]);
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
-
CopilotChat,
|
|
46
|
-
{
|
|
47
|
-
...chatProps,
|
|
48
|
-
chatView: PopupViewOverride,
|
|
49
|
-
isModalDefaultOpen: defaultOpen
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
CopilotPopup.displayName = "CopilotPopup";
|
|
54
|
-
var CopilotPopup_default = CopilotPopup;
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
CopilotPopup,
|
|
58
|
-
CopilotPopup_default
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=chunk-IH5VFJ4L.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/CopilotPopup.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\n\nimport { CopilotChat, CopilotChatProps } from \"./CopilotChat\";\nimport CopilotChatView, { CopilotChatViewProps } from \"./CopilotChatView\";\nimport { CopilotPopupView, CopilotPopupViewProps } from \"./CopilotPopupView\";\n\nexport type CopilotPopupProps = Omit<CopilotChatProps, \"chatView\"> & {\n header?: CopilotPopupViewProps[\"header\"];\n defaultOpen?: boolean;\n width?: CopilotPopupViewProps[\"width\"];\n height?: CopilotPopupViewProps[\"height\"];\n clickOutsideToClose?: CopilotPopupViewProps[\"clickOutsideToClose\"];\n};\n\nexport function CopilotPopup({\n header,\n defaultOpen,\n width,\n height,\n clickOutsideToClose,\n ...chatProps\n}: CopilotPopupProps) {\n const PopupViewOverride = useMemo(() => {\n const Component: React.FC<CopilotChatViewProps> = (viewProps) => {\n const {\n header: viewHeader,\n width: viewWidth,\n height: viewHeight,\n clickOutsideToClose: viewClickOutsideToClose,\n ...restProps\n } = viewProps as CopilotPopupViewProps;\n\n return (\n <CopilotPopupView\n {...(restProps as CopilotPopupViewProps)}\n header={header ?? viewHeader}\n width={width ?? viewWidth}\n height={height ?? viewHeight}\n clickOutsideToClose={clickOutsideToClose ?? viewClickOutsideToClose}\n />\n );\n };\n\n return Object.assign(Component, CopilotChatView);\n }, [clickOutsideToClose, header, height, width]);\n\n return (\n <CopilotChat\n {...chatProps}\n chatView={PopupViewOverride}\n isModalDefaultOpen={defaultOpen}\n />\n );\n}\n\nCopilotPopup.displayName = \"CopilotPopup\";\n\nexport default CopilotPopup;\n"],"mappings":";;;;;;;;;;;AAAA,SAAgB,eAAe;AAiCvB;AAnBD,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,oBAAoB,QAAQ,MAAM;AACtC,UAAM,YAA4C,CAAC,cAAc;AAC/D,YAAM;AAAA,QACJ,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,qBAAqB;AAAA,QACrB,GAAG;AAAA,MACL,IAAI;AAEJ,aACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAI;AAAA,UACL,QAAQ,UAAU;AAAA,UAClB,OAAO,SAAS;AAAA,UAChB,QAAQ,UAAU;AAAA,UAClB,qBAAqB,uBAAuB;AAAA;AAAA,MAC9C;AAAA,IAEJ;AAEA,WAAO,OAAO,OAAO,WAAW,uBAAe;AAAA,EACjD,GAAG,CAAC,qBAAqB,QAAQ,QAAQ,KAAK,CAAC;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACV,oBAAoB;AAAA;AAAA,EACtB;AAEJ;AAEA,aAAa,cAAc;AAE3B,IAAO,uBAAQ;","names":[]}
|