@copilotkitnext/react 1.51.5-next.4 → 1.52.0-next.6
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/components/WildcardToolCallRender.cjs +13 -13
- package/dist/components/WildcardToolCallRender.cjs.map +1 -1
- package/dist/components/WildcardToolCallRender.mjs +13 -13
- package/dist/components/WildcardToolCallRender.mjs.map +1 -1
- package/dist/components/chat/CopilotChat.cjs.map +1 -1
- package/dist/components/chat/CopilotChat.mjs.map +1 -1
- package/dist/components/chat/CopilotChatAssistantMessage.cjs +36 -28
- package/dist/components/chat/CopilotChatAssistantMessage.cjs.map +1 -1
- package/dist/components/chat/CopilotChatAssistantMessage.mjs +37 -29
- package/dist/components/chat/CopilotChatAssistantMessage.mjs.map +1 -1
- package/dist/components/chat/CopilotChatAudioRecorder.cjs +2 -2
- package/dist/components/chat/CopilotChatAudioRecorder.cjs.map +1 -1
- package/dist/components/chat/CopilotChatAudioRecorder.mjs +2 -2
- package/dist/components/chat/CopilotChatAudioRecorder.mjs.map +1 -1
- package/dist/components/chat/CopilotChatInput.cjs +59 -51
- package/dist/components/chat/CopilotChatInput.cjs.map +1 -1
- package/dist/components/chat/CopilotChatInput.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatInput.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatInput.mjs +59 -51
- package/dist/components/chat/CopilotChatInput.mjs.map +1 -1
- package/dist/components/chat/CopilotChatMessageView.cjs +12 -7
- package/dist/components/chat/CopilotChatMessageView.cjs.map +1 -1
- package/dist/components/chat/CopilotChatMessageView.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatMessageView.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatMessageView.mjs +12 -7
- package/dist/components/chat/CopilotChatMessageView.mjs.map +1 -1
- package/dist/components/chat/CopilotChatReasoningMessage.cjs +24 -20
- package/dist/components/chat/CopilotChatReasoningMessage.cjs.map +1 -1
- package/dist/components/chat/CopilotChatReasoningMessage.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatReasoningMessage.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatReasoningMessage.mjs +25 -21
- package/dist/components/chat/CopilotChatReasoningMessage.mjs.map +1 -1
- package/dist/components/chat/CopilotChatSuggestionPill.cjs +6 -5
- package/dist/components/chat/CopilotChatSuggestionPill.cjs.map +1 -1
- package/dist/components/chat/CopilotChatSuggestionPill.mjs +6 -5
- package/dist/components/chat/CopilotChatSuggestionPill.mjs.map +1 -1
- package/dist/components/chat/CopilotChatSuggestionView.cjs +24 -12
- package/dist/components/chat/CopilotChatSuggestionView.cjs.map +1 -1
- package/dist/components/chat/CopilotChatSuggestionView.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatSuggestionView.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatSuggestionView.mjs +25 -13
- package/dist/components/chat/CopilotChatSuggestionView.mjs.map +1 -1
- package/dist/components/chat/CopilotChatToggleButton.cjs +7 -6
- package/dist/components/chat/CopilotChatToggleButton.cjs.map +1 -1
- package/dist/components/chat/CopilotChatToggleButton.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatToggleButton.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatToggleButton.mjs +7 -6
- package/dist/components/chat/CopilotChatToggleButton.mjs.map +1 -1
- package/dist/components/chat/CopilotChatUserMessage.cjs +29 -24
- package/dist/components/chat/CopilotChatUserMessage.cjs.map +1 -1
- package/dist/components/chat/CopilotChatUserMessage.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatUserMessage.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatUserMessage.mjs +30 -25
- package/dist/components/chat/CopilotChatUserMessage.mjs.map +1 -1
- package/dist/components/chat/CopilotChatView.cjs +45 -35
- package/dist/components/chat/CopilotChatView.cjs.map +1 -1
- package/dist/components/chat/CopilotChatView.d.cts +1 -1
- package/dist/components/chat/CopilotChatView.d.cts.map +1 -1
- package/dist/components/chat/CopilotChatView.d.mts +1 -1
- package/dist/components/chat/CopilotChatView.d.mts.map +1 -1
- package/dist/components/chat/CopilotChatView.mjs +45 -35
- package/dist/components/chat/CopilotChatView.mjs.map +1 -1
- package/dist/components/chat/CopilotModalHeader.cjs +8 -8
- package/dist/components/chat/CopilotModalHeader.cjs.map +1 -1
- package/dist/components/chat/CopilotModalHeader.d.cts.map +1 -1
- package/dist/components/chat/CopilotModalHeader.d.mts.map +1 -1
- package/dist/components/chat/CopilotModalHeader.mjs +8 -8
- package/dist/components/chat/CopilotModalHeader.mjs.map +1 -1
- package/dist/components/chat/CopilotPopupView.cjs +20 -15
- package/dist/components/chat/CopilotPopupView.cjs.map +1 -1
- package/dist/components/chat/CopilotPopupView.d.cts.map +1 -1
- package/dist/components/chat/CopilotPopupView.d.mts.map +1 -1
- package/dist/components/chat/CopilotPopupView.mjs +20 -15
- package/dist/components/chat/CopilotPopupView.mjs.map +1 -1
- package/dist/components/chat/CopilotSidebarView.cjs +54 -43
- package/dist/components/chat/CopilotSidebarView.cjs.map +1 -1
- package/dist/components/chat/CopilotSidebarView.d.cts.map +1 -1
- package/dist/components/chat/CopilotSidebarView.d.mts.map +1 -1
- package/dist/components/chat/CopilotSidebarView.mjs +55 -44
- package/dist/components/chat/CopilotSidebarView.mjs.map +1 -1
- package/dist/components/ui/button.cjs +42 -42
- package/dist/components/ui/button.cjs.map +1 -1
- package/dist/components/ui/button.mjs +42 -42
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/dropdown-menu.cjs +7 -6
- package/dist/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/components/ui/dropdown-menu.mjs +7 -6
- package/dist/components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/components/ui/tooltip.cjs +3 -2
- package/dist/components/ui/tooltip.cjs.map +1 -1
- package/dist/components/ui/tooltip.mjs +3 -2
- package/dist/components/ui/tooltip.mjs.map +1 -1
- package/dist/hooks/use-component.cjs +18 -5
- package/dist/hooks/use-component.cjs.map +1 -1
- package/dist/hooks/use-component.d.cts +21 -7
- package/dist/hooks/use-component.d.cts.map +1 -1
- package/dist/hooks/use-component.d.mts +21 -7
- package/dist/hooks/use-component.d.mts.map +1 -1
- package/dist/hooks/use-component.mjs +18 -5
- package/dist/hooks/use-component.mjs.map +1 -1
- package/dist/hooks/use-default-render-tool.cjs +2 -2
- package/dist/hooks/use-default-render-tool.cjs.map +1 -1
- package/dist/hooks/use-default-render-tool.d.cts +3 -3
- package/dist/hooks/use-default-render-tool.d.cts.map +1 -1
- package/dist/hooks/use-default-render-tool.d.mts +3 -3
- package/dist/hooks/use-default-render-tool.d.mts.map +1 -1
- package/dist/hooks/use-default-render-tool.mjs +2 -2
- package/dist/hooks/use-default-render-tool.mjs.map +1 -1
- package/dist/hooks/use-render-tool.cjs +15 -9
- package/dist/hooks/use-render-tool.cjs.map +1 -1
- package/dist/hooks/use-render-tool.d.cts +9 -9
- package/dist/hooks/use-render-tool.d.cts.map +1 -1
- package/dist/hooks/use-render-tool.d.mts +9 -9
- package/dist/hooks/use-render-tool.d.mts.map +1 -1
- package/dist/hooks/use-render-tool.mjs +15 -9
- package/dist/hooks/use-render-tool.mjs.map +1 -1
- package/dist/index.umd.js +429 -339
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/utils.cjs +2 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.mjs +3 -2
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/eslint-rules/README.md +52 -0
- package/eslint-rules/require-cpk-prefix.mjs +375 -0
- package/eslint.config.mjs +17 -0
- package/package.json +8 -7
package/dist/index.umd.js
CHANGED
|
@@ -107,65 +107,66 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
107
107
|
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/lib/utils.ts
|
|
110
|
+
const twMerge$8 = (0, tailwind_merge.extendTailwindMerge)({ prefix: "cpk" });
|
|
110
111
|
function cn(...inputs) {
|
|
111
|
-
return
|
|
112
|
+
return twMerge$8((0, clsx.clsx)(inputs));
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
//#endregion
|
|
115
116
|
//#region src/components/ui/button.tsx
|
|
116
|
-
const buttonVariants = (0, class_variance_authority.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
117
|
+
const buttonVariants = (0, class_variance_authority.cva)("cpk:inline-flex cpk:items-center cpk:justify-center cpk:gap-2 cpk:whitespace-nowrap cpk:rounded-md cpk:text-sm cpk:font-medium cpk:transition-all cpk:disabled:pointer-events-none cpk:disabled:opacity-50 cpk:[&_svg]:pointer-events-none cpk:[&_svg:not([class*='size-'])]:size-4 cpk:shrink-0 cpk:[&_svg]:shrink-0 cpk:outline-none cpk:focus-visible:border-ring cpk:focus-visible:ring-ring/50 cpk:focus-visible:ring-[3px] cpk:aria-invalid:ring-destructive/20 cpk:dark:aria-invalid:ring-destructive/40 cpk:aria-invalid:border-destructive", {
|
|
117
118
|
variants: {
|
|
118
119
|
variant: {
|
|
119
|
-
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
120
|
-
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
121
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
122
|
-
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
123
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 cursor-pointer",
|
|
124
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
120
|
+
default: "cpk:bg-primary cpk:text-primary-foreground cpk:shadow-xs cpk:hover:bg-primary/90",
|
|
121
|
+
destructive: "cpk:bg-destructive cpk:text-white cpk:shadow-xs cpk:hover:bg-destructive/90 cpk:focus-visible:ring-destructive/20 cpk:dark:focus-visible:ring-destructive/40 cpk:dark:bg-destructive/60",
|
|
122
|
+
outline: "cpk:border cpk:bg-background cpk:shadow-xs cpk:hover:bg-accent cpk:hover:text-accent-foreground cpk:dark:bg-input/30 cpk:dark:border-input cpk:dark:hover:bg-input/50",
|
|
123
|
+
secondary: "cpk:bg-secondary cpk:text-secondary-foreground cpk:shadow-xs cpk:hover:bg-secondary/80",
|
|
124
|
+
ghost: "cpk:hover:bg-accent cpk:hover:text-accent-foreground cpk:dark:hover:bg-accent/50 cpk:cursor-pointer",
|
|
125
|
+
link: "cpk:text-primary cpk:underline-offset-4 cpk:hover:underline",
|
|
125
126
|
assistantMessageToolbarButton: [
|
|
126
|
-
"cursor-pointer",
|
|
127
|
-
"p-0 text-[rgb(93,93,93)] hover:bg-[#E8E8E8]",
|
|
128
|
-
"dark:text-[rgb(243,243,243)] dark:hover:bg-[#303030]",
|
|
129
|
-
"h-8 w-8",
|
|
130
|
-
"transition-colors",
|
|
131
|
-
"hover:text-[rgb(93,93,93)]",
|
|
132
|
-
"dark:hover:text-[rgb(243,243,243)]"
|
|
127
|
+
"cpk:cursor-pointer",
|
|
128
|
+
"cpk:p-0 cpk:text-[rgb(93,93,93)] cpk:hover:bg-[#E8E8E8]",
|
|
129
|
+
"cpk:dark:text-[rgb(243,243,243)] cpk:dark:hover:bg-[#303030]",
|
|
130
|
+
"cpk:h-8 cpk:w-8",
|
|
131
|
+
"cpk:transition-colors",
|
|
132
|
+
"cpk:hover:text-[rgb(93,93,93)]",
|
|
133
|
+
"cpk:dark:hover:text-[rgb(243,243,243)]"
|
|
133
134
|
],
|
|
134
135
|
chatInputToolbarPrimary: [
|
|
135
|
-
"cursor-pointer",
|
|
136
|
-
"bg-black text-white",
|
|
137
|
-
"dark:bg-white dark:text-black dark:focus-visible:outline-white",
|
|
138
|
-
"rounded-full",
|
|
139
|
-
"transition-colors",
|
|
140
|
-
"focus:outline-none",
|
|
141
|
-
"hover:opacity-70 disabled:hover:opacity-100",
|
|
142
|
-
"disabled:cursor-not-allowed disabled:bg-[#00000014] disabled:text-[rgb(13,13,13)]",
|
|
143
|
-
"dark:disabled:bg-[#454545] dark:disabled:text-white "
|
|
136
|
+
"cpk:cursor-pointer",
|
|
137
|
+
"cpk:bg-black cpk:text-white",
|
|
138
|
+
"cpk:dark:bg-white cpk:dark:text-black cpk:dark:focus-visible:outline-white",
|
|
139
|
+
"cpk:rounded-full",
|
|
140
|
+
"cpk:transition-colors",
|
|
141
|
+
"cpk:focus:outline-none",
|
|
142
|
+
"cpk:hover:opacity-70 cpk:disabled:hover:opacity-100",
|
|
143
|
+
"cpk:disabled:cursor-not-allowed cpk:disabled:bg-[#00000014] cpk:disabled:text-[rgb(13,13,13)]",
|
|
144
|
+
"cpk:dark:disabled:bg-[#454545] cpk:dark:disabled:text-white "
|
|
144
145
|
],
|
|
145
146
|
chatInputToolbarSecondary: [
|
|
146
|
-
"cursor-pointer",
|
|
147
|
-
"bg-transparent text-[#444444]",
|
|
148
|
-
"dark:text-white dark:border-[#404040]",
|
|
149
|
-
"rounded-full",
|
|
150
|
-
"transition-colors",
|
|
151
|
-
"focus:outline-none",
|
|
152
|
-
"hover:bg-[#f8f8f8] hover:text-[#333333]",
|
|
153
|
-
"dark:hover:bg-[#404040] dark:hover:text-[#FFFFFF]",
|
|
154
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
155
|
-
"disabled:hover:bg-transparent disabled:hover:text-[#444444]",
|
|
156
|
-
"dark:disabled:hover:bg-transparent dark:disabled:hover:text-[#CCCCCC]"
|
|
147
|
+
"cpk:cursor-pointer",
|
|
148
|
+
"cpk:bg-transparent cpk:text-[#444444]",
|
|
149
|
+
"cpk:dark:text-white cpk:dark:border-[#404040]",
|
|
150
|
+
"cpk:rounded-full",
|
|
151
|
+
"cpk:transition-colors",
|
|
152
|
+
"cpk:focus:outline-none",
|
|
153
|
+
"cpk:hover:bg-[#f8f8f8] cpk:hover:text-[#333333]",
|
|
154
|
+
"cpk:dark:hover:bg-[#404040] cpk:dark:hover:text-[#FFFFFF]",
|
|
155
|
+
"cpk:disabled:cursor-not-allowed cpk:disabled:opacity-50",
|
|
156
|
+
"cpk:disabled:hover:bg-transparent cpk:disabled:hover:text-[#444444]",
|
|
157
|
+
"cpk:dark:disabled:hover:bg-transparent cpk:dark:disabled:hover:text-[#CCCCCC]"
|
|
157
158
|
]
|
|
158
159
|
},
|
|
159
160
|
size: {
|
|
160
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
161
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
162
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
163
|
-
icon: "size-9",
|
|
164
|
-
chatInputToolbarIcon: ["h-9 w-9 rounded-full"],
|
|
161
|
+
default: "cpk:h-9 cpk:px-4 cpk:py-2 cpk:has-[>svg]:px-3",
|
|
162
|
+
sm: "cpk:h-8 cpk:rounded-md cpk:gap-1.5 cpk:px-3 cpk:has-[>svg]:px-2.5",
|
|
163
|
+
lg: "cpk:h-10 cpk:rounded-md cpk:px-6 cpk:has-[>svg]:px-4",
|
|
164
|
+
icon: "cpk:size-9",
|
|
165
|
+
chatInputToolbarIcon: ["cpk:h-9 cpk:w-9 cpk:rounded-full"],
|
|
165
166
|
chatInputToolbarIconLabel: [
|
|
166
|
-
"h-9 px-3 rounded-full",
|
|
167
|
-
"gap-2",
|
|
168
|
-
"font-normal"
|
|
167
|
+
"cpk:h-9 cpk:px-3 cpk:rounded-full",
|
|
168
|
+
"cpk:gap-2",
|
|
169
|
+
"cpk:font-normal"
|
|
169
170
|
]
|
|
170
171
|
}
|
|
171
172
|
},
|
|
@@ -209,11 +210,12 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
209
210
|
}
|
|
210
211
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
211
212
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_tooltip.Content, {
|
|
213
|
+
"data-copilotkit": true,
|
|
212
214
|
"data-slot": "tooltip-content",
|
|
213
215
|
sideOffset,
|
|
214
|
-
className: cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", className),
|
|
216
|
+
className: cn("cpk:bg-primary cpk:text-primary-foreground cpk:animate-in cpk:fade-in-0 cpk:zoom-in-95 cpk:data-[state=closed]:animate-out cpk:data-[state=closed]:fade-out-0 cpk:data-[state=closed]:zoom-out-95 cpk:data-[side=bottom]:slide-in-from-top-2 cpk:data-[side=left]:slide-in-from-right-2 cpk:data-[side=right]:slide-in-from-left-2 cpk:data-[side=top]:slide-in-from-bottom-2 cpk:z-50 cpk:w-fit cpk:origin-(--radix-tooltip-content-transform-origin) cpk:rounded-md cpk:px-3 cpk:py-1.5 cpk:text-xs cpk:text-balance", className),
|
|
215
217
|
...props,
|
|
216
|
-
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
|
|
218
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Arrow, { className: "cpk:bg-primary cpk:fill-primary cpk:z-50 cpk:size-2.5 cpk:translate-y-[calc(-50%_-_2px)] cpk:rotate-45 cpk:rounded-[2px]" })]
|
|
217
219
|
}) });
|
|
218
220
|
}
|
|
219
221
|
|
|
@@ -233,9 +235,10 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
233
235
|
}
|
|
234
236
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
235
237
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
|
|
238
|
+
"data-copilotkit": true,
|
|
236
239
|
"data-slot": "dropdown-menu-content",
|
|
237
240
|
sideOffset,
|
|
238
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className),
|
|
241
|
+
className: cn("cpk:bg-popover cpk:text-popover-foreground cpk:data-[state=open]:animate-in cpk:data-[state=closed]:animate-out cpk:data-[state=closed]:fade-out-0 cpk:data-[state=open]:fade-in-0 cpk:data-[state=closed]:zoom-out-95 cpk:data-[state=open]:zoom-in-95 cpk:data-[side=bottom]:slide-in-from-top-2 cpk:data-[side=left]:slide-in-from-right-2 cpk:data-[side=right]:slide-in-from-left-2 cpk:data-[side=top]:slide-in-from-bottom-2 cpk:z-50 cpk:max-h-(--radix-dropdown-menu-content-available-height) cpk:min-w-[8rem] cpk:origin-(--radix-dropdown-menu-content-transform-origin) cpk:overflow-x-hidden cpk:overflow-y-auto cpk:rounded-md cpk:border cpk:p-1 cpk:shadow-md", className),
|
|
239
242
|
...props
|
|
240
243
|
}) });
|
|
241
244
|
}
|
|
@@ -244,14 +247,14 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
244
247
|
"data-slot": "dropdown-menu-item",
|
|
245
248
|
"data-inset": inset,
|
|
246
249
|
"data-variant": variant,
|
|
247
|
-
className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
250
|
+
className: cn("cpk:focus:bg-accent cpk:focus:text-accent-foreground cpk:data-[variant=destructive]:text-destructive cpk:data-[variant=destructive]:focus:bg-destructive/10 cpk:dark:data-[variant=destructive]:focus:bg-destructive/20 cpk:data-[variant=destructive]:focus:text-destructive cpk:data-[variant=destructive]:*:[svg]:!text-destructive cpk:[&_svg:not([class*='text-'])]:text-muted-foreground cpk:relative cpk:flex cpk:cursor-default cpk:items-center cpk:gap-2 cpk:rounded-sm cpk:px-2 cpk:py-1.5 cpk:text-sm cpk:outline-hidden cpk:select-none cpk:data-[disabled]:pointer-events-none cpk:data-[disabled]:opacity-50 cpk:data-[inset]:pl-8 cpk:[&_svg]:pointer-events-none cpk:[&_svg]:shrink-0 cpk:[&_svg:not([class*='size-'])]:size-4", className),
|
|
248
251
|
...props
|
|
249
252
|
});
|
|
250
253
|
}
|
|
251
254
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
252
255
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
|
|
253
256
|
"data-slot": "dropdown-menu-separator",
|
|
254
|
-
className: cn("bg-border
|
|
257
|
+
className: cn("cpk:bg-border cpk:-mx-1 cpk:my-1 cpk:h-px", className),
|
|
255
258
|
...props
|
|
256
259
|
});
|
|
257
260
|
}
|
|
@@ -265,15 +268,15 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
265
268
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
|
|
266
269
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
267
270
|
"data-inset": inset,
|
|
268
|
-
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className),
|
|
271
|
+
className: cn("cpk:focus:bg-accent cpk:focus:text-accent-foreground cpk:data-[state=open]:bg-accent cpk:data-[state=open]:text-accent-foreground cpk:flex cpk:cursor-default cpk:items-center cpk:rounded-sm cpk:px-2 cpk:py-1.5 cpk:text-sm cpk:outline-hidden cpk:select-none cpk:data-[inset]:pl-8", className),
|
|
269
272
|
...props,
|
|
270
|
-
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
273
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { className: "cpk:ml-auto cpk:size-4" })]
|
|
271
274
|
});
|
|
272
275
|
}
|
|
273
276
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
274
277
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
|
|
275
278
|
"data-slot": "dropdown-menu-sub-content",
|
|
276
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className),
|
|
279
|
+
className: cn("cpk:bg-popover cpk:text-popover-foreground cpk:data-[state=open]:animate-in cpk:data-[state=closed]:animate-out cpk:data-[state=closed]:fade-out-0 cpk:data-[state=open]:fade-in-0 cpk:data-[state=closed]:zoom-out-95 cpk:data-[state=open]:zoom-in-95 cpk:data-[side=bottom]:slide-in-from-top-2 cpk:data-[side=left]:slide-in-from-right-2 cpk:data-[side=right]:slide-in-from-left-2 cpk:data-[side=top]:slide-in-from-bottom-2 cpk:z-50 cpk:min-w-[8rem] cpk:origin-(--radix-dropdown-menu-content-transform-origin) cpk:overflow-hidden cpk:rounded-md cpk:border cpk:p-1 cpk:shadow-lg", className),
|
|
277
280
|
...props
|
|
278
281
|
});
|
|
279
282
|
}
|
|
@@ -470,11 +473,11 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
470
473
|
cleanup
|
|
471
474
|
]);
|
|
472
475
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
473
|
-
className: (0, tailwind_merge.twMerge)("w-full py-3 px-5", className),
|
|
476
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:py-3 cpk:px-5", className),
|
|
474
477
|
...divProps,
|
|
475
478
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("canvas", {
|
|
476
479
|
ref: canvasRef,
|
|
477
|
-
className: "block w-full h-[26px]"
|
|
480
|
+
className: "cpk:block cpk:w-full cpk:h-[26px]"
|
|
478
481
|
})
|
|
479
482
|
});
|
|
480
483
|
});
|
|
@@ -762,7 +765,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
762
765
|
onChange: handleChange,
|
|
763
766
|
onKeyDown: handleKeyDown,
|
|
764
767
|
autoFocus,
|
|
765
|
-
className: (0, tailwind_merge.twMerge)("w-full py-3", isExpanded ? "px-5" : "pr-5")
|
|
768
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:py-3", isExpanded ? "cpk:px-5" : "cpk:pr-5")
|
|
766
769
|
});
|
|
767
770
|
const isProcessing = mode !== "transcribe" && isRunning;
|
|
768
771
|
const canSend = resolvedValue.trim().length > 0 && !!onSubmitMessage;
|
|
@@ -778,7 +781,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
778
781
|
const BoundSendButton = renderSlot(sendButton, CopilotChatInput.SendButton, {
|
|
779
782
|
onClick: handleSendButtonClick,
|
|
780
783
|
disabled: isProcessing ? !canStop : !canSend,
|
|
781
|
-
children: isProcessing && canStop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Square, { className: "size-[18px] fill-current" }) : void 0
|
|
784
|
+
children: isProcessing && canStop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Square, { className: "cpk:size-[18px] cpk:fill-current" }) : void 0
|
|
782
785
|
});
|
|
783
786
|
const BoundStartTranscribeButton = renderSlot(startTranscribeButton, CopilotChatInput.StartTranscribeButton, { onClick: onStartTranscribe });
|
|
784
787
|
const BoundCancelTranscribeButton = renderSlot(cancelTranscribeButton, CopilotChatInput.CancelTranscribeButton, { onClick: onCancelTranscribe });
|
|
@@ -800,29 +803,36 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
800
803
|
});
|
|
801
804
|
const BoundDisclaimer = renderSlot(disclaimer, CopilotChatInput.Disclaimer, {});
|
|
802
805
|
const shouldShowDisclaimer = showDisclaimer !== null && showDisclaimer !== void 0 ? showDisclaimer : positioning === "absolute";
|
|
803
|
-
if (children)
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
806
|
+
if (children) {
|
|
807
|
+
const childProps = {
|
|
808
|
+
textArea: BoundTextArea,
|
|
809
|
+
audioRecorder: BoundAudioRecorder,
|
|
810
|
+
sendButton: BoundSendButton,
|
|
811
|
+
startTranscribeButton: BoundStartTranscribeButton,
|
|
812
|
+
cancelTranscribeButton: BoundCancelTranscribeButton,
|
|
813
|
+
finishTranscribeButton: BoundFinishTranscribeButton,
|
|
814
|
+
addMenuButton: BoundAddMenuButton,
|
|
815
|
+
disclaimer: BoundDisclaimer,
|
|
816
|
+
onSubmitMessage,
|
|
817
|
+
onStop,
|
|
818
|
+
isRunning,
|
|
819
|
+
onStartTranscribe,
|
|
820
|
+
onCancelTranscribe,
|
|
821
|
+
onFinishTranscribe,
|
|
822
|
+
onAddFile,
|
|
823
|
+
mode,
|
|
824
|
+
toolsMenu,
|
|
825
|
+
autoFocus,
|
|
826
|
+
positioning,
|
|
827
|
+
keyboardHeight,
|
|
828
|
+
showDisclaimer: shouldShowDisclaimer
|
|
829
|
+
};
|
|
830
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
831
|
+
"data-copilotkit": true,
|
|
832
|
+
style: { display: "contents" },
|
|
833
|
+
children: children(childProps)
|
|
834
|
+
});
|
|
835
|
+
}
|
|
826
836
|
const handleContainerClick = (e) => {
|
|
827
837
|
const target = e.target;
|
|
828
838
|
if (target.tagName !== "BUTTON" && !target.closest("button") && inputRef.current && mode === "input") inputRef.current.focus();
|
|
@@ -984,10 +994,10 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
984
994
|
role: "listbox",
|
|
985
995
|
"aria-label": "Slash commands",
|
|
986
996
|
ref: slashMenuRef,
|
|
987
|
-
className: "absolute bottom-full left-0 right-0 z-30 mb-2 max-h-64 overflow-y-auto rounded-lg border border-border bg-white shadow-lg dark:border-[#3a3a3a] dark:bg-[#1f1f1f]",
|
|
997
|
+
className: "cpk:absolute cpk:bottom-full cpk:left-0 cpk:right-0 cpk:z-30 cpk:mb-2 cpk:max-h-64 cpk:overflow-y-auto cpk:rounded-lg cpk:border cpk:border-border cpk:bg-white cpk:shadow-lg cpk:dark:border-[#3a3a3a] cpk:dark:bg-[#1f1f1f]",
|
|
988
998
|
style: { maxHeight: `${SLASH_MENU_MAX_VISIBLE_ITEMS * SLASH_MENU_ITEM_HEIGHT_PX}px` },
|
|
989
999
|
children: filteredCommands.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
990
|
-
className: "px-3 py-2 text-sm text-muted-foreground",
|
|
1000
|
+
className: "cpk:px-3 cpk:py-2 cpk:text-sm cpk:text-muted-foreground",
|
|
991
1001
|
children: "No commands found"
|
|
992
1002
|
}) : filteredCommands.map((item, index) => {
|
|
993
1003
|
const isActive = index === slashHighlightIndex;
|
|
@@ -997,7 +1007,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
997
1007
|
"aria-selected": isActive,
|
|
998
1008
|
"data-active": isActive ? "true" : void 0,
|
|
999
1009
|
"data-slash-index": index,
|
|
1000
|
-
className: (0, tailwind_merge.twMerge)("w-full px-3 py-2 text-left text-sm transition-colors", "hover:bg-muted dark:hover:bg-[#2f2f2f]", isActive ? "bg-muted dark:bg-[#2f2f2f]" : "bg-transparent"),
|
|
1010
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:px-3 cpk:py-2 cpk:text-left cpk:text-sm cpk:transition-colors", "cpk:hover:bg-muted cpk:dark:hover:bg-[#2f2f2f]", isActive ? "cpk:bg-muted cpk:dark:bg-[#2f2f2f]" : "cpk:bg-transparent"),
|
|
1001
1011
|
onMouseEnter: () => setSlashHighlightIndex(index),
|
|
1002
1012
|
onMouseDown: (event) => {
|
|
1003
1013
|
event.preventDefault();
|
|
@@ -1008,58 +1018,59 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1008
1018
|
})
|
|
1009
1019
|
}) : null;
|
|
1010
1020
|
const inputPill = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1011
|
-
className: (0, tailwind_merge.twMerge)("flex w-full flex-col items-center justify-center", "cursor-text", "overflow-visible bg-clip-padding contain-inline-size", "bg-white dark:bg-[#303030]", "shadow-[0_4px_4px_0_#0000000a,0_0_1px_0_#0000009e] rounded-[28px]"),
|
|
1021
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:w-full cpk:flex-col cpk:items-center cpk:justify-center", "cpk:cursor-text", "cpk:overflow-visible cpk:bg-clip-padding cpk:contain-inline-size", "cpk:bg-white cpk:dark:bg-[#303030]", "cpk:shadow-[0_4px_4px_0_#0000000a,0_0_1px_0_#0000009e] cpk:rounded-[28px]"),
|
|
1012
1022
|
onClick: handleContainerClick,
|
|
1013
1023
|
"data-layout": isExpanded ? "expanded" : "compact",
|
|
1014
1024
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1015
1025
|
ref: gridRef,
|
|
1016
|
-
className: (0, tailwind_merge.twMerge)("grid w-full gap-x-3 gap-y-3 px-3 py-2", isExpanded ? "grid-cols-[auto_minmax(0,1fr)_auto] grid-rows-[auto_auto]" : "grid-cols-[auto_minmax(0,1fr)_auto] items-center"),
|
|
1026
|
+
className: (0, tailwind_merge.twMerge)("cpk:grid cpk:w-full cpk:gap-x-3 cpk:gap-y-3 cpk:px-3 cpk:py-2", isExpanded ? "cpk:grid-cols-[auto_minmax(0,1fr)_auto] cpk:grid-rows-[auto_auto]" : "cpk:grid-cols-[auto_minmax(0,1fr)_auto] cpk:items-center"),
|
|
1017
1027
|
"data-layout": isExpanded ? "expanded" : "compact",
|
|
1018
1028
|
children: [
|
|
1019
1029
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1020
1030
|
ref: addButtonContainerRef,
|
|
1021
|
-
className: (0, tailwind_merge.twMerge)("flex items-center", isExpanded ? "row-start-2" : "row-start-1", "col-start-1"),
|
|
1031
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:items-center", isExpanded ? "cpk:row-start-2" : "cpk:row-start-1", "cpk:col-start-1"),
|
|
1022
1032
|
children: BoundAddMenuButton
|
|
1023
1033
|
}),
|
|
1024
1034
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1025
|
-
className: (0, tailwind_merge.twMerge)("relative flex min-w-0 flex-col min-h-[50px] justify-center", isExpanded ? "col-span-3 row-start-1" : "col-start-2 row-start-1"),
|
|
1035
|
+
className: (0, tailwind_merge.twMerge)("cpk:relative cpk:flex cpk:min-w-0 cpk:flex-col cpk:min-h-[50px] cpk:justify-center", isExpanded ? "cpk:col-span-3 cpk:row-start-1" : "cpk:col-start-2 cpk:row-start-1"),
|
|
1026
1036
|
children: mode === "transcribe" ? BoundAudioRecorder : mode === "processing" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1027
|
-
className: "flex w-full items-center justify-center py-3 px-5",
|
|
1028
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "size-[26px] animate-spin text-muted-foreground" })
|
|
1037
|
+
className: "cpk:flex cpk:w-full cpk:items-center cpk:justify-center cpk:py-3 cpk:px-5",
|
|
1038
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "cpk:size-[26px] cpk:animate-spin cpk:text-muted-foreground" })
|
|
1029
1039
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [BoundTextArea, slashMenu] })
|
|
1030
1040
|
}),
|
|
1031
1041
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1032
1042
|
ref: actionsContainerRef,
|
|
1033
|
-
className: (0, tailwind_merge.twMerge)("flex items-center justify-end gap-2", isExpanded ? "col-start-3 row-start-2" : "col-start-3 row-start-1"),
|
|
1043
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:items-center cpk:justify-end cpk:gap-2", isExpanded ? "cpk:col-start-3 cpk:row-start-2" : "cpk:col-start-3 cpk:row-start-1"),
|
|
1034
1044
|
children: mode === "transcribe" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [onCancelTranscribe && BoundCancelTranscribeButton, onFinishTranscribe && BoundFinishTranscribeButton] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [onStartTranscribe && BoundStartTranscribeButton, BoundSendButton] })
|
|
1035
1045
|
})
|
|
1036
1046
|
]
|
|
1037
1047
|
})
|
|
1038
1048
|
});
|
|
1039
1049
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1050
|
+
"data-copilotkit": true,
|
|
1040
1051
|
ref: containerRef,
|
|
1041
|
-
className: cn(positioning === "absolute" && "absolute bottom-0 left-0 right-0 z-20 pointer-events-none", className),
|
|
1052
|
+
className: cn(positioning === "absolute" && "cpk:absolute cpk:bottom-0 cpk:left-0 cpk:right-0 cpk:z-20 cpk:pointer-events-none", className),
|
|
1042
1053
|
style: {
|
|
1043
1054
|
transform: keyboardHeight > 0 ? `translateY(-${keyboardHeight}px)` : void 0,
|
|
1044
1055
|
transition: "transform 0.2s ease-out"
|
|
1045
1056
|
},
|
|
1046
1057
|
...props,
|
|
1047
1058
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1048
|
-
className: "max-w-3xl mx-auto py-0 px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-4 pointer-events-auto",
|
|
1059
|
+
className: "cpk:max-w-3xl cpk:mx-auto cpk:py-0 cpk:px-4 cpk:sm:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-4 cpk:pointer-events-auto",
|
|
1049
1060
|
children: inputPill
|
|
1050
1061
|
}), shouldShowDisclaimer && BoundDisclaimer]
|
|
1051
1062
|
});
|
|
1052
1063
|
}
|
|
1053
1064
|
(function(_CopilotChatInput) {
|
|
1054
1065
|
_CopilotChatInput.SendButton = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1055
|
-
className: "mr-[10px]",
|
|
1066
|
+
className: "cpk:mr-[10px]",
|
|
1056
1067
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
1057
1068
|
type: "button",
|
|
1058
1069
|
variant: "chatInputToolbarPrimary",
|
|
1059
1070
|
size: "chatInputToolbarIcon",
|
|
1060
1071
|
className,
|
|
1061
1072
|
...props,
|
|
1062
|
-
children: children !== null && children !== void 0 ? children : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUp, { className: "size-[18px]" })
|
|
1073
|
+
children: children !== null && children !== void 0 ? children : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowUp, { className: "cpk:size-[18px]" })
|
|
1063
1074
|
})
|
|
1064
1075
|
});
|
|
1065
1076
|
const ToolbarButton = _CopilotChatInput.ToolbarButton = ({ icon, labelKey, defaultClassName, className, ...props }) => {
|
|
@@ -1082,21 +1093,21 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1082
1093
|
})] });
|
|
1083
1094
|
};
|
|
1084
1095
|
_CopilotChatInput.StartTranscribeButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
1085
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Mic, { className: "size-[18px]" }),
|
|
1096
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Mic, { className: "cpk:size-[18px]" }),
|
|
1086
1097
|
labelKey: "chatInputToolbarStartTranscribeButtonLabel",
|
|
1087
|
-
defaultClassName: "mr-2",
|
|
1098
|
+
defaultClassName: "cpk:mr-2",
|
|
1088
1099
|
...props
|
|
1089
1100
|
});
|
|
1090
1101
|
_CopilotChatInput.CancelTranscribeButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
1091
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "size-[18px]" }),
|
|
1102
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "cpk:size-[18px]" }),
|
|
1092
1103
|
labelKey: "chatInputToolbarCancelTranscribeButtonLabel",
|
|
1093
|
-
defaultClassName: "mr-2",
|
|
1104
|
+
defaultClassName: "cpk:mr-2",
|
|
1094
1105
|
...props
|
|
1095
1106
|
});
|
|
1096
1107
|
_CopilotChatInput.FinishTranscribeButton = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
1097
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "size-[18px]" }),
|
|
1108
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }),
|
|
1098
1109
|
labelKey: "chatInputToolbarFinishTranscribeButtonLabel",
|
|
1099
|
-
defaultClassName: "mr-[10px]",
|
|
1110
|
+
defaultClassName: "cpk:mr-[10px]",
|
|
1100
1111
|
...props
|
|
1101
1112
|
});
|
|
1102
1113
|
_CopilotChatInput.AddMenuButton = ({ className, toolsMenu, onAddFile, disabled, ...props }) => {
|
|
@@ -1141,18 +1152,18 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1141
1152
|
type: "button",
|
|
1142
1153
|
variant: "chatInputToolbarSecondary",
|
|
1143
1154
|
size: "chatInputToolbarIcon",
|
|
1144
|
-
className: (0, tailwind_merge.twMerge)("ml-1", className),
|
|
1155
|
+
className: (0, tailwind_merge.twMerge)("cpk:ml-1", className),
|
|
1145
1156
|
disabled: isDisabled,
|
|
1146
1157
|
...props,
|
|
1147
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "size-[20px]" })
|
|
1158
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: "cpk:size-[20px]" })
|
|
1148
1159
|
})
|
|
1149
1160
|
})
|
|
1150
1161
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipContent, {
|
|
1151
1162
|
side: "bottom",
|
|
1152
1163
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1153
|
-
className: "flex items-center gap-1 text-xs font-medium",
|
|
1164
|
+
className: "cpk:flex cpk:items-center cpk:gap-1 cpk:text-xs cpk:font-medium",
|
|
1154
1165
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "Add files and more" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
1155
|
-
className: "rounded bg-[#4a4a4a] px-1 py-[1px] font-mono text-[11px] text-white dark:bg-[#e0e0e0] dark:text-black",
|
|
1166
|
+
className: "cpk:rounded cpk:bg-[#4a4a4a] cpk:px-1 cpk:py-[1px] cpk:font-mono cpk:text-[11px] cpk:text-white cpk:dark:bg-[#e0e0e0] cpk:dark:text-black",
|
|
1156
1167
|
children: "/"
|
|
1157
1168
|
})]
|
|
1158
1169
|
})
|
|
@@ -1191,7 +1202,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1191
1202
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
1192
1203
|
ref: internalTextareaRef,
|
|
1193
1204
|
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : labels.chatInputPlaceholder,
|
|
1194
|
-
className: (0, tailwind_merge.twMerge)("bg-transparent outline-none antialiased font-regular leading-relaxed text-[16px] placeholder:text-[#00000077] dark:placeholder:text-[#fffc]", className),
|
|
1205
|
+
className: (0, tailwind_merge.twMerge)("cpk:bg-transparent cpk:outline-none cpk:antialiased cpk:font-regular cpk:leading-relaxed cpk:text-[16px] cpk:placeholder:text-[#00000077] cpk:dark:placeholder:text-[#fffc]", className),
|
|
1195
1206
|
style: {
|
|
1196
1207
|
overflow: "auto",
|
|
1197
1208
|
resize: "none",
|
|
@@ -1207,7 +1218,7 @@ _radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu);
|
|
|
1207
1218
|
const config = useCopilotChatConfiguration();
|
|
1208
1219
|
const labels = (_config$labels5 = config === null || config === void 0 ? void 0 : config.labels) !== null && _config$labels5 !== void 0 ? _config$labels5 : CopilotChatDefaultLabels;
|
|
1209
1220
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1210
|
-
className: cn("text-center text-xs text-muted-foreground py-3 px-4 max-w-3xl mx-auto", className),
|
|
1221
|
+
className: cn("cpk:text-center cpk:text-xs cpk:text-muted-foreground cpk:py-3 cpk:px-4 cpk:max-w-3xl cpk:mx-auto", className),
|
|
1211
1222
|
...props,
|
|
1212
1223
|
children: labels.chatDisclaimerText
|
|
1213
1224
|
});
|
|
@@ -2237,21 +2248,34 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2237
2248
|
* This hook is a convenience wrapper around `useFrontendTool` that:
|
|
2238
2249
|
* - builds a model-facing tool description,
|
|
2239
2250
|
* - forwards optional Zod parameters,
|
|
2240
|
-
* - renders your component with tool call
|
|
2251
|
+
* - renders your component with tool call parameters.
|
|
2241
2252
|
*
|
|
2242
2253
|
* Use this when you want to display a typed visual component for a tool call
|
|
2243
2254
|
* without manually wiring a full frontend tool object.
|
|
2244
2255
|
*
|
|
2245
|
-
*
|
|
2256
|
+
* When `parameters` is provided, render props are inferred from the schema
|
|
2257
|
+
* via `z.infer`. When omitted, the render component may accept any props.
|
|
2258
|
+
*
|
|
2259
|
+
* @typeParam TSchema - Zod schema describing tool parameters, or `undefined` when no schema is given.
|
|
2246
2260
|
* @param config - Tool registration config.
|
|
2247
2261
|
* @param deps - Optional dependencies to refresh registration (same semantics as `useEffect`).
|
|
2248
2262
|
*
|
|
2249
2263
|
* @example
|
|
2250
2264
|
* ```tsx
|
|
2265
|
+
* // Without parameters — render accepts any props
|
|
2266
|
+
* useComponent({
|
|
2267
|
+
* name: "showGreeting",
|
|
2268
|
+
* render: ({ message }: { message: string }) => <div>{message}</div>,
|
|
2269
|
+
* });
|
|
2270
|
+
* ```
|
|
2271
|
+
*
|
|
2272
|
+
* @example
|
|
2273
|
+
* ```tsx
|
|
2274
|
+
* // With parameters — render props inferred from schema
|
|
2251
2275
|
* useComponent({
|
|
2252
2276
|
* name: "showWeatherCard",
|
|
2253
2277
|
* parameters: z.object({ city: z.string() }),
|
|
2254
|
-
*
|
|
2278
|
+
* render: ({ city }) => <div>{city}</div>,
|
|
2255
2279
|
* });
|
|
2256
2280
|
* ```
|
|
2257
2281
|
*
|
|
@@ -2261,7 +2285,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2261
2285
|
* {
|
|
2262
2286
|
* name: "renderProfile",
|
|
2263
2287
|
* parameters: z.object({ userId: z.string() }),
|
|
2264
|
-
*
|
|
2288
|
+
* render: ProfileCard,
|
|
2265
2289
|
* agentId: "support-agent",
|
|
2266
2290
|
* },
|
|
2267
2291
|
* [selectedAgentId],
|
|
@@ -2276,7 +2300,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2276
2300
|
description: fullDescription,
|
|
2277
2301
|
parameters: config.parameters,
|
|
2278
2302
|
render: ({ args }) => {
|
|
2279
|
-
const Component = config.
|
|
2303
|
+
const Component = config.render;
|
|
2280
2304
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, { ...args });
|
|
2281
2305
|
},
|
|
2282
2306
|
agentId: config.agentId
|
|
@@ -2306,7 +2330,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2306
2330
|
* - keeps renderer entries on cleanup so historical chat tool calls can still render,
|
|
2307
2331
|
* - refreshes registration when `deps` change.
|
|
2308
2332
|
*
|
|
2309
|
-
* @typeParam S - Zod schema type describing tool call
|
|
2333
|
+
* @typeParam S - Zod schema type describing tool call parameters.
|
|
2310
2334
|
* @param config - Renderer config for wildcard or named tools.
|
|
2311
2335
|
* @param deps - Optional dependencies to refresh registration.
|
|
2312
2336
|
*
|
|
@@ -2315,9 +2339,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2315
2339
|
* useRenderTool(
|
|
2316
2340
|
* {
|
|
2317
2341
|
* name: "searchDocs",
|
|
2318
|
-
*
|
|
2319
|
-
* render: ({ status,
|
|
2320
|
-
* if (status === "executing") return <div>Searching {
|
|
2342
|
+
* parameters: z.object({ query: z.string() }),
|
|
2343
|
+
* render: ({ status, parameters, result }) => {
|
|
2344
|
+
* if (status === "executing") return <div>Searching {parameters.query}</div>;
|
|
2321
2345
|
* if (status === "complete") return <div>{result}</div>;
|
|
2322
2346
|
* return <div>Preparing...</div>;
|
|
2323
2347
|
* },
|
|
@@ -2331,7 +2355,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2331
2355
|
* useRenderTool(
|
|
2332
2356
|
* {
|
|
2333
2357
|
* name: "summarize",
|
|
2334
|
-
*
|
|
2358
|
+
* parameters: z.object({ text: z.string() }),
|
|
2335
2359
|
* agentId: "research-agent",
|
|
2336
2360
|
* render: ({ name, status }) => <div>{name}: {status}</div>,
|
|
2337
2361
|
* },
|
|
@@ -2343,14 +2367,20 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2343
2367
|
const { copilotkit } = useCopilotKit();
|
|
2344
2368
|
const extraDeps = deps !== null && deps !== void 0 ? deps : EMPTY_DEPS;
|
|
2345
2369
|
(0, react.useEffect)(() => {
|
|
2346
|
-
const renderer = config.name === "*" && !config.
|
|
2370
|
+
const renderer = config.name === "*" && !config.parameters ? defineToolCallRenderer({
|
|
2347
2371
|
name: "*",
|
|
2348
|
-
render: config.render
|
|
2372
|
+
render: (props) => config.render({
|
|
2373
|
+
...props,
|
|
2374
|
+
parameters: props.args
|
|
2375
|
+
}),
|
|
2349
2376
|
...config.agentId ? { agentId: config.agentId } : {}
|
|
2350
2377
|
}) : defineToolCallRenderer({
|
|
2351
2378
|
name: config.name,
|
|
2352
|
-
args: config.
|
|
2353
|
-
render: config.render
|
|
2379
|
+
args: config.parameters,
|
|
2380
|
+
render: (props) => config.render({
|
|
2381
|
+
...props,
|
|
2382
|
+
parameters: props.args
|
|
2383
|
+
}),
|
|
2354
2384
|
...config.agentId ? { agentId: config.agentId } : {}
|
|
2355
2385
|
});
|
|
2356
2386
|
const keyOf = (rc) => {
|
|
@@ -2415,7 +2445,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2415
2445
|
render: (_config$render = config === null || config === void 0 ? void 0 : config.render) !== null && _config$render !== void 0 ? _config$render : DefaultToolCallRenderer
|
|
2416
2446
|
}, deps);
|
|
2417
2447
|
}
|
|
2418
|
-
function DefaultToolCallRenderer({ name,
|
|
2448
|
+
function DefaultToolCallRenderer({ name, parameters, status, result }) {
|
|
2419
2449
|
const [isExpanded, setIsExpanded] = (0, react.useState)(false);
|
|
2420
2450
|
const statusString = String(status);
|
|
2421
2451
|
const isActive = statusString === "inProgress" || statusString === "executing";
|
|
@@ -2531,7 +2561,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2531
2561
|
whiteSpace: "pre-wrap",
|
|
2532
2562
|
wordBreak: "break-word"
|
|
2533
2563
|
},
|
|
2534
|
-
children: JSON.stringify(
|
|
2564
|
+
children: JSON.stringify(parameters !== null && parameters !== void 0 ? parameters : {}, null, 2)
|
|
2535
2565
|
})] }), result !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2536
2566
|
style: {
|
|
2537
2567
|
fontSize: "10px",
|
|
@@ -2957,7 +2987,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2957
2987
|
const boundReadAloudButton = renderSlot(readAloudButton, CopilotChatAssistantMessage.ReadAloudButton, { onClick: onReadAloud });
|
|
2958
2988
|
const boundRegenerateButton = renderSlot(regenerateButton, CopilotChatAssistantMessage.RegenerateButton, { onClick: onRegenerate });
|
|
2959
2989
|
const boundToolbar = renderSlot(toolbar, CopilotChatAssistantMessage.Toolbar, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2960
|
-
className: "flex items-center gap-1",
|
|
2990
|
+
className: "cpk:flex cpk:items-center cpk:gap-1",
|
|
2961
2991
|
children: [
|
|
2962
2992
|
boundCopyButton,
|
|
2963
2993
|
(onThumbsUp || thumbsUpButton) && boundThumbsUpButton,
|
|
@@ -2974,31 +3004,39 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
2974
3004
|
const hasContent = !!(message.content && message.content.trim().length > 0);
|
|
2975
3005
|
const isLatestAssistantMessage = message.role === "assistant" && (messages === null || messages === void 0 || (_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.id) === message.id;
|
|
2976
3006
|
const shouldShowToolbar = toolbarVisible && hasContent && !(isRunning && isLatestAssistantMessage);
|
|
2977
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
3007
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3008
|
+
"data-copilotkit": true,
|
|
3009
|
+
style: { display: "contents" },
|
|
3010
|
+
children: children({
|
|
3011
|
+
markdownRenderer: boundMarkdownRenderer,
|
|
3012
|
+
toolbar: boundToolbar,
|
|
3013
|
+
toolCallsView: boundToolCallsView,
|
|
3014
|
+
copyButton: boundCopyButton,
|
|
3015
|
+
thumbsUpButton: boundThumbsUpButton,
|
|
3016
|
+
thumbsDownButton: boundThumbsDownButton,
|
|
3017
|
+
readAloudButton: boundReadAloudButton,
|
|
3018
|
+
regenerateButton: boundRegenerateButton,
|
|
3019
|
+
message,
|
|
3020
|
+
messages,
|
|
3021
|
+
isRunning,
|
|
3022
|
+
onThumbsUp,
|
|
3023
|
+
onThumbsDown,
|
|
3024
|
+
onReadAloud,
|
|
3025
|
+
onRegenerate,
|
|
3026
|
+
additionalToolbarItems,
|
|
3027
|
+
toolbarVisible: shouldShowToolbar
|
|
3028
|
+
})
|
|
3029
|
+
});
|
|
2996
3030
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2997
|
-
|
|
3031
|
+
"data-copilotkit": true,
|
|
3032
|
+
className: (0, tailwind_merge.twMerge)(className),
|
|
2998
3033
|
...props,
|
|
2999
3034
|
"data-message-id": message.id,
|
|
3000
3035
|
children: [
|
|
3001
|
-
|
|
3036
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3037
|
+
className: "cpk:prose cpk:max-w-full cpk:break-words cpk:dark:prose-invert",
|
|
3038
|
+
children: boundMarkdownRenderer
|
|
3039
|
+
}),
|
|
3002
3040
|
boundToolCallsView,
|
|
3003
3041
|
shouldShowToolbar && boundToolbar
|
|
3004
3042
|
]
|
|
@@ -3011,7 +3049,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3011
3049
|
children: content !== null && content !== void 0 ? content : ""
|
|
3012
3050
|
});
|
|
3013
3051
|
_CopilotChatAssistantMessage.Toolbar = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3014
|
-
className: (0, tailwind_merge.twMerge)("w-full bg-transparent flex items-center
|
|
3052
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:-ml-[5px] cpk:-mt-[0px]", className),
|
|
3015
3053
|
...props
|
|
3016
3054
|
});
|
|
3017
3055
|
const ToolbarButton = _CopilotChatAssistantMessage.ToolbarButton = ({ title, children, ...props }) => {
|
|
@@ -3044,7 +3082,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3044
3082
|
onClick: handleClick,
|
|
3045
3083
|
className,
|
|
3046
3084
|
...props,
|
|
3047
|
-
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "size-[18px]" })
|
|
3085
|
+
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk:size-[18px]" })
|
|
3048
3086
|
});
|
|
3049
3087
|
};
|
|
3050
3088
|
_CopilotChatAssistantMessage.ThumbsUpButton = ({ title, ...props }) => {
|
|
@@ -3054,7 +3092,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3054
3092
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
3055
3093
|
title: title || labels.assistantMessageToolbarThumbsUpLabel,
|
|
3056
3094
|
...props,
|
|
3057
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ThumbsUp, { className: "size-[18px]" })
|
|
3095
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ThumbsUp, { className: "cpk:size-[18px]" })
|
|
3058
3096
|
});
|
|
3059
3097
|
};
|
|
3060
3098
|
_CopilotChatAssistantMessage.ThumbsDownButton = ({ title, ...props }) => {
|
|
@@ -3064,7 +3102,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3064
3102
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
3065
3103
|
title: title || labels.assistantMessageToolbarThumbsDownLabel,
|
|
3066
3104
|
...props,
|
|
3067
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ThumbsDown, { className: "size-[18px]" })
|
|
3105
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ThumbsDown, { className: "cpk:size-[18px]" })
|
|
3068
3106
|
});
|
|
3069
3107
|
};
|
|
3070
3108
|
_CopilotChatAssistantMessage.ReadAloudButton = ({ title, ...props }) => {
|
|
@@ -3074,7 +3112,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3074
3112
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
3075
3113
|
title: title || labels.assistantMessageToolbarReadAloudLabel,
|
|
3076
3114
|
...props,
|
|
3077
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Volume2, { className: "size-[20px]" })
|
|
3115
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Volume2, { className: "cpk:size-[20px]" })
|
|
3078
3116
|
});
|
|
3079
3117
|
};
|
|
3080
3118
|
_CopilotChatAssistantMessage.RegenerateButton = ({ title, ...props }) => {
|
|
@@ -3084,7 +3122,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3084
3122
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButton, {
|
|
3085
3123
|
title: title || labels.assistantMessageToolbarRegenerateLabel,
|
|
3086
3124
|
...props,
|
|
3087
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.RefreshCw, { className: "size-[18px]" })
|
|
3125
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.RefreshCw, { className: "cpk:size-[18px]" })
|
|
3088
3126
|
});
|
|
3089
3127
|
};
|
|
3090
3128
|
})(CopilotChatAssistantMessage || (CopilotChatAssistantMessage = {}));
|
|
@@ -3126,7 +3164,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3126
3164
|
});
|
|
3127
3165
|
const showBranchNavigation = numberOfBranches && numberOfBranches > 1 && onSwitchToBranch;
|
|
3128
3166
|
const BoundToolbar = renderSlot(toolbar, CopilotChatUserMessage.Toolbar, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3129
|
-
className: "flex items-center gap-1 justify-end",
|
|
3167
|
+
className: "cpk:flex cpk:items-center cpk:gap-1 cpk:justify-end",
|
|
3130
3168
|
children: [
|
|
3131
3169
|
additionalToolbarItems,
|
|
3132
3170
|
BoundCopyButton,
|
|
@@ -3134,19 +3172,24 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3134
3172
|
showBranchNavigation && BoundBranchNavigation
|
|
3135
3173
|
]
|
|
3136
3174
|
}) });
|
|
3137
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3175
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3176
|
+
"data-copilotkit": true,
|
|
3177
|
+
style: { display: "contents" },
|
|
3178
|
+
children: children({
|
|
3179
|
+
messageRenderer: BoundMessageRenderer,
|
|
3180
|
+
toolbar: BoundToolbar,
|
|
3181
|
+
copyButton: BoundCopyButton,
|
|
3182
|
+
editButton: BoundEditButton,
|
|
3183
|
+
branchNavigation: BoundBranchNavigation,
|
|
3184
|
+
message,
|
|
3185
|
+
branchIndex,
|
|
3186
|
+
numberOfBranches,
|
|
3187
|
+
additionalToolbarItems
|
|
3188
|
+
})
|
|
3189
|
+
});
|
|
3148
3190
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3149
|
-
|
|
3191
|
+
"data-copilotkit": true,
|
|
3192
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:flex-col cpk:items-end cpk:group cpk:pt-10", className),
|
|
3150
3193
|
"data-message-id": message.id,
|
|
3151
3194
|
...props,
|
|
3152
3195
|
children: [BoundMessageRenderer, BoundToolbar]
|
|
@@ -3154,16 +3197,16 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3154
3197
|
}
|
|
3155
3198
|
(function(_CopilotChatUserMessage) {
|
|
3156
3199
|
_CopilotChatUserMessage.Container = ({ children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3157
|
-
className: (0, tailwind_merge.twMerge)("flex flex-col items-end group", className),
|
|
3200
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:flex-col cpk:items-end cpk:group", className),
|
|
3158
3201
|
...props,
|
|
3159
3202
|
children
|
|
3160
3203
|
});
|
|
3161
3204
|
_CopilotChatUserMessage.MessageRenderer = ({ content, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3162
|
-
className: (0, tailwind_merge.twMerge)("prose dark:prose-invert bg-muted relative max-w-[80%] rounded-[18px] px-4 py-1.5 data-[multiline]:py-3 inline-block whitespace-pre-wrap", className),
|
|
3205
|
+
className: (0, tailwind_merge.twMerge)("cpk:prose cpk:dark:prose-invert cpk:bg-muted cpk:relative cpk:max-w-[80%] cpk:rounded-[18px] cpk:px-4 cpk:py-1.5 cpk:data-[multiline]:py-3 cpk:inline-block cpk:whitespace-pre-wrap", className),
|
|
3163
3206
|
children: content
|
|
3164
3207
|
});
|
|
3165
3208
|
_CopilotChatUserMessage.Toolbar = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3166
|
-
className: (0, tailwind_merge.twMerge)("w-full bg-transparent flex items-center justify-end
|
|
3209
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-full cpk:bg-transparent cpk:flex cpk:items-center cpk:justify-end cpk:-mr-[5px] cpk:mt-[4px] cpk:invisible cpk:group-hover:visible", className),
|
|
3167
3210
|
...props
|
|
3168
3211
|
});
|
|
3169
3212
|
const ToolbarButton = _CopilotChatUserMessage.ToolbarButton = ({ title, children, className, ...props }) => {
|
|
@@ -3197,7 +3240,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3197
3240
|
onClick: handleClick,
|
|
3198
3241
|
className,
|
|
3199
3242
|
...props,
|
|
3200
|
-
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "size-[18px]" })
|
|
3243
|
+
children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "cpk:size-[18px]" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Copy, { className: "cpk:size-[18px]" })
|
|
3201
3244
|
});
|
|
3202
3245
|
};
|
|
3203
3246
|
_CopilotChatUserMessage.EditButton = ({ className, title, ...props }) => {
|
|
@@ -3208,7 +3251,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3208
3251
|
title: title || labels.userMessageToolbarEditMessageLabel,
|
|
3209
3252
|
className,
|
|
3210
3253
|
...props,
|
|
3211
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Edit, { className: "size-[18px]" })
|
|
3254
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Edit, { className: "cpk:size-[18px]" })
|
|
3212
3255
|
});
|
|
3213
3256
|
};
|
|
3214
3257
|
_CopilotChatUserMessage.BranchNavigation = ({ className, currentBranch = 0, numberOfBranches = 1, onSwitchToBranch, message, ...props }) => {
|
|
@@ -3216,7 +3259,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3216
3259
|
const canGoPrev = currentBranch > 0;
|
|
3217
3260
|
const canGoNext = currentBranch < numberOfBranches - 1;
|
|
3218
3261
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3219
|
-
className: (0, tailwind_merge.twMerge)("flex items-center gap-1", className),
|
|
3262
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:items-center cpk:gap-1", className),
|
|
3220
3263
|
...props,
|
|
3221
3264
|
children: [
|
|
3222
3265
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
@@ -3228,11 +3271,11 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3228
3271
|
message
|
|
3229
3272
|
}),
|
|
3230
3273
|
disabled: !canGoPrev,
|
|
3231
|
-
className: "h-6 w-6 p-0",
|
|
3232
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "size-[20px]" })
|
|
3274
|
+
className: "cpk:h-6 cpk:w-6 cpk:p-0",
|
|
3275
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeft, { className: "cpk:size-[20px]" })
|
|
3233
3276
|
}),
|
|
3234
3277
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3235
|
-
className: "text-sm text-muted-foreground px-0 font-medium",
|
|
3278
|
+
className: "cpk:text-sm cpk:text-muted-foreground cpk:px-0 cpk:font-medium",
|
|
3236
3279
|
children: [
|
|
3237
3280
|
currentBranch + 1,
|
|
3238
3281
|
"/",
|
|
@@ -3248,8 +3291,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3248
3291
|
message
|
|
3249
3292
|
}),
|
|
3250
3293
|
disabled: !canGoNext,
|
|
3251
|
-
className: "h-6 w-6 p-0",
|
|
3252
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "size-[20px]" })
|
|
3294
|
+
className: "cpk:h-6 cpk:w-6 cpk:p-0",
|
|
3295
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: "cpk:size-[20px]" })
|
|
3253
3296
|
})
|
|
3254
3297
|
]
|
|
3255
3298
|
});
|
|
@@ -3318,16 +3361,20 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3318
3361
|
isOpen,
|
|
3319
3362
|
children: boundContent
|
|
3320
3363
|
});
|
|
3321
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3364
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3365
|
+
"data-copilotkit": true,
|
|
3366
|
+
style: { display: "contents" },
|
|
3367
|
+
children: children({
|
|
3368
|
+
header: boundHeader,
|
|
3369
|
+
contentView: boundContent,
|
|
3370
|
+
toggle: boundToggle,
|
|
3371
|
+
message,
|
|
3372
|
+
messages,
|
|
3373
|
+
isRunning
|
|
3374
|
+
})
|
|
3375
|
+
});
|
|
3329
3376
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3330
|
-
className: (0, tailwind_merge.twMerge)("my-1", className),
|
|
3377
|
+
className: (0, tailwind_merge.twMerge)("cpk:my-1", className),
|
|
3331
3378
|
"data-message-id": message.id,
|
|
3332
3379
|
...props,
|
|
3333
3380
|
children: [boundHeader, boundToggle]
|
|
@@ -3338,44 +3385,44 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3338
3385
|
const isExpandable = !!hasContent;
|
|
3339
3386
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3340
3387
|
type: "button",
|
|
3341
|
-
className: (0, tailwind_merge.twMerge)("inline-flex items-center gap-1 py-1 text-sm text-muted-foreground transition-colors select-none", isExpandable ? "hover:text-foreground cursor-pointer" : "cursor-default", className),
|
|
3388
|
+
className: (0, tailwind_merge.twMerge)("cpk:inline-flex cpk:items-center cpk:gap-1 cpk:py-1 cpk:text-sm cpk:text-muted-foreground cpk:transition-colors cpk:select-none", isExpandable ? "cpk:hover:text-foreground cpk:cursor-pointer" : "cpk:cursor-default", className),
|
|
3342
3389
|
"aria-expanded": isExpandable ? isOpen : void 0,
|
|
3343
3390
|
...headerProps,
|
|
3344
3391
|
children: [
|
|
3345
3392
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3346
|
-
className: "font-medium",
|
|
3393
|
+
className: "cpk:font-medium",
|
|
3347
3394
|
children: label
|
|
3348
3395
|
}),
|
|
3349
3396
|
isStreaming && !hasContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3350
|
-
className: "inline-flex items-center ml-1",
|
|
3351
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-muted-foreground animate-pulse" })
|
|
3397
|
+
className: "cpk:inline-flex cpk:items-center cpk:ml-1",
|
|
3398
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk:w-1.5 cpk:h-1.5 cpk:rounded-full cpk:bg-muted-foreground cpk:animate-pulse" })
|
|
3352
3399
|
}),
|
|
3353
3400
|
headerChildren,
|
|
3354
|
-
isExpandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: (0, tailwind_merge.twMerge)("size-3.5 shrink-0 transition-transform duration-200", isOpen && "rotate-90") })
|
|
3401
|
+
isExpandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, { className: (0, tailwind_merge.twMerge)("cpk:size-3.5 cpk:shrink-0 cpk:transition-transform cpk:duration-200", isOpen && "cpk:rotate-90") })
|
|
3355
3402
|
]
|
|
3356
3403
|
});
|
|
3357
3404
|
};
|
|
3358
3405
|
_CopilotChatReasoningMessage.Content = ({ isStreaming, hasContent, className, children: contentChildren, ...contentProps }) => {
|
|
3359
3406
|
if (!hasContent && !isStreaming) return null;
|
|
3360
3407
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3361
|
-
className: (0, tailwind_merge.twMerge)("pb-2 pt-1", className),
|
|
3408
|
+
className: (0, tailwind_merge.twMerge)("cpk:pb-2 cpk:pt-1", className),
|
|
3362
3409
|
...contentProps,
|
|
3363
3410
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3364
|
-
className: "text-sm text-muted-foreground",
|
|
3411
|
+
className: "cpk:text-sm cpk:text-muted-foreground",
|
|
3365
3412
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.Streamdown, { children: typeof contentChildren === "string" ? contentChildren : "" }), isStreaming && hasContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3366
|
-
className: "inline-flex items-center ml-1 align-middle",
|
|
3367
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "w-2 h-2 rounded-full bg-muted-foreground animate-pulse-cursor" })
|
|
3413
|
+
className: "cpk:inline-flex cpk:items-center cpk:ml-1 cpk:align-middle",
|
|
3414
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk:w-2 cpk:h-2 cpk:rounded-full cpk:bg-muted-foreground cpk:animate-pulse-cursor" })
|
|
3368
3415
|
})]
|
|
3369
3416
|
})
|
|
3370
3417
|
});
|
|
3371
3418
|
};
|
|
3372
3419
|
_CopilotChatReasoningMessage.Toggle = ({ isOpen, className, children: toggleChildren, ...toggleProps }) => {
|
|
3373
3420
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3374
|
-
className: (0, tailwind_merge.twMerge)("grid transition-[grid-template-rows] duration-200 ease-in-out", className),
|
|
3421
|
+
className: (0, tailwind_merge.twMerge)("cpk:grid cpk:transition-[grid-template-rows] cpk:duration-200 cpk:ease-in-out", className),
|
|
3375
3422
|
style: { gridTemplateRows: isOpen ? "1fr" : "0fr" },
|
|
3376
3423
|
...toggleProps,
|
|
3377
3424
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3378
|
-
className: "overflow-hidden",
|
|
3425
|
+
className: "cpk:overflow-hidden",
|
|
3379
3426
|
children: toggleChildren
|
|
3380
3427
|
})
|
|
3381
3428
|
});
|
|
@@ -3388,12 +3435,13 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3388
3435
|
|
|
3389
3436
|
//#endregion
|
|
3390
3437
|
//#region src/components/chat/CopilotChatSuggestionPill.tsx
|
|
3391
|
-
const baseClasses = "group inline-flex h-7 sm:h-8 items-center gap-1 sm:gap-1.5 rounded-full border border-border/60 bg-background px-2.5 sm:px-3 text-[11px] sm:text-xs leading-none text-foreground transition-colors cursor-pointer hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:text-muted-foreground disabled:hover:bg-background disabled:hover:text-muted-foreground pointer-events-auto";
|
|
3392
|
-
const labelClasses = "whitespace-nowrap font-medium leading-none";
|
|
3438
|
+
const baseClasses = "group cpk:inline-flex cpk:h-7 cpk:sm:h-8 cpk:items-center cpk:gap-1 cpk:sm:gap-1.5 cpk:rounded-full cpk:border cpk:border-border/60 cpk:bg-background cpk:px-2.5 cpk:sm:px-3 cpk:text-[11px] cpk:sm:text-xs cpk:leading-none cpk:text-foreground cpk:transition-colors cpk:cursor-pointer cpk:hover:bg-accent/60 cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring cpk:focus-visible:ring-offset-2 cpk:focus-visible:ring-offset-background cpk:disabled:cursor-not-allowed cpk:disabled:text-muted-foreground cpk:disabled:hover:bg-background cpk:disabled:hover:text-muted-foreground cpk:pointer-events-auto";
|
|
3439
|
+
const labelClasses = "cpk:whitespace-nowrap cpk:font-medium cpk:leading-none";
|
|
3393
3440
|
const CopilotChatSuggestionPill = react.default.forwardRef(function CopilotChatSuggestionPill({ className, children, icon, isLoading, type, ...props }, ref) {
|
|
3394
3441
|
const showIcon = !isLoading && icon;
|
|
3395
3442
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3396
3443
|
ref,
|
|
3444
|
+
"data-copilotkit": true,
|
|
3397
3445
|
"data-slot": "suggestion-pill",
|
|
3398
3446
|
className: cn(baseClasses, className),
|
|
3399
3447
|
type: type !== null && type !== void 0 ? type : "button",
|
|
@@ -3401,13 +3449,13 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3401
3449
|
disabled: isLoading || props.disabled,
|
|
3402
3450
|
...props,
|
|
3403
3451
|
children: [isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3404
|
-
className: "flex h-3.5 sm:h-4 w-3.5 sm:w-4 items-center justify-center text-muted-foreground",
|
|
3452
|
+
className: "cpk:flex cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:items-center cpk:justify-center cpk:text-muted-foreground",
|
|
3405
3453
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, {
|
|
3406
|
-
className: "h-3.5 sm:h-4 w-3.5 sm:w-4 animate-spin",
|
|
3454
|
+
className: "cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:animate-spin",
|
|
3407
3455
|
"aria-hidden": "true"
|
|
3408
3456
|
})
|
|
3409
3457
|
}) : showIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3410
|
-
className: "flex h-3.5 sm:h-4 w-3.5 sm:w-4 items-center justify-center text-muted-foreground",
|
|
3458
|
+
className: "cpk:flex cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:items-center cpk:justify-center cpk:text-muted-foreground",
|
|
3411
3459
|
children: icon
|
|
3412
3460
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3413
3461
|
className: labelClasses,
|
|
@@ -3422,7 +3470,8 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3422
3470
|
const DefaultContainer = react.default.forwardRef(function DefaultContainer({ className, ...props }, ref) {
|
|
3423
3471
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3424
3472
|
ref,
|
|
3425
|
-
|
|
3473
|
+
"data-copilotkit": true,
|
|
3474
|
+
className: cn("cpk:flex cpk:flex-wrap cpk:items-center cpk:gap-1.5 cpk:sm:gap-2 cpk:pl-0 cpk:pr-4 cpk:sm:px-0 cpk:pointer-events-none", className),
|
|
3426
3475
|
...props
|
|
3427
3476
|
});
|
|
3428
3477
|
});
|
|
@@ -3449,21 +3498,30 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3449
3498
|
const boundContainer = react.default.cloneElement(ContainerElement, void 0, suggestionElements);
|
|
3450
3499
|
if (typeof children === "function") {
|
|
3451
3500
|
var _suggestions$0$title, _suggestions$, _suggestions$2;
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3501
|
+
const sampleSuggestion = renderSlot(suggestionSlot, CopilotChatSuggestionPill, {
|
|
3502
|
+
children: (_suggestions$0$title = (_suggestions$ = suggestions[0]) === null || _suggestions$ === void 0 ? void 0 : _suggestions$.title) !== null && _suggestions$0$title !== void 0 ? _suggestions$0$title : "",
|
|
3503
|
+
isLoading: suggestions.length > 0 ? loadingSet.has(0) || ((_suggestions$2 = suggestions[0]) === null || _suggestions$2 === void 0 ? void 0 : _suggestions$2.isLoading) === true : false,
|
|
3504
|
+
type: "button"
|
|
3505
|
+
});
|
|
3506
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3507
|
+
"data-copilotkit": true,
|
|
3508
|
+
style: { display: "contents" },
|
|
3509
|
+
children: children({
|
|
3510
|
+
container: boundContainer,
|
|
3511
|
+
suggestion: sampleSuggestion,
|
|
3512
|
+
suggestions,
|
|
3513
|
+
onSelectSuggestion,
|
|
3514
|
+
loadingIndexes,
|
|
3515
|
+
className,
|
|
3516
|
+
...restProps
|
|
3517
|
+
})
|
|
3518
|
+
});
|
|
3465
3519
|
}
|
|
3466
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3520
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3521
|
+
"data-copilotkit": true,
|
|
3522
|
+
style: { display: "contents" },
|
|
3523
|
+
children: [boundContainer, children]
|
|
3524
|
+
});
|
|
3467
3525
|
return boundContainer;
|
|
3468
3526
|
});
|
|
3469
3527
|
CopilotChatSuggestionView.displayName = "CopilotChatSuggestionView";
|
|
@@ -3655,25 +3713,30 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3655
3713
|
}, `${message.id}-custom-after`));
|
|
3656
3714
|
return elements;
|
|
3657
3715
|
}).filter(Boolean);
|
|
3658
|
-
if (children) return
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3716
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3717
|
+
"data-copilotkit": true,
|
|
3718
|
+
style: { display: "contents" },
|
|
3719
|
+
children: children({
|
|
3720
|
+
messageElements,
|
|
3721
|
+
messages,
|
|
3722
|
+
isRunning
|
|
3723
|
+
})
|
|
3662
3724
|
});
|
|
3663
3725
|
const lastMessage = messages[messages.length - 1];
|
|
3664
3726
|
const showCursor = isRunning && (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.role) !== "reasoning";
|
|
3665
3727
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3666
|
-
|
|
3728
|
+
"data-copilotkit": true,
|
|
3729
|
+
className: (0, tailwind_merge.twMerge)("cpk:flex cpk:flex-col", className),
|
|
3667
3730
|
...props,
|
|
3668
3731
|
children: [messageElements, showCursor && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3669
|
-
className: "mt-2",
|
|
3732
|
+
className: "cpk:mt-2",
|
|
3670
3733
|
children: renderSlot(cursor, CopilotChatMessageView.Cursor, {})
|
|
3671
3734
|
})]
|
|
3672
3735
|
});
|
|
3673
3736
|
}
|
|
3674
3737
|
CopilotChatMessageView.Cursor = function Cursor({ className, ...props }) {
|
|
3675
3738
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3676
|
-
className: (0, tailwind_merge.twMerge)("w-[11px] h-[11px] rounded-full bg-foreground animate-pulse-cursor ml-1", className),
|
|
3739
|
+
className: (0, tailwind_merge.twMerge)("cpk:w-[11px] cpk:h-[11px] cpk:rounded-full cpk:bg-foreground cpk:animate-pulse-cursor cpk:ml-1", className),
|
|
3677
3740
|
...props
|
|
3678
3741
|
});
|
|
3679
3742
|
};
|
|
@@ -3779,7 +3842,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3779
3842
|
suggestions,
|
|
3780
3843
|
loadingIndexes: suggestionLoadingIndexes,
|
|
3781
3844
|
onSelectSuggestion,
|
|
3782
|
-
className: "mb-3 lg:ml-4 lg:mr-4 ml-0 mr-0"
|
|
3845
|
+
className: "cpk:mb-3 cpk:lg:ml-4 cpk:lg:mr-4 cpk:ml-0 cpk:mr-0"
|
|
3783
3846
|
}) : null;
|
|
3784
3847
|
const BoundScrollView = renderSlot(scrollView, CopilotChatView.ScrollView, {
|
|
3785
3848
|
autoScroll,
|
|
@@ -3788,9 +3851,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3788
3851
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3789
3852
|
style: { paddingBottom: `${inputContainerHeight + FEATHER_HEIGHT + (hasSuggestions ? 4 : 32)}px` },
|
|
3790
3853
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3791
|
-
className: "max-w-3xl mx-auto",
|
|
3854
|
+
className: "cpk:max-w-3xl cpk:mx-auto",
|
|
3792
3855
|
children: [BoundMessageView, hasSuggestions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3793
|
-
className: "pl-0 pr-4 sm:px-0 mt-4",
|
|
3856
|
+
className: "cpk:pl-0 cpk:pr-4 cpk:sm:px-0 cpk:mt-4",
|
|
3794
3857
|
children: BoundSuggestionView
|
|
3795
3858
|
}) : null]
|
|
3796
3859
|
})
|
|
@@ -3816,19 +3879,25 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3816
3879
|
suggestionView: BoundSuggestionView !== null && BoundSuggestionView !== void 0 ? BoundSuggestionView : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {})
|
|
3817
3880
|
});
|
|
3818
3881
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3819
|
-
|
|
3882
|
+
"data-copilotkit": true,
|
|
3883
|
+
className: (0, tailwind_merge.twMerge)("cpk:relative cpk:h-full cpk:flex cpk:flex-col", className),
|
|
3820
3884
|
...props,
|
|
3821
3885
|
children: BoundWelcomeScreen
|
|
3822
3886
|
});
|
|
3823
3887
|
}
|
|
3824
|
-
if (children) return
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3888
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3889
|
+
"data-copilotkit": true,
|
|
3890
|
+
style: { display: "contents" },
|
|
3891
|
+
children: children({
|
|
3892
|
+
messageView: BoundMessageView,
|
|
3893
|
+
input: BoundInput,
|
|
3894
|
+
scrollView: BoundScrollView,
|
|
3895
|
+
suggestionView: BoundSuggestionView !== null && BoundSuggestionView !== void 0 ? BoundSuggestionView : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {})
|
|
3896
|
+
})
|
|
3829
3897
|
});
|
|
3830
3898
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3831
|
-
|
|
3899
|
+
"data-copilotkit": true,
|
|
3900
|
+
className: (0, tailwind_merge.twMerge)("cpk:relative cpk:h-full", className),
|
|
3832
3901
|
...props,
|
|
3833
3902
|
children: [BoundScrollView, BoundInput]
|
|
3834
3903
|
});
|
|
@@ -3839,19 +3908,19 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3839
3908
|
const BoundFeather = renderSlot(feather, CopilotChatView.Feather, {});
|
|
3840
3909
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3841
3910
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(use_stick_to_bottom.StickToBottom.Content, {
|
|
3842
|
-
className: "overflow-y-scroll overflow-x-hidden",
|
|
3911
|
+
className: "cpk:overflow-y-scroll cpk:overflow-x-hidden",
|
|
3843
3912
|
style: {
|
|
3844
3913
|
flex: "1 1 0%",
|
|
3845
3914
|
minHeight: 0
|
|
3846
3915
|
},
|
|
3847
3916
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3848
|
-
className: "px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6",
|
|
3917
|
+
className: "cpk:px-4 cpk:sm:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
|
|
3849
3918
|
children
|
|
3850
3919
|
})
|
|
3851
3920
|
}),
|
|
3852
3921
|
BoundFeather,
|
|
3853
3922
|
!isAtBottom && !isResizing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3854
|
-
className: "absolute inset-x-0 flex justify-center z-30 pointer-events-none",
|
|
3923
|
+
className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
|
|
3855
3924
|
style: { bottom: `${inputContainerHeight + FEATHER_HEIGHT + 16}px` },
|
|
3856
3925
|
children: renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
|
|
3857
3926
|
})
|
|
@@ -3881,9 +3950,9 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3881
3950
|
};
|
|
3882
3951
|
}, [scrollRef, autoScroll]);
|
|
3883
3952
|
if (!hasMounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3884
|
-
className: "h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden",
|
|
3953
|
+
className: "cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:overflow-y-scroll cpk:overflow-x-hidden",
|
|
3885
3954
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3886
|
-
className: "px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6",
|
|
3955
|
+
className: "cpk:px-4 cpk:sm:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
|
|
3887
3956
|
children
|
|
3888
3957
|
})
|
|
3889
3958
|
});
|
|
@@ -3891,17 +3960,17 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3891
3960
|
const BoundFeather = renderSlot(feather, CopilotChatView.Feather, {});
|
|
3892
3961
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3893
3962
|
ref: scrollRef,
|
|
3894
|
-
className: cn("h-full max-h-full flex flex-col min-h-0 overflow-y-scroll overflow-x-hidden relative", className),
|
|
3963
|
+
className: cn("cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:overflow-y-scroll cpk:overflow-x-hidden cpk:relative", className),
|
|
3895
3964
|
...props,
|
|
3896
3965
|
children: [
|
|
3897
3966
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3898
3967
|
ref: contentRef,
|
|
3899
|
-
className: "px-4 sm:px-0 [div[data-sidebar-chat]_&]:px-8 [div[data-popup-chat]_&]:px-6",
|
|
3968
|
+
className: "cpk:px-4 cpk:sm:px-0 cpk:[div[data-sidebar-chat]_&]:px-8 cpk:[div[data-popup-chat]_&]:px-6",
|
|
3900
3969
|
children
|
|
3901
3970
|
}),
|
|
3902
3971
|
BoundFeather,
|
|
3903
3972
|
showScrollButton && !isResizing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3904
|
-
className: "absolute inset-x-0 flex justify-center z-30 pointer-events-none",
|
|
3973
|
+
className: "cpk:absolute cpk:inset-x-0 cpk:flex cpk:justify-center cpk:z-30 cpk:pointer-events-none",
|
|
3905
3974
|
style: { bottom: `${inputContainerHeight + FEATHER_HEIGHT + 16}px` },
|
|
3906
3975
|
children: renderSlot(scrollToBottomButton, CopilotChatView.ScrollToBottomButton, { onClick: () => scrollToBottom() })
|
|
3907
3976
|
})
|
|
@@ -3909,7 +3978,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3909
3978
|
});
|
|
3910
3979
|
}
|
|
3911
3980
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(use_stick_to_bottom.StickToBottom, {
|
|
3912
|
-
className: cn("h-full max-h-full flex flex-col min-h-0 relative", className),
|
|
3981
|
+
className: cn("cpk:h-full cpk:max-h-full cpk:flex cpk:flex-col cpk:min-h-0 cpk:relative", className),
|
|
3913
3982
|
resize: "smooth",
|
|
3914
3983
|
initial: "smooth",
|
|
3915
3984
|
...props,
|
|
@@ -3925,12 +3994,12 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3925
3994
|
_CopilotChatView.ScrollToBottomButton = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
3926
3995
|
variant: "outline",
|
|
3927
3996
|
size: "sm",
|
|
3928
|
-
className: (0, tailwind_merge.twMerge)("rounded-full w-10 h-10 p-0 pointer-events-auto", "bg-white dark:bg-gray-900", "shadow-lg border border-gray-200 dark:border-gray-700", "hover:bg-gray-50 dark:hover:bg-gray-800", "flex items-center justify-center cursor-pointer", className),
|
|
3997
|
+
className: (0, tailwind_merge.twMerge)("cpk:rounded-full cpk:w-10 cpk:h-10 cpk:p-0 cpk:pointer-events-auto", "cpk:bg-white cpk:dark:bg-gray-900", "cpk:shadow-lg cpk:border cpk:border-gray-200 cpk:dark:border-gray-700", "cpk:hover:bg-gray-50 cpk:dark:hover:bg-gray-800", "cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer", className),
|
|
3929
3998
|
...props,
|
|
3930
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "w-4 h-4 text-gray-600 dark:text-white" })
|
|
3999
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { className: "cpk:w-4 cpk:h-4 cpk:text-gray-600 cpk:dark:text-white" })
|
|
3931
4000
|
});
|
|
3932
4001
|
_CopilotChatView.Feather = ({ className, style, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3933
|
-
className: cn("absolute bottom-0 left-0 right-4 h-24 pointer-events-none z-10 bg-gradient-to-t", "from-white via-white to-transparent", "dark:from-[rgb(33,33,33)] dark:via-[rgb(33,33,33)]", className),
|
|
4002
|
+
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),
|
|
3934
4003
|
style,
|
|
3935
4004
|
...props
|
|
3936
4005
|
});
|
|
@@ -3939,36 +4008,40 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
3939
4008
|
const config = useCopilotChatConfiguration();
|
|
3940
4009
|
const labels = (_config$labels = config === null || config === void 0 ? void 0 : config.labels) !== null && _config$labels !== void 0 ? _config$labels : CopilotChatDefaultLabels;
|
|
3941
4010
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
3942
|
-
className: cn("text-xl sm:text-2xl font-medium text-foreground text-center", className),
|
|
4011
|
+
className: cn("cpk:text-xl cpk:sm:text-2xl cpk:font-medium cpk:text-foreground cpk:text-center", className),
|
|
3943
4012
|
...props,
|
|
3944
4013
|
children: labels.welcomeMessageText
|
|
3945
4014
|
});
|
|
3946
4015
|
};
|
|
3947
4016
|
_CopilotChatView.WelcomeScreen = ({ welcomeMessage, input, suggestionView, className, children, ...props }) => {
|
|
3948
4017
|
const BoundWelcomeMessage = renderSlot(welcomeMessage, CopilotChatView.WelcomeMessage, {});
|
|
3949
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
4018
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4019
|
+
"data-copilotkit": true,
|
|
4020
|
+
style: { display: "contents" },
|
|
4021
|
+
children: children({
|
|
4022
|
+
welcomeMessage: BoundWelcomeMessage,
|
|
4023
|
+
input,
|
|
4024
|
+
suggestionView,
|
|
4025
|
+
className,
|
|
4026
|
+
...props
|
|
4027
|
+
})
|
|
4028
|
+
});
|
|
3956
4029
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3957
|
-
className: cn("flex-1 flex flex-col items-center justify-center px-4", className),
|
|
4030
|
+
className: cn("cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4", className),
|
|
3958
4031
|
...props,
|
|
3959
4032
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3960
|
-
className: "w-full max-w-3xl flex flex-col items-center",
|
|
4033
|
+
className: "cpk:w-full cpk:max-w-3xl cpk:flex cpk:flex-col cpk:items-center",
|
|
3961
4034
|
children: [
|
|
3962
4035
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3963
|
-
className: "mb-6",
|
|
4036
|
+
className: "cpk:mb-6",
|
|
3964
4037
|
children: BoundWelcomeMessage
|
|
3965
4038
|
}),
|
|
3966
4039
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3967
|
-
className: "w-full",
|
|
4040
|
+
className: "cpk:w-full",
|
|
3968
4041
|
children: input
|
|
3969
4042
|
}),
|
|
3970
4043
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3971
|
-
className: "mt-4 flex justify-center",
|
|
4044
|
+
className: "cpk:mt-4 cpk:flex cpk:justify-center",
|
|
3972
4045
|
children: suggestionView
|
|
3973
4046
|
})
|
|
3974
4047
|
]
|
|
@@ -4282,21 +4355,21 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4282
4355
|
//#endregion
|
|
4283
4356
|
//#region src/components/chat/CopilotChatToggleButton.tsx
|
|
4284
4357
|
const DefaultOpenIcon = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MessageCircle, {
|
|
4285
|
-
className: cn("h-6 w-6", className),
|
|
4358
|
+
className: cn("cpk:h-6 cpk:w-6", className),
|
|
4286
4359
|
strokeWidth: 1.75,
|
|
4287
4360
|
fill: "currentColor",
|
|
4288
4361
|
...props
|
|
4289
4362
|
});
|
|
4290
4363
|
const DefaultCloseIcon = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
4291
|
-
className: cn("h-6 w-6", className),
|
|
4364
|
+
className: cn("cpk:h-6 cpk:w-6", className),
|
|
4292
4365
|
strokeWidth: 1.75,
|
|
4293
4366
|
...props
|
|
4294
4367
|
});
|
|
4295
4368
|
DefaultOpenIcon.displayName = "CopilotChatToggleButton.OpenIcon";
|
|
4296
4369
|
DefaultCloseIcon.displayName = "CopilotChatToggleButton.CloseIcon";
|
|
4297
4370
|
const ICON_TRANSITION_STYLE = Object.freeze({ transition: "opacity 120ms ease-out, transform 260ms cubic-bezier(0.22, 1, 0.36, 1)" });
|
|
4298
|
-
const ICON_WRAPPER_BASE = "pointer-events-none absolute inset-0 flex items-center justify-center will-change-transform";
|
|
4299
|
-
const BUTTON_BASE_CLASSES = cn("fixed bottom-6 right-6 z-[1100] flex h-14 w-14 items-center justify-center", "rounded-full border border-primary bg-primary text-primary-foreground", "shadow-sm transition-all duration-200 ease-out", "hover:scale-[1.04] hover:shadow-md", "cursor-pointer", "active:scale-[0.96]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background", "disabled:pointer-events-none disabled:opacity-60");
|
|
4371
|
+
const ICON_WRAPPER_BASE = "cpk:pointer-events-none cpk:absolute cpk:inset-0 cpk:flex cpk:items-center cpk:justify-center cpk:will-change-transform";
|
|
4372
|
+
const BUTTON_BASE_CLASSES = cn("cpk:fixed cpk:bottom-6 cpk:right-6 cpk:z-[1100] cpk:flex cpk:h-14 cpk:w-14 cpk:items-center cpk:justify-center", "cpk:rounded-full cpk:border cpk:border-primary cpk:bg-primary cpk:text-primary-foreground", "cpk:shadow-sm cpk:transition-all cpk:duration-200 cpk:ease-out", "cpk:hover:scale-[1.04] cpk:hover:shadow-md", "cpk:cursor-pointer", "cpk:active:scale-[0.96]", "cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-primary/50 cpk:focus-visible:ring-offset-2 cpk:focus-visible:ring-offset-background", "cpk:disabled:pointer-events-none cpk:disabled:opacity-60");
|
|
4300
4373
|
const CopilotChatToggleButton = react.default.forwardRef(function CopilotChatToggleButton({ openIcon, closeIcon, className, ...buttonProps }, ref) {
|
|
4301
4374
|
var _configuration$labels, _configuration$isModa, _configuration$setMod;
|
|
4302
4375
|
const { onClick, type, disabled, ...restProps } = buttonProps;
|
|
@@ -4312,12 +4385,12 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4312
4385
|
setModalOpen(!isOpen);
|
|
4313
4386
|
};
|
|
4314
4387
|
const renderedOpenIcon = renderSlot(openIcon, DefaultOpenIcon, {
|
|
4315
|
-
className: "h-6 w-6",
|
|
4388
|
+
className: "cpk:h-6 cpk:w-6",
|
|
4316
4389
|
"aria-hidden": true,
|
|
4317
4390
|
focusable: false
|
|
4318
4391
|
});
|
|
4319
4392
|
const renderedCloseIcon = renderSlot(closeIcon, DefaultCloseIcon, {
|
|
4320
|
-
className: "h-6 w-6",
|
|
4393
|
+
className: "cpk:h-6 cpk:w-6",
|
|
4321
4394
|
"aria-hidden": true,
|
|
4322
4395
|
focusable: false
|
|
4323
4396
|
});
|
|
@@ -4346,6 +4419,7 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4346
4419
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4347
4420
|
ref,
|
|
4348
4421
|
type: type !== null && type !== void 0 ? type : "button",
|
|
4422
|
+
"data-copilotkit": true,
|
|
4349
4423
|
"data-slot": "chat-toggle-button",
|
|
4350
4424
|
"data-state": isOpen ? "open" : "closed",
|
|
4351
4425
|
className: cn(BUTTON_BASE_CLASSES, className),
|
|
@@ -4380,21 +4454,21 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4380
4454
|
});
|
|
4381
4455
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
|
|
4382
4456
|
"data-slot": "copilot-modal-header",
|
|
4383
|
-
className: cn("flex items-center justify-between border-b border-border px-4 py-4", "bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80", className),
|
|
4457
|
+
className: cn("cpk:flex cpk:items-center cpk:justify-between cpk:border-b cpk:border-border cpk:px-4 cpk:py-4", "cpk:bg-background/95 cpk:backdrop-blur cpk:supports-[backdrop-filter]:bg-background/80", className),
|
|
4384
4458
|
...rest,
|
|
4385
4459
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4386
|
-
className: "flex w-full items-center gap-2",
|
|
4460
|
+
className: "cpk:flex cpk:w-full cpk:items-center cpk:gap-2",
|
|
4387
4461
|
children: [
|
|
4388
4462
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4389
|
-
className: "flex-1",
|
|
4463
|
+
className: "cpk:flex-1",
|
|
4390
4464
|
"aria-hidden": "true"
|
|
4391
4465
|
}),
|
|
4392
4466
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4393
|
-
className: "flex flex-1 justify-center text-center",
|
|
4467
|
+
className: "cpk:flex cpk:flex-1 cpk:justify-center cpk:text-center",
|
|
4394
4468
|
children: BoundTitle
|
|
4395
4469
|
}),
|
|
4396
4470
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4397
|
-
className: "flex flex-1 justify-end",
|
|
4471
|
+
className: "cpk:flex cpk:flex-1 cpk:justify-end",
|
|
4398
4472
|
children: BoundCloseButton
|
|
4399
4473
|
})
|
|
4400
4474
|
]
|
|
@@ -4404,17 +4478,17 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4404
4478
|
CopilotModalHeader.displayName = "CopilotModalHeader";
|
|
4405
4479
|
(function(_CopilotModalHeader) {
|
|
4406
4480
|
_CopilotModalHeader.Title = ({ children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4407
|
-
className: cn("w-full text-base font-medium leading-none tracking-tight text-foreground", className),
|
|
4481
|
+
className: cn("cpk:w-full cpk:text-base cpk:font-medium cpk:leading-none cpk:tracking-tight cpk:text-foreground", className),
|
|
4408
4482
|
...props,
|
|
4409
4483
|
children
|
|
4410
4484
|
});
|
|
4411
4485
|
_CopilotModalHeader.CloseButton = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4412
4486
|
type: "button",
|
|
4413
|
-
className: cn("inline-flex size-8 items-center justify-center rounded-full text-muted-foreground transition cursor-pointer", "hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", className),
|
|
4487
|
+
className: cn("cpk:inline-flex cpk:size-8 cpk:items-center cpk:justify-center cpk:rounded-full cpk:text-muted-foreground cpk:transition cpk:cursor-pointer", "cpk:hover:bg-muted cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring", className),
|
|
4414
4488
|
"aria-label": "Close",
|
|
4415
4489
|
...props,
|
|
4416
4490
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
4417
|
-
className: "h-4 w-4",
|
|
4491
|
+
className: "cpk:h-4 cpk:w-4",
|
|
4418
4492
|
"aria-hidden": "true"
|
|
4419
4493
|
})
|
|
4420
4494
|
});
|
|
@@ -4468,63 +4542,74 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4468
4542
|
window.addEventListener("resize", updateWidth);
|
|
4469
4543
|
return () => window.removeEventListener("resize", updateWidth);
|
|
4470
4544
|
}, [width]);
|
|
4545
|
+
const hasMounted = (0, react.useRef)(false);
|
|
4546
|
+
(0, react.useLayoutEffect)(() => {
|
|
4547
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
4548
|
+
if (!window.matchMedia("(min-width: 768px)").matches) return;
|
|
4549
|
+
if (isSidebarOpen) {
|
|
4550
|
+
if (hasMounted.current) document.body.style.transition = `margin-inline-end ${SIDEBAR_TRANSITION_MS}ms ease`;
|
|
4551
|
+
document.body.style.marginInlineEnd = widthToMargin(sidebarWidth);
|
|
4552
|
+
} else if (hasMounted.current) {
|
|
4553
|
+
document.body.style.transition = `margin-inline-end ${SIDEBAR_TRANSITION_MS}ms ease`;
|
|
4554
|
+
document.body.style.marginInlineEnd = "";
|
|
4555
|
+
}
|
|
4556
|
+
hasMounted.current = true;
|
|
4557
|
+
return () => {
|
|
4558
|
+
document.body.style.marginInlineEnd = "";
|
|
4559
|
+
document.body.style.transition = "";
|
|
4560
|
+
};
|
|
4561
|
+
}, [isSidebarOpen, sidebarWidth]);
|
|
4471
4562
|
const headerElement = renderSlot(header, CopilotModalHeader, {});
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
"aria-label": "Copilot chat sidebar",
|
|
4493
|
-
role: "complementary",
|
|
4494
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4495
|
-
className: "flex h-full w-full flex-col overflow-hidden",
|
|
4496
|
-
children: [headerElement, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4497
|
-
className: "flex-1 overflow-hidden",
|
|
4498
|
-
"data-sidebar-chat": true,
|
|
4499
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatView_default, { ...props })
|
|
4500
|
-
})]
|
|
4501
|
-
})
|
|
4563
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderSlot(toggleButton, CopilotChatToggleButton, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
|
|
4564
|
+
ref: sidebarRef,
|
|
4565
|
+
"data-copilotkit": true,
|
|
4566
|
+
"data-copilot-sidebar": true,
|
|
4567
|
+
className: cn("cpk:fixed cpk:right-0 cpk:top-0 cpk:z-[1200] cpk:flex", "cpk:h-[100vh] cpk:h-[100dvh] cpk:max-h-screen", "cpk:w-full", "cpk:border-l cpk:border-border cpk:bg-background cpk:text-foreground cpk:shadow-xl", "cpk:transition-transform cpk:duration-300 cpk:ease-out", isSidebarOpen ? "cpk:translate-x-0" : "cpk:translate-x-full cpk:pointer-events-none"),
|
|
4568
|
+
style: {
|
|
4569
|
+
["--sidebar-width"]: widthToCss(sidebarWidth),
|
|
4570
|
+
paddingTop: "env(safe-area-inset-top)",
|
|
4571
|
+
paddingBottom: "env(safe-area-inset-bottom)"
|
|
4572
|
+
},
|
|
4573
|
+
"aria-hidden": !isSidebarOpen,
|
|
4574
|
+
"aria-label": "Copilot chat sidebar",
|
|
4575
|
+
role: "complementary",
|
|
4576
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4577
|
+
className: "cpk:flex cpk:h-full cpk:w-full cpk:flex-col cpk:overflow-hidden",
|
|
4578
|
+
children: [headerElement, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4579
|
+
className: "cpk:flex-1 cpk:overflow-hidden",
|
|
4580
|
+
"data-sidebar-chat": true,
|
|
4581
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatView_default, { ...props })
|
|
4582
|
+
})]
|
|
4502
4583
|
})
|
|
4503
|
-
] });
|
|
4584
|
+
})] });
|
|
4504
4585
|
}
|
|
4505
4586
|
CopilotSidebarView.displayName = "CopilotSidebarView";
|
|
4506
4587
|
(function(_CopilotSidebarView) {
|
|
4507
4588
|
_CopilotSidebarView.WelcomeScreen = ({ welcomeMessage, input, suggestionView, className, children, ...props }) => {
|
|
4508
4589
|
const BoundWelcomeMessage = renderSlot(welcomeMessage, CopilotChatView_default.WelcomeMessage, {});
|
|
4509
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4590
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4591
|
+
"data-copilotkit": true,
|
|
4592
|
+
style: { display: "contents" },
|
|
4593
|
+
children: children({
|
|
4594
|
+
welcomeMessage: BoundWelcomeMessage,
|
|
4595
|
+
input,
|
|
4596
|
+
suggestionView,
|
|
4597
|
+
className,
|
|
4598
|
+
...props
|
|
4599
|
+
})
|
|
4600
|
+
});
|
|
4516
4601
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4517
|
-
className: cn("h-full flex flex-col", className),
|
|
4602
|
+
className: cn("cpk:h-full cpk:flex cpk:flex-col", className),
|
|
4518
4603
|
...props,
|
|
4519
4604
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4520
|
-
className: "flex-1 flex flex-col items-center justify-center px-4",
|
|
4605
|
+
className: "cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4",
|
|
4521
4606
|
children: BoundWelcomeMessage
|
|
4522
4607
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4523
|
-
className: "px-8 pb-4",
|
|
4608
|
+
className: "cpk:px-8 cpk:pb-4",
|
|
4524
4609
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4525
|
-
className: "max-w-3xl mx-auto",
|
|
4610
|
+
className: "cpk:max-w-3xl cpk:mx-auto",
|
|
4526
4611
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4527
|
-
className: "mb-4 flex justify-center",
|
|
4612
|
+
className: "cpk:mb-4 cpk:flex cpk:justify-center",
|
|
4528
4613
|
children: suggestionView
|
|
4529
4614
|
}), input]
|
|
4530
4615
|
})
|
|
@@ -4632,23 +4717,24 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4632
4717
|
paddingLeft: "env(safe-area-inset-left)",
|
|
4633
4718
|
paddingRight: "env(safe-area-inset-right)"
|
|
4634
4719
|
}), [resolvedHeight, resolvedWidth]);
|
|
4635
|
-
const popupAnimationClass = isPopupOpen && !isAnimatingOut ? "pointer-events-auto translate-y-0 opacity-100 md:scale-100" : "pointer-events-none translate-y-4 opacity-0 md:translate-y-5 md:scale-[0.95]";
|
|
4720
|
+
const popupAnimationClass = isPopupOpen && !isAnimatingOut ? "cpk:pointer-events-auto cpk:translate-y-0 cpk:opacity-100 cpk:md:scale-100" : "cpk:pointer-events-none cpk:translate-y-4 cpk:opacity-0 cpk:md:translate-y-5 cpk:md:scale-[0.95]";
|
|
4636
4721
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [toggleButtonElement, isRendered ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4637
|
-
|
|
4722
|
+
"data-copilotkit": true,
|
|
4723
|
+
className: cn("cpk:fixed cpk:inset-0 cpk:z-[1200] cpk:flex cpk:max-w-full cpk:flex-col cpk:items-stretch", "cpk:md:inset-auto cpk:md:bottom-24 cpk:md:right-6 cpk:md:items-end cpk:md:gap-4"),
|
|
4638
4724
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4639
4725
|
ref: containerRef,
|
|
4640
4726
|
tabIndex: -1,
|
|
4641
4727
|
role: "dialog",
|
|
4642
4728
|
"aria-label": labels.modalHeaderTitle,
|
|
4643
4729
|
"data-copilot-popup": true,
|
|
4644
|
-
className: cn("relative flex h-full w-full flex-col overflow-hidden bg-background text-foreground", "origin-bottom focus:outline-none transform-gpu transition-transform transition-opacity duration-200 ease-out", "md:transition-transform md:transition-opacity", "rounded-none border border-border/0 shadow-none ring-0", "md:h-[var(--copilot-popup-height)] md:w-[var(--copilot-popup-width)]", "md:max-h-[var(--copilot-popup-max-height)] md:max-w-[var(--copilot-popup-max-width)]", "md:origin-bottom-right md:rounded-2xl md:border-border md:shadow-xl md:ring-1 md:ring-border/40", popupAnimationClass),
|
|
4730
|
+
className: cn("cpk:relative cpk:flex cpk:h-full cpk:w-full cpk:flex-col cpk:overflow-hidden cpk:bg-background cpk:text-foreground", "cpk:origin-bottom cpk:focus:outline-none cpk:transform-gpu cpk:transition-transform cpk:transition-opacity cpk:duration-200 cpk:ease-out", "cpk:md:transition-transform cpk:md:transition-opacity", "cpk:rounded-none cpk:border cpk:border-border/0 cpk:shadow-none cpk:ring-0", "cpk:md:h-[var(--copilot-popup-height)] cpk:md:w-[var(--copilot-popup-width)]", "cpk:md:max-h-[var(--copilot-popup-max-height)] cpk:md:max-w-[var(--copilot-popup-max-width)]", "cpk:md:origin-bottom-right cpk:md:rounded-2xl cpk:md:border-border cpk:md:shadow-xl cpk:md:ring-1 cpk:md:ring-border/40", popupAnimationClass),
|
|
4645
4731
|
style: popupStyle,
|
|
4646
4732
|
children: [headerElement, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4647
|
-
className: "flex-1 overflow-hidden",
|
|
4733
|
+
className: "cpk:flex-1 cpk:overflow-hidden",
|
|
4648
4734
|
"data-popup-chat": true,
|
|
4649
4735
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopilotChatView_default, {
|
|
4650
4736
|
...restProps,
|
|
4651
|
-
className: cn("h-full min-h-0", className)
|
|
4737
|
+
className: cn("cpk:h-full cpk:min-h-0", className)
|
|
4652
4738
|
})
|
|
4653
4739
|
})]
|
|
4654
4740
|
})
|
|
@@ -4658,21 +4744,25 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4658
4744
|
(function(_CopilotPopupView) {
|
|
4659
4745
|
_CopilotPopupView.WelcomeScreen = ({ welcomeMessage, input, suggestionView, className, children, ...props }) => {
|
|
4660
4746
|
const BoundWelcomeMessage = renderSlot(welcomeMessage, CopilotChatView_default.WelcomeMessage, {});
|
|
4661
|
-
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4747
|
+
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4748
|
+
"data-copilotkit": true,
|
|
4749
|
+
style: { display: "contents" },
|
|
4750
|
+
children: children({
|
|
4751
|
+
welcomeMessage: BoundWelcomeMessage,
|
|
4752
|
+
input,
|
|
4753
|
+
suggestionView,
|
|
4754
|
+
className,
|
|
4755
|
+
...props
|
|
4756
|
+
})
|
|
4757
|
+
});
|
|
4668
4758
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4669
|
-
className: cn("h-full flex flex-col", className),
|
|
4759
|
+
className: cn("cpk:h-full cpk:flex cpk:flex-col", className),
|
|
4670
4760
|
...props,
|
|
4671
4761
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4672
|
-
className: "flex-1 flex flex-col items-center justify-center px-4",
|
|
4762
|
+
className: "cpk:flex-1 cpk:flex cpk:flex-col cpk:items-center cpk:justify-center cpk:px-4",
|
|
4673
4763
|
children: BoundWelcomeMessage
|
|
4674
4764
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4675
|
-
className: "mb-4 flex justify-center px-4",
|
|
4765
|
+
className: "cpk:mb-4 cpk:flex cpk:justify-center cpk:px-4",
|
|
4676
4766
|
children: suggestionView
|
|
4677
4767
|
}), input] })]
|
|
4678
4768
|
});
|
|
@@ -4750,17 +4840,17 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4750
4840
|
const [isExpanded, setIsExpanded] = (0, react.useState)(false);
|
|
4751
4841
|
const statusString = String(status);
|
|
4752
4842
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4753
|
-
className: "mt-2 pb-2",
|
|
4843
|
+
className: "cpk:mt-2 cpk:pb-2",
|
|
4754
4844
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4755
|
-
className: "rounded-xl border border-zinc-200/60 dark:border-zinc-800/60 bg-white/70 dark:bg-zinc-900/50 shadow-sm backdrop-blur p-4",
|
|
4845
|
+
className: "cpk:rounded-xl cpk:border cpk:border-zinc-200/60 cpk:dark:border-zinc-800/60 cpk:bg-white/70 cpk:dark:bg-zinc-900/50 cpk:shadow-sm cpk:backdrop-blur cpk:p-4",
|
|
4756
4846
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4757
|
-
className: "flex items-center justify-between gap-3 cursor-pointer",
|
|
4847
|
+
className: "cpk:flex cpk:items-center cpk:justify-between cpk:gap-3 cpk:cursor-pointer",
|
|
4758
4848
|
onClick: () => setIsExpanded(!isExpanded),
|
|
4759
4849
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4760
|
-
className: "flex items-center gap-2 min-w-0",
|
|
4850
|
+
className: "cpk:flex cpk:items-center cpk:gap-2 cpk:min-w-0",
|
|
4761
4851
|
children: [
|
|
4762
4852
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
4763
|
-
className: `h-4 w-4 text-zinc-500 dark:text-zinc-400 transition-transform ${isExpanded ? "rotate-90" : ""}`,
|
|
4853
|
+
className: `cpk:h-4 cpk:w-4 cpk:text-zinc-500 cpk:dark:text-zinc-400 cpk:transition-transform ${isExpanded ? "cpk:rotate-90" : ""}`,
|
|
4764
4854
|
fill: "none",
|
|
4765
4855
|
viewBox: "0 0 24 24",
|
|
4766
4856
|
strokeWidth: 2,
|
|
@@ -4771,29 +4861,29 @@ window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-
|
|
|
4771
4861
|
d: "M8.25 4.5l7.5 7.5-7.5 7.5"
|
|
4772
4862
|
})
|
|
4773
4863
|
}),
|
|
4774
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "inline-block h-2 w-2 rounded-full bg-blue-500" }),
|
|
4864
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cpk:inline-block cpk:h-2 cpk:w-2 cpk:rounded-full cpk:bg-blue-500" }),
|
|
4775
4865
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4776
|
-
className: "truncate text-sm font-medium text-zinc-900 dark:text-zinc-100",
|
|
4866
|
+
className: "cpk:truncate cpk:text-sm cpk:font-medium cpk:text-zinc-900 cpk:dark:text-zinc-100",
|
|
4777
4867
|
children: name
|
|
4778
4868
|
})
|
|
4779
4869
|
]
|
|
4780
4870
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4781
|
-
className: `inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ${statusString === "inProgress" || statusString === "executing" ? "bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-400" : statusString === "complete" ? "bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-400" : "bg-zinc-100 text-zinc-800 dark:bg-zinc-700/40 dark:text-zinc-300"}`,
|
|
4871
|
+
className: `cpk:inline-flex cpk:items-center cpk:rounded-full cpk:px-2 cpk:py-1 cpk:text-xs cpk:font-medium ${statusString === "inProgress" || statusString === "executing" ? "cpk:bg-amber-100 cpk:text-amber-800 cpk:dark:bg-amber-500/15 cpk:dark:text-amber-400" : statusString === "complete" ? "cpk:bg-emerald-100 cpk:text-emerald-800 cpk:dark:bg-emerald-500/15 cpk:dark:text-emerald-400" : "cpk:bg-zinc-100 cpk:text-zinc-800 cpk:dark:bg-zinc-700/40 cpk:dark:text-zinc-300"}`,
|
|
4782
4872
|
children: String(status)
|
|
4783
4873
|
})]
|
|
4784
4874
|
}), isExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4785
|
-
className: "mt-3 grid gap-4",
|
|
4875
|
+
className: "cpk:mt-3 cpk:grid cpk:gap-4",
|
|
4786
4876
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4787
|
-
className: "text-xs uppercase tracking-wide text-zinc-500 dark:text-zinc-400",
|
|
4877
|
+
className: "cpk:text-xs cpk:uppercase cpk:tracking-wide cpk:text-zinc-500 cpk:dark:text-zinc-400",
|
|
4788
4878
|
children: "Arguments"
|
|
4789
4879
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
4790
|
-
className: "mt-2 max-h-64 overflow-auto rounded-md bg-zinc-50 dark:bg-zinc-800/60 p-3 text-xs leading-relaxed text-zinc-800 dark:text-zinc-200 whitespace-pre-wrap break-words",
|
|
4880
|
+
className: "cpk:mt-2 cpk:max-h-64 cpk:overflow-auto cpk:rounded-md cpk:bg-zinc-50 cpk:dark:bg-zinc-800/60 cpk:p-3 cpk:text-xs cpk:leading-relaxed cpk:text-zinc-800 cpk:dark:text-zinc-200 cpk:whitespace-pre-wrap cpk:break-words",
|
|
4791
4881
|
children: JSON.stringify(args !== null && args !== void 0 ? args : {}, null, 2)
|
|
4792
4882
|
})] }), result !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4793
|
-
className: "text-xs uppercase tracking-wide text-zinc-500 dark:text-zinc-400",
|
|
4883
|
+
className: "cpk:text-xs cpk:uppercase cpk:tracking-wide cpk:text-zinc-500 cpk:dark:text-zinc-400",
|
|
4794
4884
|
children: "Result"
|
|
4795
4885
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
4796
|
-
className: "mt-2 max-h-64 overflow-auto rounded-md bg-zinc-50 dark:bg-zinc-800/60 p-3 text-xs leading-relaxed text-zinc-800 dark:text-zinc-200 whitespace-pre-wrap break-words",
|
|
4886
|
+
className: "cpk:mt-2 cpk:max-h-64 cpk:overflow-auto cpk:rounded-md cpk:bg-zinc-50 cpk:dark:bg-zinc-800/60 cpk:p-3 cpk:text-xs cpk:leading-relaxed cpk:text-zinc-800 cpk:dark:text-zinc-200 cpk:whitespace-pre-wrap cpk:break-words",
|
|
4797
4887
|
children: typeof result === "string" ? result : JSON.stringify(result, null, 2)
|
|
4798
4888
|
})] })]
|
|
4799
4889
|
})]
|