@molecule/app-ide-react 1.3.2 → 1.3.3
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.
|
@@ -52,12 +52,6 @@ export declare function CommitCardItem({ card, onRevert, }: {
|
|
|
52
52
|
/** Props for the memoized per-message timeline row (see {@link MessageItem}). */
|
|
53
53
|
export interface MessageItemProps {
|
|
54
54
|
msg: ChatMessage;
|
|
55
|
-
editingQueuedId: string | null;
|
|
56
|
-
editingQueuedText: string;
|
|
57
|
-
setEditingQueuedId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
58
|
-
setEditingQueuedText: React.Dispatch<React.SetStateAction<string>>;
|
|
59
|
-
editQueuedMessage: (id: string, content: string) => void;
|
|
60
|
-
deleteQueuedMessage: (id: string) => void;
|
|
61
55
|
sendMessage: (msg: string) => void;
|
|
62
56
|
handleAskUserResponse: (response: string) => void;
|
|
63
57
|
isLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAY3C,OAAO,KAAK,EAAa,WAAW,EAAmB,MAAM,uBAAuB,CAAA;AAuCpF,OAAO,KAAK,EAAE,cAAc,EAAoB,eAAe,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AA0BvD,OAAO,KAAK,EAAsB,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAqLnF,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;IACp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,gBAAgB,EAAE,0BAA0B,EAC5C,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,sBAAsB,EACxC,kBAAkB,EAAE,wBAAwB,EAC5C,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA6b9B;yBAjfe,SAAS"}
|
|
@@ -928,7 +928,7 @@ export function CommitCardItem({ card, onRevert, }) {
|
|
|
928
928
|
* @returns The rendered message item.
|
|
929
929
|
*/
|
|
930
930
|
const MessageItem = memo(function MessageItem(props) {
|
|
931
|
-
const { msg,
|
|
931
|
+
const { msg, sendMessage, handleAskUserResponse, isLoading, streamingStatus, onNavigatePreview, undoneTcIds, handleUndoToggle, onFileOpen, onFileDoubleClick, onFileDiff, handleFileRevert, setInputAndCursorEnd, setModelPicker, userAvatar, onAvatarClick, discovery, buildUpgradeCta, } = props;
|
|
932
932
|
const cm = getClassMap();
|
|
933
933
|
const themeMode = useThemeMode();
|
|
934
934
|
const isLight = themeMode === 'light';
|
|
@@ -984,101 +984,7 @@ const MessageItem = memo(function MessageItem(props) {
|
|
|
984
984
|
? '\uD83C\uDFB5'
|
|
985
985
|
: att.mediaType.startsWith('video/')
|
|
986
986
|
? '\uD83C\uDFA5'
|
|
987
|
-
: '\uD83D\uDCC4', ' ', att.filename, _jsxs("span", { style: { fontSize: 10, opacity: 0.7 }, children: ["(", formatSize(att.size), ")"] })] }, ai))) }))
|
|
988
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
989
|
-
e.preventDefault();
|
|
990
|
-
const trimmed = editingQueuedText.trim();
|
|
991
|
-
if (trimmed)
|
|
992
|
-
editQueuedMessage(msg.id, trimmed);
|
|
993
|
-
else
|
|
994
|
-
deleteQueuedMessage(msg.id);
|
|
995
|
-
setEditingQueuedId(null);
|
|
996
|
-
}
|
|
997
|
-
if (e.key === 'Escape')
|
|
998
|
-
setEditingQueuedId(null);
|
|
999
|
-
}, className: cm.cn(cm.surface, cm.textSize('sm')), style: {
|
|
1000
|
-
width: '100%',
|
|
1001
|
-
minHeight: '60px',
|
|
1002
|
-
padding: '8px 10px',
|
|
1003
|
-
border: `1px solid ${borderClr}`,
|
|
1004
|
-
borderRadius: '6px',
|
|
1005
|
-
resize: 'vertical',
|
|
1006
|
-
color: 'inherit',
|
|
1007
|
-
fontFamily: 'inherit',
|
|
1008
|
-
} }), _jsxs("div", { style: { display: 'flex', gap: 6, justifyContent: 'flex-end' }, children: [_jsx("button", { type: "button", onClick: () => setEditingQueuedId(null), className: cm.textSize('xs'), style: {
|
|
1009
|
-
padding: '4px 12px',
|
|
1010
|
-
border: `1px solid ${borderClr}`,
|
|
1011
|
-
borderRadius: '4px',
|
|
1012
|
-
background: 'transparent',
|
|
1013
|
-
color: 'inherit',
|
|
1014
|
-
cursor: 'pointer',
|
|
1015
|
-
}, children: t('common.cancel', undefined, { defaultValue: 'Cancel' }) }), _jsx("button", { type: "button", onClick: () => {
|
|
1016
|
-
const trimmed = editingQueuedText.trim();
|
|
1017
|
-
if (trimmed)
|
|
1018
|
-
editQueuedMessage(msg.id, trimmed);
|
|
1019
|
-
else
|
|
1020
|
-
deleteQueuedMessage(msg.id);
|
|
1021
|
-
setEditingQueuedId(null);
|
|
1022
|
-
}, className: cm.textSize('xs'), style: {
|
|
1023
|
-
padding: '4px 12px',
|
|
1024
|
-
border: `1px solid ${borderClr}`,
|
|
1025
|
-
borderRadius: '4px',
|
|
1026
|
-
background: 'rgba(128,128,128,0.1)',
|
|
1027
|
-
color: 'inherit',
|
|
1028
|
-
cursor: 'pointer',
|
|
1029
|
-
}, children: t('common.save', undefined, { defaultValue: 'Save' }) })] })] })) : (_jsxs("div", { style: {
|
|
1030
|
-
display: 'flex',
|
|
1031
|
-
alignItems: 'center',
|
|
1032
|
-
justifyContent: 'flex-end',
|
|
1033
|
-
gap: 6,
|
|
1034
|
-
paddingRight: 4,
|
|
1035
|
-
}, children: [_jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { fontStyle: 'italic', marginRight: 'auto' }, children: t('ide.chat.queued', undefined, { defaultValue: 'Queued' }) }), _jsx("button", { type: "button", onClick: () => {
|
|
1036
|
-
setEditingQueuedId(msg.id);
|
|
1037
|
-
setEditingQueuedText(msg.content);
|
|
1038
|
-
}, className: cm.textSize('xs'), style: {
|
|
1039
|
-
padding: '3px 10px',
|
|
1040
|
-
border: `1px solid ${borderClr}`,
|
|
1041
|
-
borderRadius: '4px',
|
|
1042
|
-
background: 'rgba(128,128,128,0.1)',
|
|
1043
|
-
color: 'inherit',
|
|
1044
|
-
cursor: 'pointer',
|
|
1045
|
-
fontWeight: 500,
|
|
1046
|
-
transition: 'background 100ms',
|
|
1047
|
-
}, onMouseEnter: (e) => {
|
|
1048
|
-
e.currentTarget.style.background = 'rgba(128,128,128,0.2)';
|
|
1049
|
-
}, onMouseLeave: (e) => {
|
|
1050
|
-
e.currentTarget.style.background = 'rgba(128,128,128,0.1)';
|
|
1051
|
-
}, children: t('ide.chat.editQueued', undefined, { defaultValue: 'Edit' }) }), _jsx("button", { type: "button", onClick: () => deleteQueuedMessage(msg.id), className: cm.textSize('xs'), style: {
|
|
1052
|
-
padding: '3px 10px',
|
|
1053
|
-
border: '1px solid rgba(220,38,38,0.3)',
|
|
1054
|
-
borderRadius: '4px',
|
|
1055
|
-
background: 'rgba(220,38,38,0.08)',
|
|
1056
|
-
color: isLight ? 'rgb(185,28,28)' : 'rgb(248,113,113)',
|
|
1057
|
-
cursor: 'pointer',
|
|
1058
|
-
fontWeight: 500,
|
|
1059
|
-
transition: 'background 100ms',
|
|
1060
|
-
}, onMouseEnter: (e) => {
|
|
1061
|
-
e.currentTarget.style.background = 'rgba(220,38,38,0.18)';
|
|
1062
|
-
}, onMouseLeave: (e) => {
|
|
1063
|
-
e.currentTarget.style.background = 'rgba(220,38,38,0.08)';
|
|
1064
|
-
}, children: t('ide.chat.deleteQueued', undefined, { defaultValue: 'Delete' }) }), !isLoading && (_jsx("button", { type: "button", onClick: () => {
|
|
1065
|
-
const content = msg.content;
|
|
1066
|
-
deleteQueuedMessage(msg.id);
|
|
1067
|
-
sendMessage(content);
|
|
1068
|
-
}, className: cm.textSize('xs'), style: {
|
|
1069
|
-
padding: '3px 10px',
|
|
1070
|
-
border: '1px solid rgba(34,197,94,0.4)',
|
|
1071
|
-
borderRadius: '4px',
|
|
1072
|
-
background: 'rgba(34,197,94,0.12)',
|
|
1073
|
-
color: isLight ? 'rgb(21,128,61)' : 'rgb(74,222,128)',
|
|
1074
|
-
cursor: 'pointer',
|
|
1075
|
-
fontWeight: 500,
|
|
1076
|
-
transition: 'background 100ms',
|
|
1077
|
-
}, onMouseEnter: (e) => {
|
|
1078
|
-
e.currentTarget.style.background = 'rgba(34,197,94,0.22)';
|
|
1079
|
-
}, onMouseLeave: (e) => {
|
|
1080
|
-
e.currentTarget.style.background = 'rgba(34,197,94,0.12)';
|
|
1081
|
-
}, children: t('ide.chat.sendQueued', undefined, { defaultValue: 'Send' }) }))] })) }))] })] })) : (_jsxs("div", { children: [msg.blocks && msg.blocks.length > 0 ? (msg.blocks.map((block, bi) => {
|
|
987
|
+
: '\uD83D\uDCC4', ' ', att.filename, _jsxs("span", { style: { fontSize: 10, opacity: 0.7 }, children: ["(", formatSize(att.size), ")"] })] }, ai))) }))] })] })) : (_jsxs("div", { children: [msg.blocks && msg.blocks.length > 0 ? (msg.blocks.map((block, bi) => {
|
|
1082
988
|
const blockType = block.type;
|
|
1083
989
|
if (blockType === 'thinking') {
|
|
1084
990
|
const isLastBlock = bi === (msg.blocks?.length ?? 0) - 1;
|
|
@@ -4647,6 +4553,13 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
4647
4553
|
// already filters them on read, but guard here too so the client NEVER shows
|
|
4648
4554
|
// one — even an optimistic/in-flight hidden message.
|
|
4649
4555
|
const visibleMessages = useMemo(() => messages.filter((m) => !m.hidden), [messages]);
|
|
4556
|
+
// Queued messages (user/auto messages waiting to send while the agent works)
|
|
4557
|
+
// are NOT rendered inline in the scrolling timeline — they'd be pushed around
|
|
4558
|
+
// and reflow as the response streams. They render instead in an anchored bar
|
|
4559
|
+
// pinned above the composer (see "Queued messages" in the input area below),
|
|
4560
|
+
// the same fixed-position treatment as the commit bar. Split them out here so
|
|
4561
|
+
// the timeline never includes them.
|
|
4562
|
+
const queuedMessages = useMemo(() => visibleMessages.filter((m) => m.queued), [visibleMessages]);
|
|
4650
4563
|
// Build a renderable SystemCard from a card-message's raw CardEvent. This is the ONE
|
|
4651
4564
|
// construction, used IDENTICALLY for a live `card` event (now a card-message in `messages`)
|
|
4652
4565
|
// and for a card-message loaded on refresh — so the rendered card is the same in both, with
|
|
@@ -4749,6 +4662,9 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
4749
4662
|
// `limitType`). See {@link ChatEventCard.coversLimitType}.
|
|
4750
4663
|
const liveLimitType = error && !isStaleAnonymousLimit ? errorMeta?.limitType : undefined;
|
|
4751
4664
|
for (const msg of visibleMessages) {
|
|
4665
|
+
// Queued messages render in the anchored bar above the composer, not inline.
|
|
4666
|
+
if (msg.queued)
|
|
4667
|
+
continue;
|
|
4752
4668
|
if (msg.cardEvent) {
|
|
4753
4669
|
const card = cardEventToSystemCard(msg.cardEvent, msg.id, msg.timestamp);
|
|
4754
4670
|
if (!card)
|
|
@@ -5005,7 +4921,7 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
5005
4921
|
hash,
|
|
5006
4922
|
}, onRevert: handleRevertCommit }, msg.id));
|
|
5007
4923
|
}
|
|
5008
|
-
return (_jsx(MessageItem, { msg: msg,
|
|
4924
|
+
return (_jsx(MessageItem, { msg: msg, sendMessage: sendMessage, handleAskUserResponse: handleAskUserResponse, isLoading: isLoading, streamingStatus: streamingStatus, onNavigatePreview: onNavigatePreview, undoneTcIds: undoneTcIds, handleUndoToggle: handleUndoToggle, onFileOpen: onFileOpen, onFileDoubleClick: onFileDoubleClick, onFileDiff: onFileDiff, handleFileRevert: handleFileRevert, setInputAndCursorEnd: setInputAndCursorEnd, setModelPicker: setModelPicker, userAvatar: userAvatar, onAvatarClick: onUserAvatarClick, discovery: discovery, buildUpgradeCta: buildUpgradeCta }, msg.id));
|
|
5009
4925
|
} }, item.kind === 'message' ? item.msg.id : item.card.id))), error &&
|
|
5010
4926
|
!isStaleAnonymousLimit &&
|
|
5011
4927
|
(errorMeta?.limitType ? (_jsx(ResourceLimitBanner, { message: error, action: buildUpgradeCta?.({ requiresSignup: errorMeta.requiresSignup }) })) : (_jsx("div", { className: cm.cn(cm.textSize('sm'), cm.sp('p', 2), cm.sp('mb', 2), cm.bgErrorSubtle, cm.textError), style: { borderRadius: '6px' }, children: error }))), (() => {
|
|
@@ -6074,7 +5990,138 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
6074
5990
|
? t('ide.chat.activeFile', undefined, { defaultValue: 'active' })
|
|
6075
5991
|
: t('ide.chat.openTab', undefined, { defaultValue: 'open' }) }))] }, entry.name));
|
|
6076
5992
|
}) }));
|
|
6077
|
-
})(),
|
|
5993
|
+
})(), queuedMessages.length > 0 && !commandMenu && !modelPicker && !panelOverlay && (_jsxs("div", { style: {
|
|
5994
|
+
borderTop: '1px solid rgba(128,128,128,0.15)',
|
|
5995
|
+
padding: '6px 8px 6px 10px',
|
|
5996
|
+
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4, marginBottom: 3 }, children: [_jsx(Icon, { name: "clock", size: 11, "aria-hidden": "true", style: { opacity: 0.5, flexShrink: 0 } }), _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { fontStyle: 'italic' }, children: t('ide.chat.queuedCount', { count: queuedMessages.length }, { defaultValue: '{{count}} queued' }) })] }), _jsx("div", { style: {
|
|
5997
|
+
maxHeight: 132,
|
|
5998
|
+
overflowY: 'auto',
|
|
5999
|
+
scrollbarWidth: 'thin',
|
|
6000
|
+
display: 'flex',
|
|
6001
|
+
flexDirection: 'column',
|
|
6002
|
+
gap: 2,
|
|
6003
|
+
}, children: queuedMessages.map((qm) => editingQueuedId === qm.id ? (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 6 }, children: [_jsx("textarea", { autoFocus: true, defaultValue: editingQueuedText, onChange: (e) => setEditingQueuedText(e.target.value), onKeyDown: (e) => {
|
|
6004
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
6005
|
+
e.preventDefault();
|
|
6006
|
+
const trimmed = editingQueuedText.trim();
|
|
6007
|
+
if (trimmed)
|
|
6008
|
+
editQueuedMessage(qm.id, trimmed);
|
|
6009
|
+
else
|
|
6010
|
+
deleteQueuedMessage(qm.id);
|
|
6011
|
+
setEditingQueuedId(null);
|
|
6012
|
+
}
|
|
6013
|
+
if (e.key === 'Escape')
|
|
6014
|
+
setEditingQueuedId(null);
|
|
6015
|
+
}, className: cm.cn(cm.surface, cm.textSize('sm')), style: {
|
|
6016
|
+
width: '100%',
|
|
6017
|
+
minHeight: '52px',
|
|
6018
|
+
padding: '6px 8px',
|
|
6019
|
+
border: `1px solid ${isLight ? '#d1d9e0' : 'rgba(255,255,255,0.1)'}`,
|
|
6020
|
+
borderRadius: '6px',
|
|
6021
|
+
resize: 'vertical',
|
|
6022
|
+
color: 'inherit',
|
|
6023
|
+
fontFamily: 'inherit',
|
|
6024
|
+
} }), _jsxs("div", { style: { display: 'flex', gap: 6, justifyContent: 'flex-end' }, children: [_jsx("button", { type: "button", onClick: () => setEditingQueuedId(null), className: cm.textSize('xs'), style: {
|
|
6025
|
+
padding: '4px 12px',
|
|
6026
|
+
border: `1px solid ${isLight ? '#d1d9e0' : 'rgba(255,255,255,0.1)'}`,
|
|
6027
|
+
borderRadius: '4px',
|
|
6028
|
+
background: 'transparent',
|
|
6029
|
+
color: 'inherit',
|
|
6030
|
+
cursor: 'pointer',
|
|
6031
|
+
...(isCoarse ? { minHeight: 32 } : {}),
|
|
6032
|
+
}, children: t('common.cancel', undefined, { defaultValue: 'Cancel' }) }), _jsx("button", { type: "button", onClick: () => {
|
|
6033
|
+
const trimmed = editingQueuedText.trim();
|
|
6034
|
+
if (trimmed)
|
|
6035
|
+
editQueuedMessage(qm.id, trimmed);
|
|
6036
|
+
else
|
|
6037
|
+
deleteQueuedMessage(qm.id);
|
|
6038
|
+
setEditingQueuedId(null);
|
|
6039
|
+
}, className: cm.textSize('xs'), style: {
|
|
6040
|
+
padding: '4px 12px',
|
|
6041
|
+
border: `1px solid ${isLight ? '#d1d9e0' : 'rgba(255,255,255,0.1)'}`,
|
|
6042
|
+
borderRadius: '4px',
|
|
6043
|
+
background: 'rgba(128,128,128,0.1)',
|
|
6044
|
+
color: 'inherit',
|
|
6045
|
+
cursor: 'pointer',
|
|
6046
|
+
...(isCoarse ? { minHeight: 32 } : {}),
|
|
6047
|
+
}, children: t('common.save', undefined, { defaultValue: 'Save' }) })] })] }, qm.id)) : (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 }, children: [_jsx("span", { title: qm.content, className: cm.textSize('sm'), style: {
|
|
6048
|
+
flex: 1,
|
|
6049
|
+
minWidth: 0,
|
|
6050
|
+
overflow: 'hidden',
|
|
6051
|
+
textOverflow: 'ellipsis',
|
|
6052
|
+
whiteSpace: 'nowrap',
|
|
6053
|
+
opacity: 0.8,
|
|
6054
|
+
}, children: qm.content }), _jsx("button", { type: "button", title: t('ide.chat.editQueued', undefined, { defaultValue: 'Edit' }), onClick: () => {
|
|
6055
|
+
setEditingQueuedId(qm.id);
|
|
6056
|
+
setEditingQueuedText(qm.content);
|
|
6057
|
+
}, style: {
|
|
6058
|
+
display: 'inline-flex',
|
|
6059
|
+
alignItems: 'center',
|
|
6060
|
+
justifyContent: 'center',
|
|
6061
|
+
width: isCoarse ? 32 : 22,
|
|
6062
|
+
height: isCoarse ? 32 : 22,
|
|
6063
|
+
flexShrink: 0,
|
|
6064
|
+
border: 'none',
|
|
6065
|
+
borderRadius: 4,
|
|
6066
|
+
background: 'none',
|
|
6067
|
+
color: 'inherit',
|
|
6068
|
+
opacity: 0.5,
|
|
6069
|
+
cursor: 'pointer',
|
|
6070
|
+
padding: 0,
|
|
6071
|
+
transition: 'opacity 100ms, background 100ms',
|
|
6072
|
+
}, onMouseEnter: (e) => {
|
|
6073
|
+
e.currentTarget.style.opacity = '1';
|
|
6074
|
+
e.currentTarget.style.background = 'rgba(128,128,128,0.15)';
|
|
6075
|
+
}, onMouseLeave: (e) => {
|
|
6076
|
+
e.currentTarget.style.opacity = '0.5';
|
|
6077
|
+
e.currentTarget.style.background = 'none';
|
|
6078
|
+
}, children: _jsx(Icon, { name: "pencil", size: 13, "aria-hidden": "true" }) }), _jsx("button", { type: "button", title: t('ide.chat.deleteQueued', undefined, { defaultValue: 'Delete' }), onClick: () => deleteQueuedMessage(qm.id), style: {
|
|
6079
|
+
display: 'inline-flex',
|
|
6080
|
+
alignItems: 'center',
|
|
6081
|
+
justifyContent: 'center',
|
|
6082
|
+
width: isCoarse ? 32 : 22,
|
|
6083
|
+
height: isCoarse ? 32 : 22,
|
|
6084
|
+
flexShrink: 0,
|
|
6085
|
+
border: 'none',
|
|
6086
|
+
borderRadius: 4,
|
|
6087
|
+
background: 'none',
|
|
6088
|
+
color: isLight ? 'rgb(185,28,28)' : 'rgb(248,113,113)',
|
|
6089
|
+
opacity: 0.6,
|
|
6090
|
+
cursor: 'pointer',
|
|
6091
|
+
padding: 0,
|
|
6092
|
+
transition: 'opacity 100ms, background 100ms',
|
|
6093
|
+
}, onMouseEnter: (e) => {
|
|
6094
|
+
e.currentTarget.style.opacity = '1';
|
|
6095
|
+
e.currentTarget.style.background = 'rgba(220,38,38,0.12)';
|
|
6096
|
+
}, onMouseLeave: (e) => {
|
|
6097
|
+
e.currentTarget.style.opacity = '0.6';
|
|
6098
|
+
e.currentTarget.style.background = 'none';
|
|
6099
|
+
}, children: _jsx(Icon, { name: "trash", size: 13, "aria-hidden": "true" }) }), !isLoading && (_jsx("button", { type: "button", title: t('ide.chat.sendQueued', undefined, { defaultValue: 'Send' }), onClick: () => {
|
|
6100
|
+
const content = qm.content;
|
|
6101
|
+
deleteQueuedMessage(qm.id);
|
|
6102
|
+
sendMessage(content);
|
|
6103
|
+
}, style: {
|
|
6104
|
+
display: 'inline-flex',
|
|
6105
|
+
alignItems: 'center',
|
|
6106
|
+
justifyContent: 'center',
|
|
6107
|
+
width: isCoarse ? 32 : 22,
|
|
6108
|
+
height: isCoarse ? 32 : 22,
|
|
6109
|
+
flexShrink: 0,
|
|
6110
|
+
border: 'none',
|
|
6111
|
+
borderRadius: 4,
|
|
6112
|
+
background: 'none',
|
|
6113
|
+
color: isLight ? 'rgb(21,128,61)' : 'rgb(74,222,128)',
|
|
6114
|
+
opacity: 0.7,
|
|
6115
|
+
cursor: 'pointer',
|
|
6116
|
+
padding: 0,
|
|
6117
|
+
transition: 'opacity 100ms, background 100ms',
|
|
6118
|
+
}, onMouseEnter: (e) => {
|
|
6119
|
+
e.currentTarget.style.opacity = '1';
|
|
6120
|
+
e.currentTarget.style.background = 'rgba(34,197,94,0.14)';
|
|
6121
|
+
}, onMouseLeave: (e) => {
|
|
6122
|
+
e.currentTarget.style.opacity = '0.7';
|
|
6123
|
+
e.currentTarget.style.background = 'none';
|
|
6124
|
+
}, children: _jsx("svg", { width: "13", height: "13", viewBox: "0 0 12 12", style: { display: 'block' }, children: _jsx("path", { d: "M 2.5,6.5 L 6,3 L 9.5,6.5 M 6,3.5 L 6,10", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) }) }))] }, qm.id))) })] })), pendingFiles != null &&
|
|
6078
6125
|
pendingFiles.length > 0 &&
|
|
6079
6126
|
!commandMenu &&
|
|
6080
6127
|
!modelPicker &&
|