@copilotkit/react-core 1.56.3 → 1.56.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.
@@ -5821,6 +5821,7 @@ CopilotChatMessageView.Cursor = function Cursor({ className, ...props }) {
5821
5821
  const CopilotChatAttachmentQueue = ({ attachments, onRemoveAttachment, className }) => {
5822
5822
  if (attachments.length === 0) return null;
5823
5823
  return /* @__PURE__ */ jsx("div", {
5824
+ "data-testid": "copilot-attachment-queue",
5824
5825
  className: cn("cpk:flex cpk:flex-wrap cpk:gap-2 cpk:p-2", className),
5825
5826
  children: attachments.map((attachment) => {
5826
5827
  const isMedia = attachment.type === "image" || attachment.type === "video";
@@ -6247,13 +6248,7 @@ function computeOffsetTop(el, stopAt) {
6247
6248
 
6248
6249
  //#endregion
6249
6250
  //#region src/v2/components/chat/CopilotChatView.tsx
6250
- const FEATHER_HEIGHT = 96;
6251
- const PIN_TO_SEND_FEATHER_HEIGHT = 48;
6252
- const PinToSendSoftFeather = ({ className, style, ...props }) => /* @__PURE__ */ jsx("div", {
6253
- className: cn("cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-4 cpk:h-12 cpk:pointer-events-none cpk:z-10 cpk:bg-gradient-to-t", "cpk:from-white cpk:to-transparent", "cpk:dark:from-[rgb(33,33,33)]", className),
6254
- style,
6255
- ...props
6256
- });
6251
+ const SCROLL_BUTTON_OFFSET = 16;
6257
6252
  function DropOverlay() {
6258
6253
  return /* @__PURE__ */ jsx("div", {
6259
6254
  className: cn("cpk:absolute cpk:inset-0 cpk:z-50 cpk:pointer-events-none", "cpk:flex cpk:items-center cpk:justify-center", "cpk:bg-primary/5 cpk:backdrop-blur-[2px]", "cpk:border-2 cpk:border-dashed cpk:border-primary/40 cpk:rounded-lg cpk:m-2"),
@@ -6316,7 +6311,6 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6316
6311
  onAddFile,
6317
6312
  positioning: "static",
6318
6313
  keyboardHeight: isKeyboardOpen ? keyboardHeight : 0,
6319
- containerRef: inputContainerRef,
6320
6314
  showDisclaimer: true,
6321
6315
  bottomAnchored: true,
6322
6316
  ...disclaimer !== void 0 ? { disclaimer } : {}
@@ -6333,7 +6327,8 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6333
6327
  inputContainerHeight,
6334
6328
  isResizing,
6335
6329
  children: /* @__PURE__ */ jsx("div", {
6336
- style: { paddingBottom: `${hasSuggestions ? 4 : 32}px` },
6330
+ "data-testid": "copilot-scroll-content",
6331
+ style: { paddingBottom: `${inputContainerHeight + (hasSuggestions ? 4 : 32)}px` },
6337
6332
  children: /* @__PURE__ */ jsxs("div", {
6338
6333
  className: "cpk:max-w-3xl cpk:mx-auto",
6339
6334
  children: [BoundMessageView, hasSuggestions ? /* @__PURE__ */ jsx("div", {
@@ -6407,15 +6402,19 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6407
6402
  children: [
6408
6403
  dragOver && /* @__PURE__ */ jsx(DropOverlay, {}),
6409
6404
  BoundScrollView,
6410
- /* @__PURE__ */ jsx("div", {
6411
- className: "cpk:max-w-3xl cpk:mx-auto cpk:w-full",
6412
- children: attachments && attachments.length > 0 && /* @__PURE__ */ jsx(CopilotChatAttachmentQueue, {
6413
- attachments,
6414
- onRemoveAttachment: (id) => onRemoveAttachment?.(id),
6415
- className: "cpk:px-4"
6416
- })
6417
- }),
6418
- BoundInput
6405
+ /* @__PURE__ */ jsxs("div", {
6406
+ ref: inputContainerRef,
6407
+ "data-testid": "copilot-input-overlay",
6408
+ className: "cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-0 cpk:z-20 cpk:pointer-events-none",
6409
+ children: [attachments && attachments.length > 0 && /* @__PURE__ */ jsx("div", {
6410
+ className: "cpk:max-w-3xl cpk:mx-auto cpk:w-full cpk:pointer-events-auto",
6411
+ children: /* @__PURE__ */ jsx(CopilotChatAttachmentQueue, {
6412
+ attachments,
6413
+ onRemoveAttachment: (id) => onRemoveAttachment?.(id),
6414
+ className: "cpk:px-4"
6415
+ })
6416
+ }), BoundInput]
6417
+ })
6419
6418
  ]
6420
6419
  });
6421
6420
  }
@@ -6444,7 +6443,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6444
6443
  BoundFeather,
6445
6444
  !isAtBottom && !isResizing && /* @__PURE__ */ jsx("div", {
6446
6445
  className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
6447
- style: { bottom: `${inputContainerHeight + FEATHER_HEIGHT + 16}px` },
6446
+ style: { bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` },
6448
6447
  children: renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
6449
6448
  })
6450
6449
  ] })
@@ -6458,7 +6457,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6458
6457
  spacerRef,
6459
6458
  topOffset: 16
6460
6459
  });
6461
- const BoundFeather = renderSlot(feather, PinToSendSoftFeather, {});
6460
+ const BoundFeather = renderSlot(feather, CopilotChatView.Feather, {});
6462
6461
  return /* @__PURE__ */ jsx(ScrollElementContext.Provider, {
6463
6462
  value: nonAutoScrollEl,
6464
6463
  children: /* @__PURE__ */ jsxs("div", {
@@ -6485,7 +6484,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6485
6484
  BoundFeather,
6486
6485
  showScrollButton && !isResizing && /* @__PURE__ */ jsx("div", {
6487
6486
  className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
6488
- style: { bottom: `${inputContainerHeight + PIN_TO_SEND_FEATHER_HEIGHT + 16}px` },
6487
+ style: { bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` },
6489
6488
  children: renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
6490
6489
  })
6491
6490
  ]
@@ -6553,7 +6552,7 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6553
6552
  BoundFeather,
6554
6553
  showScrollButton && !isResizing && /* @__PURE__ */ jsx("div", {
6555
6554
  className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
6556
- style: { bottom: `${inputContainerHeight + FEATHER_HEIGHT + 16}px` },
6555
+ style: { bottom: `${inputContainerHeight + SCROLL_BUTTON_OFFSET}px` },
6557
6556
  children: renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
6558
6557
  })
6559
6558
  ]
@@ -6597,9 +6596,8 @@ function CopilotChatView({ messageView, input, scrollView, suggestionView, welco
6597
6596
  ...props,
6598
6597
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "cpk:w-4 cpk:h-4 cpk:text-gray-600 cpk:dark:text-white" })
6599
6598
  });
6600
- _CopilotChatView.Feather = ({ className, style, ...props }) => /* @__PURE__ */ jsx("div", {
6601
- className: cn("cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-4 cpk:h-24 cpk:pointer-events-none cpk:z-10 cpk:bg-gradient-to-t", "cpk:from-white cpk:via-white cpk:to-transparent", "cpk:dark:from-[rgb(33,33,33)] cpk:dark:via-[rgb(33,33,33)]", className),
6602
- style,
6599
+ _CopilotChatView.Feather = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
6600
+ className,
6603
6601
  ...props
6604
6602
  });
6605
6603
  _CopilotChatView.WelcomeMessage = ({ className, ...props }) => {
@@ -9755,4 +9753,4 @@ function validateProps(props) {
9755
9753
 
9756
9754
  //#endregion
9757
9755
  export { CopilotKitProvider as $, CopilotChatSuggestionView as A, useConfigureSuggestions as B, CopilotChatToggleButton as C, CopilotChatView_default as D, CopilotChat as E, CopilotChatAssistantMessage_default as F, useRenderTool as G, useCapabilities as H, CopilotChatToolCallsView as I, useRenderActivityMessage as J, useComponent as K, useAttachments as L, CopilotChatReasoningMessage_default as M, CopilotChatUserMessage_default as N, CopilotChatAttachmentQueue as O, CopilotChatAttachmentRenderer as P, useRenderToolCall as Q, useThreads$1 as R, CopilotModalHeader as S, DefaultOpenIcon as T, useHumanInTheLoop as U, useSuggestions as V, useDefaultRenderTool as W, UseAgentUpdate as X, useRenderCustomMessages as Y, useAgent as Z, WildcardToolCallRender as _, ThreadsProvider as a, SandboxFunctionsContext as at, CopilotPopupView as b, CoAgentStateRendersProvider as c, MCPAppsActivityRenderer as ct, shouldShowDevConsole as d, CopilotChatInput_default as dt, useCopilotKit as et, useToast as f, AudioRecorderError as ft, useCopilotContext as g, CopilotContext as h, useCopilotChatConfiguration as ht, ThreadsContext as i, createA2UIMessageRenderer as it, CopilotChatSuggestionPill as j, CopilotChatMessageView as k, useCoAgentStateRenders as l, MCPAppsActivityType as lt, useCopilotMessagesContext as m, CopilotChatConfigurationProvider as mt, defaultCopilotContextCategories as n, useAgentContext as nt, useThreads as o, useSandboxFunctions as ot, CopilotMessagesContext as p, CopilotChatAudioRecorder as pt, useFrontendTool as q, CoAgentStateRenderBridge as r, defineToolCallRenderer as rt, CoAgentStateRendersContext as s, MCPAppsActivityContentSchema as st, CopilotKit as t, CopilotKitCoreReact as tt, useAsyncCallback as u, CopilotKitInspector as ut, CopilotPopup as v, DefaultCloseIcon as w, CopilotSidebarView as x, CopilotSidebar as y, useInterrupt as z };
9758
- //# sourceMappingURL=copilotkit-PzJlPKcU.mjs.map
9756
+ //# sourceMappingURL=copilotkit-Bd0m5HFp.mjs.map