@admin-layout/tailwind-chat-pro 12.2.4-alpha.81 → 12.2.4-alpha.82
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/CHANGELOG.md +6 -0
- package/lib/components/messages-container-ui/ErrorFixCard.d.ts +10 -0
- package/lib/components/messages-container-ui/ErrorFixCard.d.ts.map +1 -0
- package/lib/components/messages-container-ui/ErrorFixCard.js +219 -0
- package/lib/components/messages-container-ui/ErrorFixCard.js.map +1 -0
- package/lib/components/messages-container-ui/FilesList.d.ts +19 -0
- package/lib/components/messages-container-ui/FilesList.d.ts.map +1 -0
- package/lib/components/messages-container-ui/FilesList.js +75 -0
- package/lib/components/messages-container-ui/FilesList.js.map +1 -0
- package/lib/components/messages-container-ui/ModernMessageGroup.d.ts +46 -0
- package/lib/components/messages-container-ui/ModernMessageGroup.d.ts.map +1 -0
- package/lib/components/messages-container-ui/ModernMessageGroup.js +1883 -0
- package/lib/components/messages-container-ui/ModernMessageGroup.js.map +1 -0
- package/lib/components/messages-container-ui/index.d.ts +3 -0
- package/lib/components/messages-container-ui/index.d.ts.map +1 -1
- package/lib/components/messages-container-ui/messenger-slot-fill-name-enum.d.ts +14 -0
- package/lib/components/messages-container-ui/messenger-slot-fill-name-enum.d.ts.map +1 -0
- package/lib/components/messages-container-ui/messenger-slot-fill-name-enum.js +14 -0
- package/lib/components/messages-container-ui/messenger-slot-fill-name-enum.js.map +1 -0
- package/lib/components/messages-container-ui/modernStreaming.d.ts +11 -0
- package/lib/components/messages-container-ui/modernStreaming.d.ts.map +1 -0
- package/lib/components/messages-container-ui/modernStreaming.js +17 -0
- package/lib/components/messages-container-ui/modernStreaming.js.map +1 -0
- package/lib/index.js +1 -1
- package/package.json +11 -5
- package/src/components/messages-container-ui/ErrorFixCard.tsx +239 -0
- package/src/components/messages-container-ui/FilesList.tsx +89 -0
- package/src/components/messages-container-ui/ModernMessageGroup.tsx +2224 -0
- package/src/components/messages-container-ui/index.ts +10 -0
- package/src/components/messages-container-ui/messenger-slot-fill-name-enum.ts +13 -0
- package/src/components/messages-container-ui/modernStreaming.tsx +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [12.2.4-alpha.82](https://github.com/CDEBase/admin-layout/compare/v12.2.4-alpha.81...v12.2.4-alpha.82) (2026-06-30)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **tailwind-chat-pro:** bring the rich Modern message renderer in-package ([f30b75b](https://github.com/CDEBase/admin-layout/commit/f30b75b11782d6e63bef333b53e09c74acea51a3)), closes [#1652](https://github.com/CDEBase/admin-layout/issues/1652)
|
|
11
|
+
|
|
6
12
|
## [12.2.4-alpha.81](https://github.com/CDEBase/admin-layout/compare/v12.2.4-alpha.80...v12.2.4-alpha.81) (2026-06-29)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @admin-layout/tailwind-chat-pro
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ErrorFixCardProps {
|
|
3
|
+
error: any;
|
|
4
|
+
onFixError: (errorMessage: string) => Promise<void>;
|
|
5
|
+
currentFiles?: Record<string, string>;
|
|
6
|
+
isFixing?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ErrorFixCard: React.FC<ErrorFixCardProps>;
|
|
9
|
+
export default ErrorFixCard;
|
|
10
|
+
//# sourceMappingURL=ErrorFixCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorFixCard.d.ts","sourceRoot":"","sources":["../../../src/components/messages-container-ui/ErrorFixCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAkExC,UAAU,iBAAiB;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmKpD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {useState}from'react';const IconAlertTriangle = props => jsxs("svg", {
|
|
2
|
+
viewBox: "0 0 24 24",
|
|
3
|
+
fill: "none",
|
|
4
|
+
stroke: "currentColor",
|
|
5
|
+
strokeWidth: "2",
|
|
6
|
+
strokeLinecap: "round",
|
|
7
|
+
strokeLinejoin: "round",
|
|
8
|
+
...props,
|
|
9
|
+
children: [jsx("path", {
|
|
10
|
+
d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"
|
|
11
|
+
}), jsx("line", {
|
|
12
|
+
x1: "12",
|
|
13
|
+
y1: "9",
|
|
14
|
+
x2: "12",
|
|
15
|
+
y2: "13"
|
|
16
|
+
}), jsx("line", {
|
|
17
|
+
x1: "12",
|
|
18
|
+
y1: "17",
|
|
19
|
+
x2: "12.01",
|
|
20
|
+
y2: "17"
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
const IconRefreshCw = props => jsxs("svg", {
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: "none",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeWidth: "2",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round",
|
|
30
|
+
...props,
|
|
31
|
+
children: [jsx("polyline", {
|
|
32
|
+
points: "23 4 23 10 17 10"
|
|
33
|
+
}), jsx("polyline", {
|
|
34
|
+
points: "1 20 1 14 7 14"
|
|
35
|
+
}), jsx("path", {
|
|
36
|
+
d: "M3.51 9a9 9 0 0114.13-3.36L23 10"
|
|
37
|
+
}), jsx("path", {
|
|
38
|
+
d: "M20.49 15a9 9 0 01-14.13 3.36L1 14"
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
const IconCode = props => jsxs("svg", {
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "2",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round",
|
|
48
|
+
...props,
|
|
49
|
+
children: [jsx("polyline", {
|
|
50
|
+
points: "16 18 22 12 16 6"
|
|
51
|
+
}), jsx("polyline", {
|
|
52
|
+
points: "8 6 2 12 8 18"
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
const IconExternalLink = props => jsxs("svg", {
|
|
56
|
+
viewBox: "0 0 24 24",
|
|
57
|
+
fill: "none",
|
|
58
|
+
stroke: "currentColor",
|
|
59
|
+
strokeWidth: "2",
|
|
60
|
+
strokeLinecap: "round",
|
|
61
|
+
strokeLinejoin: "round",
|
|
62
|
+
...props,
|
|
63
|
+
children: [jsx("path", {
|
|
64
|
+
d: "M18 13v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
|
|
65
|
+
}), jsx("polyline", {
|
|
66
|
+
points: "15 3 21 3 21 9"
|
|
67
|
+
}), jsx("line", {
|
|
68
|
+
x1: "10",
|
|
69
|
+
y1: "14",
|
|
70
|
+
x2: "21",
|
|
71
|
+
y2: "3"
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
const ErrorFixCard = ({
|
|
75
|
+
error,
|
|
76
|
+
onFixError,
|
|
77
|
+
currentFiles,
|
|
78
|
+
isFixing = false
|
|
79
|
+
}) => {
|
|
80
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
81
|
+
const [isFixingError, setIsFixingError] = useState(false);
|
|
82
|
+
const handleFixError = async () => {
|
|
83
|
+
setIsFixingError(true);
|
|
84
|
+
try {
|
|
85
|
+
const errorContext = `
|
|
86
|
+
ERROR DETECTED IN SANDBOX:
|
|
87
|
+
|
|
88
|
+
Error Type: ${error.errorType}
|
|
89
|
+
Timestamp: ${error.timestamp}
|
|
90
|
+
Sandbox ID: ${error.sandboxId}
|
|
91
|
+
|
|
92
|
+
Error Message:
|
|
93
|
+
${error.message}
|
|
94
|
+
|
|
95
|
+
${error.stack ? `Stack Trace:\n${error.stack}` : ''}
|
|
96
|
+
|
|
97
|
+
${currentFiles && Object.keys(currentFiles).length > 0 ? `
|
|
98
|
+
Current Files in Project:
|
|
99
|
+
${Object.entries(currentFiles).map(([path, content]) => `
|
|
100
|
+
--- ${path} ---
|
|
101
|
+
${content}
|
|
102
|
+
`).join('\n')}
|
|
103
|
+
` : ''}
|
|
104
|
+
|
|
105
|
+
Please analyze this error and fix the code. Make sure to:
|
|
106
|
+
1. Identify the root cause of the error
|
|
107
|
+
2. Update the necessary files to resolve the issue
|
|
108
|
+
3. Ensure the fix maintains the existing functionality
|
|
109
|
+
4. Test that the solution compiles and runs correctly
|
|
110
|
+
`.trim();
|
|
111
|
+
await onFixError(errorContext);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
console.error('Failed to trigger error fix:', error);
|
|
114
|
+
} finally {
|
|
115
|
+
setIsFixingError(false);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const getErrorTypeColor = errorType => {
|
|
119
|
+
switch (errorType) {
|
|
120
|
+
case 'COMPILATION_ERROR':
|
|
121
|
+
return 'text-red-600 bg-red-50 border-red-200';
|
|
122
|
+
case 'RUNTIME_ERROR':
|
|
123
|
+
return 'text-orange-600 bg-orange-50 border-orange-200';
|
|
124
|
+
case 'DEPENDENCY_ERROR':
|
|
125
|
+
return 'text-yellow-600 bg-yellow-50 border-yellow-200';
|
|
126
|
+
case 'SERVER_START_ERROR':
|
|
127
|
+
return 'text-purple-600 bg-purple-50 border-purple-200';
|
|
128
|
+
case 'SANDBOX_DISCONNECTED':
|
|
129
|
+
return 'text-gray-600 bg-gray-50 border-gray-200';
|
|
130
|
+
case 'TEST_ERROR':
|
|
131
|
+
return 'text-blue-600 bg-blue-50 border-blue-200';
|
|
132
|
+
default:
|
|
133
|
+
return 'text-red-600 bg-red-50 border-red-200';
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const formatErrorType = errorType => {
|
|
137
|
+
return errorType.replace(/_/g, ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase());
|
|
138
|
+
};
|
|
139
|
+
return jsx("div", {
|
|
140
|
+
className: "flex w-full justify-start mb-2",
|
|
141
|
+
children: jsxs("div", {
|
|
142
|
+
className: `rounded-lg p-2 border w-fit max-w-[75%] min-w-0 break-all overflow-hidden ${getErrorTypeColor(error.errorType)}`,
|
|
143
|
+
children: [jsx("div", {
|
|
144
|
+
className: "flex items-start justify-between mb-1",
|
|
145
|
+
children: jsxs("div", {
|
|
146
|
+
className: "flex items-center space-x-1",
|
|
147
|
+
children: [jsx(IconAlertTriangle, {
|
|
148
|
+
className: "w-3 h-3 text-red-600 flex-shrink-0"
|
|
149
|
+
}), jsx("span", {
|
|
150
|
+
className: "font-semibold text-xs",
|
|
151
|
+
children: formatErrorType(error.errorType)
|
|
152
|
+
}), jsx("span", {
|
|
153
|
+
className: "text-xs opacity-60",
|
|
154
|
+
children: new Date(error.timestamp).toLocaleTimeString()
|
|
155
|
+
}), error.url && jsxs("a", {
|
|
156
|
+
href: error.url,
|
|
157
|
+
target: "_blank",
|
|
158
|
+
rel: "noopener noreferrer",
|
|
159
|
+
className: "text-xs hover:underline flex items-center space-x-1",
|
|
160
|
+
children: [jsx(IconExternalLink, {
|
|
161
|
+
className: "w-3 h-3"
|
|
162
|
+
}), jsx("span", {
|
|
163
|
+
children: "View Sandbox"
|
|
164
|
+
})]
|
|
165
|
+
})]
|
|
166
|
+
})
|
|
167
|
+
}), jsxs("div", {
|
|
168
|
+
className: "text-sm mb-3",
|
|
169
|
+
children: [jsx("div", {
|
|
170
|
+
className: "break-words whitespace-pre-wrap font-mono text-xs leading-relaxed overflow-hidden",
|
|
171
|
+
style: {
|
|
172
|
+
display: '-webkit-box',
|
|
173
|
+
WebkitLineClamp: isExpanded ? 'none' : 3,
|
|
174
|
+
WebkitBoxOrient: 'vertical',
|
|
175
|
+
maxHeight: isExpanded ? 'none' : '3.6em'
|
|
176
|
+
},
|
|
177
|
+
children: error.message
|
|
178
|
+
}), error.message.length > 150 && jsx("button", {
|
|
179
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
180
|
+
className: "text-xs hover:underline mt-1 font-sans",
|
|
181
|
+
children: isExpanded ? 'Show less' : 'Show more'
|
|
182
|
+
})]
|
|
183
|
+
}), isExpanded && error.stack && jsxs("div", {
|
|
184
|
+
className: "mt-3 p-3 bg-black bg-opacity-10 rounded text-xs font-mono",
|
|
185
|
+
children: [jsxs("div", {
|
|
186
|
+
className: "flex items-center space-x-2 mb-2",
|
|
187
|
+
children: [jsx(IconCode, {
|
|
188
|
+
className: "w-3 h-3"
|
|
189
|
+
}), jsx("span", {
|
|
190
|
+
className: "font-semibold",
|
|
191
|
+
children: "Stack Trace"
|
|
192
|
+
})]
|
|
193
|
+
}), jsx("pre", {
|
|
194
|
+
className: "whitespace-pre-wrap text-xs break-all",
|
|
195
|
+
children: error.stack
|
|
196
|
+
})]
|
|
197
|
+
}), error.fixable && jsx("div", {
|
|
198
|
+
className: "mt-4 flex justify-start",
|
|
199
|
+
children: jsxs("button", {
|
|
200
|
+
onClick: handleFixError,
|
|
201
|
+
disabled: isFixingError || isFixing,
|
|
202
|
+
className: `
|
|
203
|
+
flex items-center space-x-2 px-4 py-2 rounded-md text-sm font-medium
|
|
204
|
+
transition-colors duration-200
|
|
205
|
+
${isFixingError || isFixing ? 'bg-gray-100 text-gray-400 cursor-not-allowed' : 'bg-red-600 text-white hover:bg-red-700 shadow-sm hover:shadow-md'}
|
|
206
|
+
`,
|
|
207
|
+
children: [jsx(IconRefreshCw, {
|
|
208
|
+
className: `w-4 h-4 ${isFixingError || isFixing ? 'animate-spin' : ''}`
|
|
209
|
+
}), jsx("span", {
|
|
210
|
+
children: isFixingError || isFixing ? 'Fixing...' : 'Fix Error'
|
|
211
|
+
})]
|
|
212
|
+
})
|
|
213
|
+
}), !error.fixable && jsx("div", {
|
|
214
|
+
className: "mt-3 text-xs opacity-75",
|
|
215
|
+
children: "This error may require manual intervention or environment changes."
|
|
216
|
+
})]
|
|
217
|
+
})
|
|
218
|
+
});
|
|
219
|
+
};export{ErrorFixCard};//# sourceMappingURL=ErrorFixCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorFixCard.js","sources":["../../../src/components/messages-container-ui/ErrorFixCard.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"sEAEA,MAAM,iBAAiB,GAA4C,KAAC,QAChE,CAAA,KAAA,EAAA;AAeJ,EAAA,OAAM,EAAA,WAAyD;AAiB/D,EAAA,IAAM,EAAA,MAAQ;AAed,EAAA,MAAM,EAAA,cAAgB;AAuBtB,EAAA,WAAa,EAAA,GAAA;eACF,EAAA,OAAY;gBACZ,EAAA,OAAa;AAEpB,EAAA,GAAA,KAAM;UACF,EAAA,CAAAA,GAAA,CAAA,MAAgB,EAAC;AACjB,IAAA,CAAA,EAAA;AACI,GAAA,CAAA,EAAAA,GAAA,CAAA,MAAA;;;AAGE,IAAA,EAAA,EAAA,IAAA;AACD,IAAA,EAAA,EAAA;AACC,GAAA,CAAA,EAAAA,GAAA,CAAA,MAAA,EAAK;;;AAGjB,IAAA,EAAA,EAAM,OAAO;;AAEb,GAAA,CAAA;;MAGE,aAAgB,GAAA,KAAO,cAAiB,EAAE;AACtC,EAAA,OAAA,EAAA,WAAE;;AAER,EAAA,MAAM,EAAC,cAAQ;;eAGP,EAAA,OAAA;EACR,cAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface FilesListProps {
|
|
2
|
+
files: any[];
|
|
3
|
+
uploaded?: boolean;
|
|
4
|
+
FileElementProps?: Omit<FileElementProps, 'file' | 'uploaded' | 'onRemove'>;
|
|
5
|
+
onRemove?: () => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
interface FileElementProps {
|
|
8
|
+
file: any;
|
|
9
|
+
uploaded: boolean;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
onRemove?: () => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function FilesList({ files, uploaded }: FilesListProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace FilesList {
|
|
16
|
+
var FileElement: ({ file, uploaded, width, height }: FileElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=FilesList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilesList.d.ts","sourceRoot":"","sources":["../../../src/components/messages-container-ui/FilesList.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACpB,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED,UAAU,gBAAgB;IACtB,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE,cAAc,2CAQpE;yBARe,SAAS;yDAU+C,gBAAgB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useMemo}from'react';import {useFileUrlQuery}from'common/graphql';function FilesList({
|
|
2
|
+
files,
|
|
3
|
+
uploaded = false
|
|
4
|
+
}) {
|
|
5
|
+
return jsx("div", {
|
|
6
|
+
className: "flex flex-row",
|
|
7
|
+
children: files.map((file, index) => jsx(FilesList.FileElement, {
|
|
8
|
+
uploaded: uploaded,
|
|
9
|
+
file: file
|
|
10
|
+
}, `${index}`))
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
FilesList.FileElement = ({
|
|
14
|
+
file,
|
|
15
|
+
uploaded,
|
|
16
|
+
width = 120,
|
|
17
|
+
height = 120
|
|
18
|
+
}) => {
|
|
19
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
const src = useMemo(() => uploaded ? file.url : URL.createObjectURL(file), [file, uploaded]);
|
|
21
|
+
const {
|
|
22
|
+
data
|
|
23
|
+
} = useFileUrlQuery({
|
|
24
|
+
variables: {
|
|
25
|
+
id: file?.id
|
|
26
|
+
},
|
|
27
|
+
skip: !file?.id
|
|
28
|
+
});
|
|
29
|
+
const onOpen = () => setIsOpen(true);
|
|
30
|
+
const onClose = () => setIsOpen(false);
|
|
31
|
+
return jsxs(Fragment, {
|
|
32
|
+
children: [jsx("img", {
|
|
33
|
+
className: "cursor-pointer m-2 object-cover rounded",
|
|
34
|
+
style: {
|
|
35
|
+
height: `${height}px`,
|
|
36
|
+
width: `${width}px`
|
|
37
|
+
},
|
|
38
|
+
src: src,
|
|
39
|
+
onClick: onOpen,
|
|
40
|
+
alt: "File preview"
|
|
41
|
+
}), isOpen && jsxs("div", {
|
|
42
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
43
|
+
children: [jsx("div", {
|
|
44
|
+
className: "fixed inset-0 bg-black bg-opacity-75",
|
|
45
|
+
onClick: onClose
|
|
46
|
+
}), jsxs("div", {
|
|
47
|
+
className: "relative bg-white rounded-lg shadow-xl max-w-4xl max-h-[90vh] overflow-hidden",
|
|
48
|
+
children: [jsx("button", {
|
|
49
|
+
onClick: onClose,
|
|
50
|
+
className: "absolute top-4 right-4 z-10 p-2 rounded-full bg-black bg-opacity-50 hover:bg-opacity-70 transition-all duration-200",
|
|
51
|
+
children: jsx("svg", {
|
|
52
|
+
className: "w-6 h-6 text-white",
|
|
53
|
+
fill: "none",
|
|
54
|
+
stroke: "currentColor",
|
|
55
|
+
viewBox: "0 0 24 24",
|
|
56
|
+
children: jsx("path", {
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round",
|
|
59
|
+
strokeWidth: 2,
|
|
60
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
}), jsx("div", {
|
|
64
|
+
className: "p-4 flex items-center justify-center",
|
|
65
|
+
children: jsx("img", {
|
|
66
|
+
src: data?.fileInfo?.url || src,
|
|
67
|
+
alt: "File full view",
|
|
68
|
+
className: "max-w-full max-h-[80vh] object-contain cursor-pointer",
|
|
69
|
+
onClick: onClose
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
};export{FilesList};//# sourceMappingURL=FilesList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilesList.js","sources":["../../../src/components/messages-container-ui/FilesList.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"oIAkBM,SAAU,SAAS,CAAC;AACtB,EAAA,KAAA;AAOJ,EAAC,QAAA,GAAA;AAED,CAAA,EAAA;SACIA,GAAO,CAAA,KAAQ,EAAA;AACf,IAAA,SAAS,EAAA,eAAiB;AAC1B,IAAA,QAAQ,EAAA,KAAM,CAAA,gBAAkB,KAACA,GAAA,CAAA,SAAA,CAAA,WAAA,EAAA;AAC7B,MAAA,QAAA,EAAA,QAAW;YACP;AACH,KAAA,EAAA,CAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACD,GAAA,CAAA;AACH;SAED,CAAM,WAAS,GAAK,CAAC;MACrB;AAEA,EAAA,QAAA;AA+CJ,EAAE,KAAA,GAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IAuthUser, IPost } from 'common';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function AssistantResponseWrapper({ children, bubbleClassName, }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
bubbleClassName?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
interface ModernMessageGroupProps {
|
|
8
|
+
showAuthorName?: boolean;
|
|
9
|
+
showAvatar?: boolean;
|
|
10
|
+
showTimestamp?: boolean;
|
|
11
|
+
messages: IPost[];
|
|
12
|
+
currentUser: IAuthUser;
|
|
13
|
+
onOpen: (element?: any) => void;
|
|
14
|
+
onMessageClick: (msg: IPost) => void;
|
|
15
|
+
isDesktopView?: boolean;
|
|
16
|
+
isSmallScreen?: boolean;
|
|
17
|
+
sandboxErrors?: any[];
|
|
18
|
+
currentFiles?: Record<string, string>;
|
|
19
|
+
onFixError?: (errorMessage: string) => Promise<void>;
|
|
20
|
+
onRecreateSandbox?: (fragmentId: string) => void;
|
|
21
|
+
/** When true, code blocks show copy and download actions in header and footer (default: true) */
|
|
22
|
+
showCopyDownloadOnCodeBlock?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const groupMessagesByUserAndTime: (messages: IPost[], timeThresholdMinutes?: number) => IPost[][];
|
|
25
|
+
export declare const detectContentType: (value: string) => "html" | "markdown" | "code" | "text";
|
|
26
|
+
export declare const CodeFormatter: React.FC<{
|
|
27
|
+
content: string;
|
|
28
|
+
showCopyDownload?: boolean;
|
|
29
|
+
variant?: 'default' | 'user';
|
|
30
|
+
/** When variant is `user`, use primary-foreground only on plan-mode bubbles (bg-primary). */
|
|
31
|
+
planMode?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const FormattedMessageContent: React.FC<{
|
|
34
|
+
content: string;
|
|
35
|
+
variant?: 'default' | 'user';
|
|
36
|
+
/** When variant is `user`, use primary-foreground only on plan-mode bubbles (bg-primary). */
|
|
37
|
+
planMode?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* When true, fenced code blocks use the same copy/download UI as elsewhere.
|
|
40
|
+
* Implemented via react-markdown (safe) instead of raw HTML from marked.
|
|
41
|
+
*/
|
|
42
|
+
showCopyDownloadOnCodeBlock?: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const ModernMessageGroupComponent: React.FC<ModernMessageGroupProps>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=ModernMessageGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModernMessageGroup.d.ts","sourceRoot":"","sources":["../../../src/components/messages-container-ui/ModernMessageGroup.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,SAAS,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG9D,OAAO,KAA6B,MAAM,OAAO,CAAC;AA2BlD,wBAAgB,wBAAwB,CAAC,EACrC,QAAQ,EACR,eAAe,GAClB,EAAE;IACC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,2CAUA;AAmuBD,UAAU,uBAAuB;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ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