dp-widgets-framework 1.4.6 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -39179,6 +39179,7 @@ function CopilotKitChatbot({ widget, showHeader, styles, onResetReady, widgetIds
|
|
|
39179
39179
|
console.log('on reset ready=>');
|
|
39180
39180
|
const wrappedReset = () => {
|
|
39181
39181
|
reset();
|
|
39182
|
+
setChatMessages([]);
|
|
39182
39183
|
window.dispatchEvent(new CustomEvent('clearChartState', { detail: { widgetId: widget.id } }));
|
|
39183
39184
|
};
|
|
39184
39185
|
onResetReady(widget.id, wrappedReset);
|
|
@@ -39220,9 +39221,9 @@ function CopilotKitChatbot({ widget, showHeader, styles, onResetReady, widgetIds
|
|
|
39220
39221
|
handleSubmit(e);
|
|
39221
39222
|
}
|
|
39222
39223
|
};
|
|
39223
|
-
return (jsxRuntimeExports.jsxs("div", { className: cn("flex flex-col h-full"), children: [showHeader && (jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between pb-2 border-b", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsx(Bot, { className: "h-4 w-4" }), jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: widget.title })] }) })), jsxRuntimeExports.jsxs("div", { className: "flex-1 h-full flex flex-col", children: [jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-4", children: chatMessages.length === 0 ? (jsxRuntimeExports.jsx("div", { className: "text-center text-gray-500 text-xs mt-8", children: ((_b = widget.config) === null || _b === void 0 ? void 0 : _b.copilotInitialMessage) || ((_c = widget.config) === null || _c === void 0 ? void 0 : _c.placeholder) || "How can I help you today?" })) : (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [chatMessages.map((message) => (jsxRuntimeExports.jsx("div", { className: cn("flex", message.role === "user" ? "justify-end" : "justify-start"), children: jsxRuntimeExports.jsxs("div", { className: cn("max-w-[80%] rounded-lg px-4 py-2 text-
|
|
39224
|
+
return (jsxRuntimeExports.jsxs("div", { className: cn("flex flex-col h-full"), children: [showHeader && (jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between pb-2 border-b", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsx(Bot, { className: "h-4 w-4" }), jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: widget.title })] }) })), jsxRuntimeExports.jsxs("div", { className: "flex-1 h-full flex flex-col", children: [jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-4", children: chatMessages.length === 0 ? (jsxRuntimeExports.jsx("div", { className: "text-center text-gray-500 text-xs mt-8", children: ((_b = widget.config) === null || _b === void 0 ? void 0 : _b.copilotInitialMessage) || ((_c = widget.config) === null || _c === void 0 ? void 0 : _c.placeholder) || "How can I help you today?" })) : (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [chatMessages.map((message) => (jsxRuntimeExports.jsx("div", { className: cn("flex", message.role === "user" ? "justify-end" : "justify-start"), children: jsxRuntimeExports.jsxs("div", { className: cn("max-w-[80%] rounded-lg px-4 py-2 text-sm", message.role === "user"
|
|
39224
39225
|
? "bg-primary-500 text-white"
|
|
39225
|
-
: "bg-gray-100 text-gray-900"), children: [jsxRuntimeExports.jsx("div", { className: "whitespace-pre-wrap", children: jsxRuntimeExports.jsx(Markdown, { children: message.content }) }), message.createdAt && (jsxRuntimeExports.jsx("div", { className: cn("text-[10px] mt-1", message.role === "user" ? "text-primary-100" : "text-gray-500"), children: new Date(message.createdAt).toLocaleTimeString() }))] }) }, message.id))), isLoading && (jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: jsxRuntimeExports.jsx("div", { className: "bg-gray-100 rounded-lg px-4 py-2 text-xs", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex space-x-1", children: [jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '0ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '150ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '300ms' } })] }), jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: "Thinking..." })] }) }) })), jsxRuntimeExports.jsx("div", { ref: messagesEndRef })] })) }), jsxRuntimeExports.jsx("form", { onSubmit: handleSubmit, className: "border-t border-slate-200 p-4", children: jsxRuntimeExports.jsxs("div", { className: "flex gap-2 relative", children: [jsxRuntimeExports.jsx("textarea", { value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder: ((_d = widget.config) === null || _d === void 0 ? void 0 : _d.placeholder) || "Type a message...", className: "resize-none h-20 overflow-y-auto flex-1 px-3 py-2 text-
|
|
39226
|
+
: "bg-gray-100 text-gray-900"), children: [jsxRuntimeExports.jsx("div", { className: "whitespace-pre-wrap", children: jsxRuntimeExports.jsx(Markdown, { children: message.content }) }), message.createdAt && (jsxRuntimeExports.jsx("div", { className: cn("text-[10px] mt-1", message.role === "user" ? "text-primary-100" : "text-gray-500"), children: new Date(message.createdAt).toLocaleTimeString() }))] }) }, message.id))), isLoading && (jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: jsxRuntimeExports.jsx("div", { className: "bg-gray-100 rounded-lg px-4 py-2 text-xs", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex space-x-1", children: [jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '0ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '150ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '300ms' } })] }), jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: "Thinking..." })] }) }) })), jsxRuntimeExports.jsx("div", { ref: messagesEndRef })] })) }), jsxRuntimeExports.jsx("form", { onSubmit: handleSubmit, className: "border-t border-slate-200 p-4", children: jsxRuntimeExports.jsxs("div", { className: "flex gap-2 relative", children: [jsxRuntimeExports.jsx("textarea", { value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder: ((_d = widget.config) === null || _d === void 0 ? void 0 : _d.placeholder) || "Type a message...", className: "resize-none h-20 overflow-y-auto flex-1 px-3 py-2 text-sm border border-slate-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500" }), jsxRuntimeExports.jsx("button", { type: "submit", disabled: !inputValue.trim(), className: cn("absolute bottom-0 right-0 p-2 rounded-lg text-white flex items-center justify-center bg-transparent"), children: jsxRuntimeExports.jsx(Send, { className: cn("h-5 w-5", inputValue.trim()
|
|
39226
39227
|
? "text-primary-600"
|
|
39227
39228
|
: "text-gray-600 cursor-not-allowed") }) })] }) })] })] }));
|
|
39228
39229
|
}
|
package/dist/index.js
CHANGED
|
@@ -39206,6 +39206,7 @@ function CopilotKitChatbot({ widget, showHeader, styles, onResetReady, widgetIds
|
|
|
39206
39206
|
console.log('on reset ready=>');
|
|
39207
39207
|
const wrappedReset = () => {
|
|
39208
39208
|
reset();
|
|
39209
|
+
setChatMessages([]);
|
|
39209
39210
|
window.dispatchEvent(new CustomEvent('clearChartState', { detail: { widgetId: widget.id } }));
|
|
39210
39211
|
};
|
|
39211
39212
|
onResetReady(widget.id, wrappedReset);
|
|
@@ -39247,9 +39248,9 @@ function CopilotKitChatbot({ widget, showHeader, styles, onResetReady, widgetIds
|
|
|
39247
39248
|
handleSubmit(e);
|
|
39248
39249
|
}
|
|
39249
39250
|
};
|
|
39250
|
-
return (jsxRuntimeExports.jsxs("div", { className: cn("flex flex-col h-full"), children: [showHeader && (jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between pb-2 border-b", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsx(lucideReact.Bot, { className: "h-4 w-4" }), jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: widget.title })] }) })), jsxRuntimeExports.jsxs("div", { className: "flex-1 h-full flex flex-col", children: [jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-4", children: chatMessages.length === 0 ? (jsxRuntimeExports.jsx("div", { className: "text-center text-gray-500 text-xs mt-8", children: ((_b = widget.config) === null || _b === void 0 ? void 0 : _b.copilotInitialMessage) || ((_c = widget.config) === null || _c === void 0 ? void 0 : _c.placeholder) || "How can I help you today?" })) : (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [chatMessages.map((message) => (jsxRuntimeExports.jsx("div", { className: cn("flex", message.role === "user" ? "justify-end" : "justify-start"), children: jsxRuntimeExports.jsxs("div", { className: cn("max-w-[80%] rounded-lg px-4 py-2 text-
|
|
39251
|
+
return (jsxRuntimeExports.jsxs("div", { className: cn("flex flex-col h-full"), children: [showHeader && (jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between pb-2 border-b", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsx(lucideReact.Bot, { className: "h-4 w-4" }), jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium", children: widget.title })] }) })), jsxRuntimeExports.jsxs("div", { className: "flex-1 h-full flex flex-col", children: [jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-4", children: chatMessages.length === 0 ? (jsxRuntimeExports.jsx("div", { className: "text-center text-gray-500 text-xs mt-8", children: ((_b = widget.config) === null || _b === void 0 ? void 0 : _b.copilotInitialMessage) || ((_c = widget.config) === null || _c === void 0 ? void 0 : _c.placeholder) || "How can I help you today?" })) : (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [chatMessages.map((message) => (jsxRuntimeExports.jsx("div", { className: cn("flex", message.role === "user" ? "justify-end" : "justify-start"), children: jsxRuntimeExports.jsxs("div", { className: cn("max-w-[80%] rounded-lg px-4 py-2 text-sm", message.role === "user"
|
|
39251
39252
|
? "bg-primary-500 text-white"
|
|
39252
|
-
: "bg-gray-100 text-gray-900"), children: [jsxRuntimeExports.jsx("div", { className: "whitespace-pre-wrap", children: jsxRuntimeExports.jsx(Markdown, { children: message.content }) }), message.createdAt && (jsxRuntimeExports.jsx("div", { className: cn("text-[10px] mt-1", message.role === "user" ? "text-primary-100" : "text-gray-500"), children: new Date(message.createdAt).toLocaleTimeString() }))] }) }, message.id))), isLoading && (jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: jsxRuntimeExports.jsx("div", { className: "bg-gray-100 rounded-lg px-4 py-2 text-xs", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex space-x-1", children: [jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '0ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '150ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '300ms' } })] }), jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: "Thinking..." })] }) }) })), jsxRuntimeExports.jsx("div", { ref: messagesEndRef })] })) }), jsxRuntimeExports.jsx("form", { onSubmit: handleSubmit, className: "border-t border-slate-200 p-4", children: jsxRuntimeExports.jsxs("div", { className: "flex gap-2 relative", children: [jsxRuntimeExports.jsx("textarea", { value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder: ((_d = widget.config) === null || _d === void 0 ? void 0 : _d.placeholder) || "Type a message...", className: "resize-none h-20 overflow-y-auto flex-1 px-3 py-2 text-
|
|
39253
|
+
: "bg-gray-100 text-gray-900"), children: [jsxRuntimeExports.jsx("div", { className: "whitespace-pre-wrap", children: jsxRuntimeExports.jsx(Markdown, { children: message.content }) }), message.createdAt && (jsxRuntimeExports.jsx("div", { className: cn("text-[10px] mt-1", message.role === "user" ? "text-primary-100" : "text-gray-500"), children: new Date(message.createdAt).toLocaleTimeString() }))] }) }, message.id))), isLoading && (jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: jsxRuntimeExports.jsx("div", { className: "bg-gray-100 rounded-lg px-4 py-2 text-xs", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "flex space-x-1", children: [jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '0ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '150ms' } }), jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: '300ms' } })] }), jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: "Thinking..." })] }) }) })), jsxRuntimeExports.jsx("div", { ref: messagesEndRef })] })) }), jsxRuntimeExports.jsx("form", { onSubmit: handleSubmit, className: "border-t border-slate-200 p-4", children: jsxRuntimeExports.jsxs("div", { className: "flex gap-2 relative", children: [jsxRuntimeExports.jsx("textarea", { value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder: ((_d = widget.config) === null || _d === void 0 ? void 0 : _d.placeholder) || "Type a message...", className: "resize-none h-20 overflow-y-auto flex-1 px-3 py-2 text-sm border border-slate-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500" }), jsxRuntimeExports.jsx("button", { type: "submit", disabled: !inputValue.trim(), className: cn("absolute bottom-0 right-0 p-2 rounded-lg text-white flex items-center justify-center bg-transparent"), children: jsxRuntimeExports.jsx(lucideReact.Send, { className: cn("h-5 w-5", inputValue.trim()
|
|
39253
39254
|
? "text-primary-600"
|
|
39254
39255
|
: "text-gray-600 cursor-not-allowed") }) })] }) })] })] }));
|
|
39255
39256
|
}
|