@lvce-editor/chat-view 1.17.0 → 1.18.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.
@@ -1457,7 +1457,7 @@ const create = (uid, x, y, width, height, platform, assetDir) => {
1457
1457
  };
1458
1458
 
1459
1459
  const isEqual$1 = (oldState, newState) => {
1460
- return oldState.initial === newState.initial;
1460
+ return oldState.initial === newState.initial && oldState.composerHeight === newState.composerHeight && oldState.composerLineHeight === newState.composerLineHeight && oldState.composerFontFamily === newState.composerFontFamily && oldState.composerFontSize === newState.composerFontSize;
1461
1461
  };
1462
1462
 
1463
1463
  const diffFocus = (oldState, newState) => {
@@ -2965,7 +2965,7 @@ const getOpenRouterErrorMessage = errorResult => {
2965
2965
  }
2966
2966
  };
2967
2967
 
2968
- /* eslint-disable @cspell/spellchecker */
2968
+ // cspell:ignore openrouter
2969
2969
  const getOpenRouterModelId = selectedModelId => {
2970
2970
  const openRouterPrefix = 'openrouter/';
2971
2971
  if (selectedModelId.toLowerCase().startsWith(openRouterPrefix)) {
@@ -2984,7 +2984,7 @@ const isOpenApiModel = (selectedModelId, models) => {
2984
2984
  return normalizedModelId.startsWith('openapi/') || normalizedModelId.startsWith('openai/');
2985
2985
  };
2986
2986
 
2987
- /* eslint-disable @cspell/spellchecker */
2987
+ // cspell:ignore openrouter
2988
2988
 
2989
2989
  const isOpenRouterModel = (selectedModelId, models) => {
2990
2990
  const selectedModel = models.find(model => model.id === selectedModelId);
@@ -3405,7 +3405,7 @@ const OpenApiApiKeyInput = 'open-api-api-key';
3405
3405
  const SaveOpenApiApiKey = 'save-openapi-api-key';
3406
3406
  const OpenOpenApiApiKeySettings = 'open-openapi-api-key-settings';
3407
3407
 
3408
- /* eslint-disable @cspell/spellchecker */
3408
+ // cspell:ignore openrouter
3409
3409
  const OpenRouterApiKeyInput = 'open-router-api-key';
3410
3410
  const SaveOpenRouterApiKey = 'save-openrouter-api-key';
3411
3411
  const OpenOpenRouterApiKeySettings = 'open-openrouter-api-key-settings';
@@ -3652,7 +3652,10 @@ const handleModelChange = async (state, value) => {
3652
3652
  };
3653
3653
 
3654
3654
  const handleNewline = async state => {
3655
- return handleInput(state, Composer, `${state.composerValue}\n`);
3655
+ const {
3656
+ composerValue
3657
+ } = state;
3658
+ return handleInput(state, Composer, `${composerValue}\n`);
3656
3659
  };
3657
3660
 
3658
3661
  const id = 7201;
@@ -3852,12 +3855,22 @@ const openMockSession = async (state, mockSessionId, mockChatMessages) => {
3852
3855
  };
3853
3856
  };
3854
3857
 
3858
+ const getCss = composerHeight => {
3859
+ return `:root {
3860
+ --ChatInputBoxHeight: ${composerHeight}px;
3861
+ }`;
3862
+ };
3863
+
3855
3864
  // TODO render things like scrollbar height,scrollbar offset, textarea height,
3856
3865
  // list height
3857
- const css = `
3858
- `;
3866
+
3859
3867
  const renderCss = (oldState, newState) => {
3860
- return [SetCss, newState.uid, css];
3868
+ const {
3869
+ composerHeight,
3870
+ uid
3871
+ } = newState;
3872
+ const css = getCss(composerHeight);
3873
+ return [SetCss, uid, css];
3861
3874
  };
3862
3875
 
3863
3876
  const getFocusSelector = focus => {
@@ -4029,7 +4042,7 @@ const getChatSendAreaDom = (composerValue, models, selectedModelId, usageOvervie
4029
4042
  onFocus: HandleFocus,
4030
4043
  onInput: HandleInput,
4031
4044
  placeholder: composePlaceholder(),
4032
- style: `height:${composerHeight}px;font-size:${composerFontSize}px;font-family:${composerFontFamily};line-height:${composerLineHeight}px;`,
4045
+ // style: `height:${composerHeight}px;font-size:${composerFontSize}px;font-family:${composerFontFamily};line-height:${composerLineHeight}px;`,
4033
4046
  type: TextArea,
4034
4047
  value: composerValue
4035
4048
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/chat-view",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "Chat View Worker",
5
5
  "repository": {
6
6
  "type": "git",