@lvce-editor/chat-view 4.5.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 +63 -56
- 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,22 +24755,28 @@ const getMessageContentDom = (nodes, useChatMathWorker = false) => {
|
|
|
24759
24755
|
const getMissingApiKeyDom = ({
|
|
24760
24756
|
getApiKeyText,
|
|
24761
24757
|
inputName,
|
|
24758
|
+
inputPattern,
|
|
24759
|
+
inputRequired = false,
|
|
24762
24760
|
inputValue,
|
|
24763
24761
|
openSettingsButtonName,
|
|
24764
24762
|
placeholder,
|
|
24765
24763
|
saveButtonDisabled = false,
|
|
24766
24764
|
saveButtonName,
|
|
24767
|
-
saveButtonText = save()
|
|
24765
|
+
saveButtonText = save(),
|
|
24766
|
+
saveButtonType = 'button',
|
|
24767
|
+
useForm = false
|
|
24768
24768
|
}) => {
|
|
24769
24769
|
return [{
|
|
24770
24770
|
childCount: 2,
|
|
24771
|
-
type: Div
|
|
24771
|
+
type: useForm ? Form : Div
|
|
24772
24772
|
}, {
|
|
24773
24773
|
childCount: 0,
|
|
24774
24774
|
className: InputBox,
|
|
24775
24775
|
name: inputName,
|
|
24776
24776
|
onInput: HandleInput,
|
|
24777
|
+
pattern: inputPattern,
|
|
24777
24778
|
placeholder,
|
|
24779
|
+
required: inputRequired,
|
|
24778
24780
|
type: Input,
|
|
24779
24781
|
value: inputValue
|
|
24780
24782
|
}, {
|
|
@@ -24782,6 +24784,7 @@ const getMissingApiKeyDom = ({
|
|
|
24782
24784
|
className: Actions,
|
|
24783
24785
|
type: Div
|
|
24784
24786
|
}, {
|
|
24787
|
+
buttonType: saveButtonType,
|
|
24785
24788
|
childCount: 1,
|
|
24786
24789
|
className: mergeClassNames(Button, ButtonPrimary),
|
|
24787
24790
|
disabled: saveButtonDisabled,
|
|
@@ -24801,10 +24804,14 @@ const getMissingOpenApiApiKeyDom = openApiApiKeyInput => {
|
|
|
24801
24804
|
return getMissingApiKeyDom({
|
|
24802
24805
|
getApiKeyText: getOpenApiApiKey(),
|
|
24803
24806
|
inputName: OpenApiApiKeyInput,
|
|
24807
|
+
inputPattern: '^sk-.+',
|
|
24808
|
+
inputRequired: true,
|
|
24804
24809
|
inputValue: openApiApiKeyInput,
|
|
24805
24810
|
openSettingsButtonName: OpenOpenApiApiKeySettings,
|
|
24806
24811
|
placeholder: openApiApiKeyPlaceholder(),
|
|
24807
|
-
saveButtonName: SaveOpenApiApiKey
|
|
24812
|
+
saveButtonName: SaveOpenApiApiKey,
|
|
24813
|
+
saveButtonType: 'submit',
|
|
24814
|
+
useForm: true
|
|
24808
24815
|
});
|
|
24809
24816
|
};
|
|
24810
24817
|
|