@lvce-editor/chat-view 4.6.0 → 4.7.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 +52 -53
- package/package.json +1 -1
|
@@ -1424,7 +1424,7 @@ const startConversation = () => {
|
|
|
1424
1424
|
return i18nString('Start a conversation by typing below.');
|
|
1425
1425
|
};
|
|
1426
1426
|
const composePlaceholder = () => {
|
|
1427
|
-
return i18nString('Type your message. Enter to send
|
|
1427
|
+
return i18nString('Type your message. Enter to send.');
|
|
1428
1428
|
};
|
|
1429
1429
|
const attachImageAsContext = () => {
|
|
1430
1430
|
return i18nString('Attach Image as Context');
|
|
@@ -6240,59 +6240,55 @@ const handleClick = async (state, name, id = '') => {
|
|
|
6240
6240
|
if (!name) {
|
|
6241
6241
|
return state;
|
|
6242
6242
|
}
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
}
|
|
6292
|
-
if (name === OpenOpenApiApiKeyWebsite) {
|
|
6293
|
-
return handleClickOpenApiApiKeyWebsite(state);
|
|
6243
|
+
switch (true) {
|
|
6244
|
+
case name === CreateSession:
|
|
6245
|
+
return createSession(state);
|
|
6246
|
+
case name === CreateProject:
|
|
6247
|
+
return handleClickCreateProject(state);
|
|
6248
|
+
case isCreateSessionInProjectInputName(name):
|
|
6249
|
+
{
|
|
6250
|
+
const projectId = getProjectIdFromCreateSessionInProjectInputName(name);
|
|
6251
|
+
return createSession(state, projectId);
|
|
6252
|
+
}
|
|
6253
|
+
case name === ToggleChatFocus:
|
|
6254
|
+
return toggleChatFocusMode(state);
|
|
6255
|
+
case isProjectInputName(name):
|
|
6256
|
+
{
|
|
6257
|
+
const projectId = getProjectIdFromInputName(name);
|
|
6258
|
+
if (state.viewMode === 'chat-focus') {
|
|
6259
|
+
return toggleProjectExpanded(state, projectId);
|
|
6260
|
+
}
|
|
6261
|
+
return selectProject(state, projectId);
|
|
6262
|
+
}
|
|
6263
|
+
case isSessionInputName(name):
|
|
6264
|
+
{
|
|
6265
|
+
const sessionId = getSessionIdFromInputName(name);
|
|
6266
|
+
return selectSession(state, sessionId);
|
|
6267
|
+
}
|
|
6268
|
+
case isRenameInputName(name):
|
|
6269
|
+
{
|
|
6270
|
+
const sessionId = getRenameIdFromInputName(name);
|
|
6271
|
+
return startRename(state, sessionId);
|
|
6272
|
+
}
|
|
6273
|
+
case name === SessionDelete:
|
|
6274
|
+
return deleteSession(state, id);
|
|
6275
|
+
case name === Send:
|
|
6276
|
+
return handleClickSend(state);
|
|
6277
|
+
case name === SaveOpenRouterApiKey:
|
|
6278
|
+
return handleClickSaveOpenRouterApiKey(state);
|
|
6279
|
+
case name === SaveOpenApiApiKey:
|
|
6280
|
+
return handleClickSaveOpenApiApiKey(state);
|
|
6281
|
+
case name === OpenOpenRouterApiKeySettings:
|
|
6282
|
+
return handleClickOpenRouterApiKeySettings(state);
|
|
6283
|
+
case name === OpenOpenRouterApiKeyWebsite:
|
|
6284
|
+
return handleClickOpenRouterApiKeyWebsite(state);
|
|
6285
|
+
case name === OpenOpenApiApiKeySettings:
|
|
6286
|
+
return handleClickOpenApiApiKeySettings(state);
|
|
6287
|
+
case name === OpenOpenApiApiKeyWebsite:
|
|
6288
|
+
return handleClickOpenApiApiKeyWebsite(state);
|
|
6289
|
+
default:
|
|
6290
|
+
return state;
|
|
6294
6291
|
}
|
|
6295
|
-
return state;
|
|
6296
6292
|
};
|
|
6297
6293
|
|
|
6298
6294
|
const handleClickBack = async state => {
|
|
@@ -24759,6 +24755,7 @@ const getMessageContentDom = (nodes, useChatMathWorker = false) => {
|
|
|
24759
24755
|
const getMissingApiKeyDom = ({
|
|
24760
24756
|
getApiKeyText,
|
|
24761
24757
|
inputName,
|
|
24758
|
+
inputPattern,
|
|
24762
24759
|
inputRequired = false,
|
|
24763
24760
|
inputValue,
|
|
24764
24761
|
openSettingsButtonName,
|
|
@@ -24777,6 +24774,7 @@ const getMissingApiKeyDom = ({
|
|
|
24777
24774
|
className: InputBox,
|
|
24778
24775
|
name: inputName,
|
|
24779
24776
|
onInput: HandleInput,
|
|
24777
|
+
pattern: inputPattern,
|
|
24780
24778
|
placeholder,
|
|
24781
24779
|
required: inputRequired,
|
|
24782
24780
|
type: Input,
|
|
@@ -24806,6 +24804,7 @@ const getMissingOpenApiApiKeyDom = openApiApiKeyInput => {
|
|
|
24806
24804
|
return getMissingApiKeyDom({
|
|
24807
24805
|
getApiKeyText: getOpenApiApiKey(),
|
|
24808
24806
|
inputName: OpenApiApiKeyInput,
|
|
24807
|
+
inputPattern: '^sk-.+',
|
|
24809
24808
|
inputRequired: true,
|
|
24810
24809
|
inputValue: openApiApiKeyInput,
|
|
24811
24810
|
openSettingsButtonName: OpenOpenApiApiKeySettings,
|