@lvce-editor/chat-view 1.10.0 → 1.11.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 +36 -30
- package/package.json +1 -1
|
@@ -1309,8 +1309,8 @@ const diffValue = (oldState, newState) => {
|
|
|
1309
1309
|
return newState.inputSource !== 'script';
|
|
1310
1310
|
};
|
|
1311
1311
|
|
|
1312
|
-
const modules = [isEqual, diffValue, diffFocus, isEqual$1];
|
|
1313
|
-
const numbers = [RenderIncremental, RenderValue, RenderFocus, RenderCss];
|
|
1312
|
+
const modules = [isEqual, diffValue, diffFocus, isEqual$1, diffFocus];
|
|
1313
|
+
const numbers = [RenderIncremental, RenderValue, RenderFocus, RenderCss, RenderFocusContext];
|
|
1314
1314
|
|
|
1315
1315
|
const diff = (oldState, newState) => {
|
|
1316
1316
|
const diffResult = [];
|
|
@@ -2520,8 +2520,7 @@ const renderFocus = (oldState, newState) => {
|
|
|
2520
2520
|
};
|
|
2521
2521
|
|
|
2522
2522
|
const renderFocusContext = (oldState, newState) => {
|
|
2523
|
-
|
|
2524
|
-
return [SetFocusContext, newState.uid, when];
|
|
2523
|
+
return [SetFocusContext, newState.uid, FocusChatInput];
|
|
2525
2524
|
};
|
|
2526
2525
|
|
|
2527
2526
|
const ChatActions = 'ChatActions';
|
|
@@ -2555,7 +2554,7 @@ const Select = 'Select';
|
|
|
2555
2554
|
const Viewlet = 'Viewlet';
|
|
2556
2555
|
const ChatWelcomeMessage = 'ChatWelcomeMessage';
|
|
2557
2556
|
|
|
2558
|
-
const
|
|
2557
|
+
const HandleListContextMenu = 2;
|
|
2559
2558
|
const HandleFocus = 3;
|
|
2560
2559
|
const HandleInput = 4;
|
|
2561
2560
|
const HandleClick = 11;
|
|
@@ -2579,8 +2578,11 @@ const getModelOptionDOm = (model, selectedModelId) => {
|
|
|
2579
2578
|
}, text(model.name)];
|
|
2580
2579
|
};
|
|
2581
2580
|
|
|
2581
|
+
const getSendButtonClassName = isSendDisabled => {
|
|
2582
|
+
return isSendDisabled ? `${Button} ${ButtonPrimary} ${ButtonDisabled}` : `${Button} ${ButtonPrimary}`;
|
|
2583
|
+
};
|
|
2582
2584
|
const getSendButtonDom = isSendDisabled => {
|
|
2583
|
-
const sendButtonClassName = isSendDisabled
|
|
2585
|
+
const sendButtonClassName = getSendButtonClassName(isSendDisabled);
|
|
2584
2586
|
return [{
|
|
2585
2587
|
childCount: 1,
|
|
2586
2588
|
className: sendButtonClassName,
|
|
@@ -2662,6 +2664,22 @@ const getChatSendAreaDom = (composerValue, models, selectedModelId, usageOvervie
|
|
|
2662
2664
|
}, ...modelOptions, ...(usageOverviewEnabled ? getUsageOverviewDom(tokensUsed, tokensMax) : []), ...getSendButtonDom(isSendDisabled)];
|
|
2663
2665
|
};
|
|
2664
2666
|
|
|
2667
|
+
const getBackButtonVirtualDom = () => {
|
|
2668
|
+
return [{
|
|
2669
|
+
childCount: 1,
|
|
2670
|
+
className: IconButton,
|
|
2671
|
+
name: 'back',
|
|
2672
|
+
onClick: HandleClickBack,
|
|
2673
|
+
role: Button$2,
|
|
2674
|
+
title: backToChats,
|
|
2675
|
+
type: Button$1
|
|
2676
|
+
}, {
|
|
2677
|
+
childCount: 0,
|
|
2678
|
+
className: 'MaskIcon MaskIconArrowLeft',
|
|
2679
|
+
type: Div
|
|
2680
|
+
}];
|
|
2681
|
+
};
|
|
2682
|
+
|
|
2665
2683
|
const getHeaderActionVirtualDom = item => {
|
|
2666
2684
|
return [{
|
|
2667
2685
|
childCount: 1,
|
|
@@ -2671,22 +2689,26 @@ const getHeaderActionVirtualDom = item => {
|
|
|
2671
2689
|
role: Button$2,
|
|
2672
2690
|
title: item.title,
|
|
2673
2691
|
type: Button$1
|
|
2674
|
-
},
|
|
2692
|
+
}, {
|
|
2693
|
+
childCount: 0,
|
|
2694
|
+
className: item.icon,
|
|
2695
|
+
type: Div
|
|
2696
|
+
}];
|
|
2675
2697
|
};
|
|
2676
2698
|
|
|
2677
2699
|
const getChatHeaderActionsDom = () => {
|
|
2678
2700
|
const items = [{
|
|
2679
|
-
icon: '
|
|
2701
|
+
icon: 'MaskIcon MaskIconAdd',
|
|
2680
2702
|
name: 'create-session',
|
|
2681
2703
|
onClick: HandleClickNew,
|
|
2682
2704
|
title: newChat
|
|
2683
2705
|
}, {
|
|
2684
|
-
icon: '
|
|
2706
|
+
icon: 'MaskIcon MaskIconSettingsGear',
|
|
2685
2707
|
name: 'settings',
|
|
2686
2708
|
onClick: HandleClickSettings,
|
|
2687
2709
|
title: settings
|
|
2688
2710
|
}, {
|
|
2689
|
-
icon: '
|
|
2711
|
+
icon: 'MaskIcon MaskIconClose',
|
|
2690
2712
|
name: 'close-chat',
|
|
2691
2713
|
onClick: HandleClickClose,
|
|
2692
2714
|
title: closeChat
|
|
@@ -2698,22 +2720,6 @@ const getChatHeaderActionsDom = () => {
|
|
|
2698
2720
|
}, ...items.flatMap(getHeaderActionVirtualDom)];
|
|
2699
2721
|
};
|
|
2700
2722
|
|
|
2701
|
-
const getChatHeaderBackButtonVirtualDom = () => {
|
|
2702
|
-
return [{
|
|
2703
|
-
childCount: 1,
|
|
2704
|
-
className: IconButton,
|
|
2705
|
-
name: 'back',
|
|
2706
|
-
onClick: HandleClickBack,
|
|
2707
|
-
role: Button$2,
|
|
2708
|
-
title: backToChats,
|
|
2709
|
-
type: Button$1
|
|
2710
|
-
}, {
|
|
2711
|
-
childCount: 0,
|
|
2712
|
-
className: 'MaskIcon MaskIconArrowLeft',
|
|
2713
|
-
type: Div
|
|
2714
|
-
}];
|
|
2715
|
-
};
|
|
2716
|
-
|
|
2717
2723
|
const getChatHeaderDomDetailMode = selectedSessionTitle => {
|
|
2718
2724
|
return [{
|
|
2719
2725
|
childCount: 2,
|
|
@@ -2723,7 +2729,7 @@ const getChatHeaderDomDetailMode = selectedSessionTitle => {
|
|
|
2723
2729
|
childCount: 2,
|
|
2724
2730
|
className: ChatName,
|
|
2725
2731
|
type: Div
|
|
2726
|
-
}, ...
|
|
2732
|
+
}, ...getBackButtonVirtualDom(), {
|
|
2727
2733
|
childCount: 1,
|
|
2728
2734
|
className: Label,
|
|
2729
2735
|
type: Span
|
|
@@ -2807,7 +2813,7 @@ const getSessionDom = session => {
|
|
|
2807
2813
|
childCount: 1,
|
|
2808
2814
|
className: ChatListItemLabel,
|
|
2809
2815
|
name: `session:${session.id}`,
|
|
2810
|
-
onContextMenu:
|
|
2816
|
+
onContextMenu: HandleListContextMenu,
|
|
2811
2817
|
tabIndex: 0,
|
|
2812
2818
|
type: Div
|
|
2813
2819
|
}, text(session.title), {
|
|
@@ -2943,8 +2949,8 @@ const render2 = (uid, diffResult) => {
|
|
|
2943
2949
|
|
|
2944
2950
|
const renderEventListeners = () => {
|
|
2945
2951
|
return [{
|
|
2946
|
-
name:
|
|
2947
|
-
params: ['handleChatListContextMenu',
|
|
2952
|
+
name: HandleListContextMenu,
|
|
2953
|
+
params: ['handleChatListContextMenu', ClientX, ClientY],
|
|
2948
2954
|
preventDefault: true
|
|
2949
2955
|
}, {
|
|
2950
2956
|
name: HandleClick,
|