mcp-chat-ui 1.0.5 → 1.0.7
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/ChatUI.js +3 -3
- package/dist/components/Composer.js +1 -1
- package/dist/styles.css +4 -19
- package/package.json +1 -1
package/dist/ChatUI.js
CHANGED
|
@@ -1960,11 +1960,11 @@ function ChatUI(props) {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
const shouldGateView = initializeChatOnLoad && !!authToken && !initCompleted;
|
|
1962
1962
|
if (shouldGateView) {
|
|
1963
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "chatui-root flex
|
|
1963
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "chatui-root flex h-full w-full flex-col", style: themeVars, children: [(0, jsx_runtime_1.jsx)("style", { children: chatDefaults_1.CHATUI_THEME_CSS }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-1 items-center justify-center px-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-md text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm text-gray-600", children: initGateLoading
|
|
1964
1964
|
? "Initializing chat..."
|
|
1965
1965
|
: initGateError || "Initializing chat..." }), !initGateLoading && initGateError && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: `mt-4 inline-flex items-center justify-center rounded-full px-4 py-2 text-sm font-medium ${textButtonTheme}`, onClick: handleInitRetry, children: "Retry" }))] }) })] }));
|
|
1966
1966
|
}
|
|
1967
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "chatui-root flex
|
|
1967
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "chatui-root flex h-full w-full flex-col", style: themeVars, children: [(0, jsx_runtime_1.jsx)("style", { children: chatDefaults_1.CHATUI_THEME_CSS }), (0, jsx_runtime_1.jsx)(TopBar_1.default, { sessionId: sessionId, authToken: authToken, onClearChat: clearChat, onLogout: doLogout, onInitOpen: () => {
|
|
1968
1968
|
if (initPanelEnabled) {
|
|
1969
1969
|
setShowInitPanel(true);
|
|
1970
1970
|
}
|
|
@@ -1999,7 +1999,7 @@ function ChatUI(props) {
|
|
|
1999
1999
|
setViewerLoading(true);
|
|
2000
2000
|
setViewerUrl(blobUrl);
|
|
2001
2001
|
setViewerKey((k) => k + 1);
|
|
2002
|
-
}, takeActionProceedOpen: takeActionProceedOpen, takeActionSubmitting: takeActionSubmitting, takeActionError: takeActionError, onProceedTakeAction: proceedTakeAction, textButtonTheme: textButtonTheme, text: text.documentViewer }), isEmptyState ? ((0, jsx_runtime_1.jsx)("div", { className: "
|
|
2002
|
+
}, takeActionProceedOpen: takeActionProceedOpen, takeActionSubmitting: takeActionSubmitting, takeActionError: takeActionError, onProceedTakeAction: proceedTakeAction, textButtonTheme: textButtonTheme, text: text.documentViewer }), isEmptyState ? ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-1 items-center justify-center px-2 py-6 sm:px-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "w-full max-w-3xl -translate-y-[23vh]", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-6 text-center text-[2.43rem] font-semibold leading-tight text-gray-800", children: text.emptyState.title }), (0, jsx_runtime_1.jsx)(Composer_1.default, { fileInputRef: fileInputRef, composerRef: composerRef, selectedTaskCard: selectedTaskCard, selectedFiles: selectedFiles, onClearSelected: clearSelected, onUpload: handleUpload, input: input, onInputChange: (value) => {
|
|
2003
2003
|
setInput(value);
|
|
2004
2004
|
if (composerRef.current) {
|
|
2005
2005
|
autosizeTextarea(composerRef.current);
|
|
@@ -11,7 +11,7 @@ const VoiceOverlay_1 = __importDefault(require("./VoiceOverlay"));
|
|
|
11
11
|
function Composer({ fileInputRef, composerRef, selectedTaskCard, selectedFiles, onClearSelected, onUpload, input, onInputChange, onInputKeyDown, onInputFocus, inputIsRtl, inputLocale, authToken, sessionId, pending, voiceMode, voiceUploading, waveData, onToggleVoice, onSendMessage, voiceError, canSend, onCancelVoice, onConfirmVoice, onAttachClick, onClearSelectedTask, dockToBottom = false, text, voiceOverlayText, }) {
|
|
12
12
|
var _a;
|
|
13
13
|
const containerClass = dockToBottom
|
|
14
|
-
? "
|
|
14
|
+
? "sticky bottom-0 bg-white/95 px-2 py-4 backdrop-blur sm:px-4"
|
|
15
15
|
: "relative bg-white/95 px-2 py-4 backdrop-blur sm:px-4";
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)("div", { className: containerClass, children: (0, jsx_runtime_1.jsx)("div", { className: "mx-auto w-full max-w-3xl", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsx)(VoiceOverlay_1.default, { voiceMode: voiceMode, waveData: waveData, voiceUploading: voiceUploading, onCancel: onCancelVoice, onConfirm: onConfirmVoice, text: voiceOverlayText }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap items-end gap-2 rounded-full bg-white px-3 py-2 shadow-[0_10px_40px_rgba(0,0,0,0.08)] ring-1 ring-[#252525]/5 sm:flex-nowrap", children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", multiple: true, className: "hidden", onChange: (e) => onUpload(e.target.files) }), (0, jsx_runtime_1.jsx)("button", { onClick: onAttachClick, disabled: !sessionId, className: (0, classNames_1.classNames)("inline-flex h-9 w-9 items-center justify-center bg-transparent text-gray-700 transition", !sessionId && "opacity-60"), title: text.attachTitle, children: (0, jsx_runtime_1.jsx)(lu_1.LuPlus, { className: "h-5 w-5" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative flex-1", children: [selectedTaskCard && ((0, jsx_runtime_1.jsx)("div", { className: "mb-2 flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-2 rounded-full bg-blue-100 px-3 py-1 text-xs font-semibold text-blue-700 shadow-sm", children: [(0, jsx_runtime_1.jsxs)("span", { children: [text.selectedTaskPrefix, String((_a = selectedTaskCard.RequestId) !== null && _a !== void 0 ? _a : "")] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "inline-flex h-4 w-4 items-center justify-center rounded-full bg-blue-700 text-blue-100 transition hover:bg-blue-800", onClick: onClearSelectedTask, title: text.selectedTaskClearTitle, "aria-label": text.selectedTaskClearTitle, children: (0, jsx_runtime_1.jsx)(lu_1.LuX, { className: "h-3 w-3" }) })] }) })), selectedFiles.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "mb-2 flex flex-wrap gap-2", children: selectedFiles.map((f, i) => ((0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-2 rounded-2xl border bg-white px-3 py-1 text-xs shadow-sm", children: [(0, jsx_runtime_1.jsx)(lu_1.LuPaperclip, { className: "h-3.5 w-3.5" }), " ", f.name, (0, jsx_runtime_1.jsx)("button", { className: "rounded-full p-0.5 hover:bg-gray-100", onClick: () => onClearSelected(i), children: (0, jsx_runtime_1.jsx)(lu_1.LuX, { className: "h-3.5 w-3.5" }) })] }, i))) })), (0, jsx_runtime_1.jsx)("textarea", { ref: composerRef, value: input, onChange: (e) => onInputChange(e.target.value), onFocus: onInputFocus, onKeyDown: onInputKeyDown, rows: 1, disabled: !authToken, dir: inputIsRtl ? "rtl" : "ltr", lang: inputLocale, placeholder: !authToken
|
|
17
17
|
? text.placeholderAuthRequired
|
package/dist/styles.css
CHANGED
|
@@ -567,18 +567,12 @@ video {
|
|
|
567
567
|
.bottom-0 {
|
|
568
568
|
bottom: 0px;
|
|
569
569
|
}
|
|
570
|
-
.bottom-1\/2 {
|
|
571
|
-
bottom: 50%;
|
|
572
|
-
}
|
|
573
570
|
.bottom-2 {
|
|
574
571
|
bottom: 0.5rem;
|
|
575
572
|
}
|
|
576
573
|
.bottom-3 {
|
|
577
574
|
bottom: 0.75rem;
|
|
578
575
|
}
|
|
579
|
-
.left-0 {
|
|
580
|
-
left: 0px;
|
|
581
|
-
}
|
|
582
576
|
.left-1\/2 {
|
|
583
577
|
left: 50%;
|
|
584
578
|
}
|
|
@@ -612,9 +606,6 @@ video {
|
|
|
612
606
|
.z-10 {
|
|
613
607
|
z-index: 10;
|
|
614
608
|
}
|
|
615
|
-
.z-20 {
|
|
616
|
-
z-index: 20;
|
|
617
|
-
}
|
|
618
609
|
.z-40 {
|
|
619
610
|
z-index: 40;
|
|
620
611
|
}
|
|
@@ -718,15 +709,9 @@ video {
|
|
|
718
709
|
.min-h-0 {
|
|
719
710
|
min-height: 0px;
|
|
720
711
|
}
|
|
721
|
-
.min-h-\[100dvh\] {
|
|
722
|
-
min-height: 100dvh;
|
|
723
|
-
}
|
|
724
712
|
.min-h-\[110px\] {
|
|
725
713
|
min-height: 110px;
|
|
726
714
|
}
|
|
727
|
-
.min-h-screen {
|
|
728
|
-
min-height: 100vh;
|
|
729
|
-
}
|
|
730
715
|
.w-1\.5 {
|
|
731
716
|
width: 0.375rem;
|
|
732
717
|
}
|
|
@@ -787,14 +772,14 @@ video {
|
|
|
787
772
|
.shrink-0 {
|
|
788
773
|
flex-shrink: 0;
|
|
789
774
|
}
|
|
790
|
-
.-translate-x-1\/2 {
|
|
791
|
-
--tw-translate-x: -50%;
|
|
792
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
793
|
-
}
|
|
794
775
|
.-translate-y-1\/2 {
|
|
795
776
|
--tw-translate-y: -50%;
|
|
796
777
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
797
778
|
}
|
|
779
|
+
.-translate-y-\[23vh\] {
|
|
780
|
+
--tw-translate-y: -23vh;
|
|
781
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
782
|
+
}
|
|
798
783
|
.transform {
|
|
799
784
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
800
785
|
}
|