@lvce-editor/chat-view 1.11.0 → 1.12.0
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/chatViewWorkerMain.js +15 -8
- package/package.json +1 -1
|
@@ -1200,7 +1200,7 @@ i18nString('You');
|
|
|
1200
1200
|
i18nString('Assistant');
|
|
1201
1201
|
const composePlaceholder = i18nString('Type your message. Enter to send, Shift+Enter for newline.');
|
|
1202
1202
|
const sendMessage = i18nString('Send message');
|
|
1203
|
-
|
|
1203
|
+
i18nString('Send');
|
|
1204
1204
|
const deleteChatSession$1 = i18nString('Delete chat session');
|
|
1205
1205
|
const defaultSessionTitle = i18nString('Chat 1');
|
|
1206
1206
|
const dummyChatA = i18nString('Dummy Chat A');
|
|
@@ -2115,21 +2115,22 @@ const getListIndex = (state, eventX, eventY) => {
|
|
|
2115
2115
|
return Math.floor(listY / itemHeight);
|
|
2116
2116
|
};
|
|
2117
2117
|
|
|
2118
|
-
const
|
|
2118
|
+
const selectListIndex = async (state, index) => {
|
|
2119
2119
|
const {
|
|
2120
2120
|
sessions
|
|
2121
2121
|
} = state;
|
|
2122
|
-
|
|
2123
|
-
if (index < 0) {
|
|
2122
|
+
if (index < 0 || index >= sessions.length) {
|
|
2124
2123
|
return state;
|
|
2125
2124
|
}
|
|
2126
2125
|
const session = sessions[index];
|
|
2127
|
-
if (!session) {
|
|
2128
|
-
return state;
|
|
2129
|
-
}
|
|
2130
2126
|
return selectSession(state, session.id);
|
|
2131
2127
|
};
|
|
2132
2128
|
|
|
2129
|
+
const handleClickList = async (state, eventX, eventY) => {
|
|
2130
|
+
const index = getListIndex(state, eventX, eventY);
|
|
2131
|
+
return selectListIndex(state, index);
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2133
2134
|
const CREATE_SESSION = 'create-session';
|
|
2134
2135
|
const SESSION_PREFIX = 'session:';
|
|
2135
2136
|
const RENAME_PREFIX = 'session-rename:';
|
|
@@ -2581,6 +2582,7 @@ const getModelOptionDOm = (model, selectedModelId) => {
|
|
|
2581
2582
|
const getSendButtonClassName = isSendDisabled => {
|
|
2582
2583
|
return isSendDisabled ? `${Button} ${ButtonPrimary} ${ButtonDisabled}` : `${Button} ${ButtonPrimary}`;
|
|
2583
2584
|
};
|
|
2585
|
+
|
|
2584
2586
|
const getSendButtonDom = isSendDisabled => {
|
|
2585
2587
|
const sendButtonClassName = getSendButtonClassName(isSendDisabled);
|
|
2586
2588
|
return [{
|
|
@@ -2592,7 +2594,11 @@ const getSendButtonDom = isSendDisabled => {
|
|
|
2592
2594
|
role: Button$2,
|
|
2593
2595
|
title: sendMessage,
|
|
2594
2596
|
type: Button$1
|
|
2595
|
-
},
|
|
2597
|
+
}, {
|
|
2598
|
+
childCount: 0,
|
|
2599
|
+
class: 'MaskIcon MaskIconSend',
|
|
2600
|
+
type: Div
|
|
2601
|
+
}];
|
|
2596
2602
|
};
|
|
2597
2603
|
|
|
2598
2604
|
const clampToPercentage = (tokensUsed, tokensMax) => {
|
|
@@ -2645,6 +2651,7 @@ const getChatSendAreaDom = (composerValue, models, selectedModelId, usageOvervie
|
|
|
2645
2651
|
childCount: 0,
|
|
2646
2652
|
className: MultilineInputBox,
|
|
2647
2653
|
name: 'composer',
|
|
2654
|
+
onFocus: HandleFocus,
|
|
2648
2655
|
onInput: HandleInput,
|
|
2649
2656
|
placeholder: composePlaceholder,
|
|
2650
2657
|
rows: 4,
|