@lvce-editor/chat-view 6.19.0 → 6.21.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.
@@ -1252,6 +1252,10 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1252
1252
  number(y);
1253
1253
  await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
1254
1254
  };
1255
+ const sendMessagePortToClipBoardWorker$1 = async (port, rpcId) => {
1256
+ const command = 'ClipBoard.handleMessagePort';
1257
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToClipBoardWorker', port, command, rpcId);
1258
+ };
1255
1259
  const sendMessagePortToOpenerWorker$1 = async (port, rpcId) => {
1256
1260
  const command = 'HandleMessagePort.handleMessagePort';
1257
1261
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
@@ -1457,6 +1461,19 @@ const clearInput = async state => {
1457
1461
  };
1458
1462
  };
1459
1463
 
1464
+ let text$1 = '';
1465
+ const writeText = async value => {
1466
+ text$1 = value;
1467
+ };
1468
+ const readText = async () => {
1469
+ return text$1;
1470
+ };
1471
+
1472
+ const copyInput = async state => {
1473
+ await writeText(state.composerValue);
1474
+ return state;
1475
+ };
1476
+
1460
1477
  const emptyObject = {};
1461
1478
  const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
1462
1479
  const i18nString = (key, placeholders = emptyObject) => {
@@ -1794,6 +1811,11 @@ const create = (uid, x, y, width, height, platform, assetDir) => {
1794
1811
  set$1(uid, state, state);
1795
1812
  };
1796
1813
 
1814
+ const cutInput = async state => {
1815
+ await writeText(state.composerValue);
1816
+ return clearInput(state);
1817
+ };
1818
+
1797
1819
  const invoke$1 = async (method, ...params) => {
1798
1820
  {
1799
1821
  throw new Error('ChatStorageWorker is not initialized');
@@ -3018,6 +3040,11 @@ const getMenuEntriesChatList = () => {
3018
3040
  }];
3019
3041
  };
3020
3042
 
3043
+ const MenuChatList = 2178;
3044
+ const getMenuEntryIds = () => {
3045
+ return [Chat$1, MenuChatList];
3046
+ };
3047
+
3021
3048
  const menuEntrySeparator = {
3022
3049
  command: '',
3023
3050
  flags: Separator,
@@ -3090,17 +3117,13 @@ const getMenuEntriesFile = () => {
3090
3117
  };
3091
3118
  const getMenuEntries = menuId => {
3092
3119
  switch (menuId) {
3093
- case 1:
3120
+ case MenuChatList:
3094
3121
  return getMenuEntriesChatList();
3095
3122
  default:
3096
3123
  return getMenuEntriesFile();
3097
3124
  }
3098
3125
  };
3099
3126
 
3100
- const getMenuEntryIds = () => {
3101
- return [Chat$1];
3102
- };
3103
-
3104
3127
  const getQuickPickMenuEntries = () => {
3105
3128
  return [];
3106
3129
  };
@@ -8071,6 +8094,10 @@ const handleClickSettings = async () => {
8071
8094
  await invoke$2('Main.openUri', 'app://settings.json');
8072
8095
  };
8073
8096
 
8097
+ const handleContextMenuChatSendAreaBottom = async state => {
8098
+ return state;
8099
+ };
8100
+
8074
8101
  const handleDragEnter = async (state, name, hasFiles = true) => {
8075
8102
  if (name !== ComposerDropTarget) {
8076
8103
  return state;
@@ -9032,6 +9059,11 @@ const openMockSession = async (state, mockSessionId, mockChatMessages) => {
9032
9059
  };
9033
9060
  };
9034
9061
 
9062
+ const pasteInput = async state => {
9063
+ const text = await readText();
9064
+ return handleInput(state, Composer, text, 'script');
9065
+ };
9066
+
9035
9067
  const registerMockResponse = (state, mockResponse) => {
9036
9068
  reset$2();
9037
9069
  pushChunk(mockResponse.text);
@@ -9076,6 +9108,10 @@ const getCss = (composerHeight, listItemHeight, chatMessageFontSize, chatMessage
9076
9108
  align-items:center;
9077
9109
  }
9078
9110
 
9111
+ .ChatMessageContent p + p{
9112
+ margin-top: 0.75em;
9113
+ }
9114
+
9079
9115
  .ChatListItemStatusRow{
9080
9116
  width: 16px;
9081
9117
  min-width: 16px;
@@ -9302,6 +9338,7 @@ const HandleSearchInput = 37;
9302
9338
  const HandleChatWelcomeContextMenu = 39;
9303
9339
  const HandleChatHeaderContextMenu = 40;
9304
9340
  const HandleChatInputContextMenu = 41;
9341
+ const HandleContextMenuChatSendAreaBottom = 42;
9305
9342
 
9306
9343
  const getModelLabel = model => {
9307
9344
  if (model.provider === 'openRouter') {
@@ -9550,6 +9587,7 @@ const getChatSendAreaDom = (composerValue, modelPickerOpen, modelPickerSearchVal
9550
9587
  }, {
9551
9588
  childCount: voiceDictationEnabled ? controlsCount + 1 : controlsCount,
9552
9589
  className: ChatSendAreaBottom,
9590
+ onContextMenu: HandleContextMenuChatSendAreaBottom,
9553
9591
  type: Div
9554
9592
  }, ...(newChatModelPickerEnabled ? getChatModelPickerVirtualDom(models, selectedModelId, modelPickerOpen, modelPickerSearchValue) : getChatSelectVirtualDom(models, selectedModelId)), ...(showRunMode ? getRunModeSelectVirtualDom(runMode) : []), ...(usageOverviewEnabled ? getUsageOverviewDom(tokensUsed, tokensMax) : []), ...(addContextButtonEnabled ? getAddContextButtonDom() : []), ...getSendButtonDom(isSendDisabled, voiceDictationEnabled)];
9555
9593
  };
@@ -11124,6 +11162,7 @@ const getChatHeaderActionsDom = (viewMode, authEnabled = false, authStatus = 'si
11124
11162
  return [{
11125
11163
  childCount: items.length,
11126
11164
  className: ChatActions,
11165
+ role: 'toolbar',
11127
11166
  type: Div
11128
11167
  }, ...items.flatMap(getHeaderActionVirtualDom)];
11129
11168
  };
@@ -11944,6 +11983,10 @@ const renderEventListeners = () => {
11944
11983
  name: HandleChatInputContextMenu,
11945
11984
  params: ['handleChatInputContextMenu'],
11946
11985
  preventDefault: true
11986
+ }, {
11987
+ name: HandleContextMenuChatSendAreaBottom,
11988
+ params: ['handleContextMenuChatSendAreaBottom'],
11989
+ preventDefault: true
11947
11990
  }, {
11948
11991
  name: HandleKeyDown,
11949
11992
  params: ['handleKeyDown', Key, ShiftKey]
@@ -12191,7 +12234,9 @@ const useMockApi = (state, value, mockApiCommandId = defaultMockApiCommandId) =>
12191
12234
 
12192
12235
  const commandMap = {
12193
12236
  'Chat.clearInput': wrapCommand(clearInput),
12237
+ 'Chat.copyInput': wrapCommand(copyInput),
12194
12238
  'Chat.create': create,
12239
+ 'Chat.cutInput': wrapCommand(cutInput),
12195
12240
  'Chat.deleteSessionAtIndex': wrapCommand(deleteSessionAtIndex),
12196
12241
  'Chat.diff2': diff2,
12197
12242
  'Chat.enterNewLine': wrapCommand(handleNewline),
@@ -12204,7 +12249,7 @@ const commandMap = {
12204
12249
  'Chat.getSelectedSessionId': wrapGetter(getSelectedSessionId),
12205
12250
  'Chat.handleChatHeaderContextMenu': wrapCommand(handleChatHeaderContextMenu),
12206
12251
  'Chat.handleChatInputContextMenu': wrapCommand(handleChatInputContextMenu),
12207
- 'Chat.handleChatListContextMenu': handleChatListContextMenu,
12252
+ 'Chat.handleChatListContextMenu': wrapCommand(handleChatListContextMenu),
12208
12253
  'Chat.handleChatListScroll': wrapCommand(handleChatListScroll),
12209
12254
  'Chat.handleChatWelcomeContextMenu': wrapCommand(handleChatWelcomeContextMenu),
12210
12255
  'Chat.handleClick': wrapCommand(handleClick),
@@ -12218,6 +12263,7 @@ const commandMap = {
12218
12263
  'Chat.handleClickReadFile': handleClickFileName,
12219
12264
  'Chat.handleClickSessionDebug': wrapCommand(handleClickSessionDebug),
12220
12265
  'Chat.handleClickSettings': handleClickSettings,
12266
+ 'Chat.handleContextMenuChatSendAreaBottom': wrapCommand(handleContextMenuChatSendAreaBottom),
12221
12267
  'Chat.handleDragEnter': wrapCommand(handleDragEnter),
12222
12268
  'Chat.handleDragLeave': wrapCommand(handleDragLeave),
12223
12269
  'Chat.handleDragOver': wrapCommand(handleDragOver),
@@ -12246,6 +12292,7 @@ const commandMap = {
12246
12292
  'Chat.mockOpenApiStreamPushChunk': wrapCommand(mockOpenApiStreamPushChunk),
12247
12293
  'Chat.mockOpenApiStreamReset': wrapCommand(mockOpenApiStreamReset),
12248
12294
  'Chat.openMockSession': wrapCommand(openMockSession),
12295
+ 'Chat.pasteInput': wrapCommand(pasteInput),
12249
12296
  'Chat.registerMockResponse': wrapCommand(registerMockResponse),
12250
12297
  'Chat.render2': render2,
12251
12298
  'Chat.renderEventListeners': renderEventListeners,
@@ -12330,6 +12377,17 @@ const initializeChatToolWorker = async () => {
12330
12377
  set$5(rpc);
12331
12378
  };
12332
12379
 
12380
+ const sendMessagePortToClipBoardWorker = async port => {
12381
+ await sendMessagePortToClipBoardWorker$1(port, 0);
12382
+ };
12383
+ const initializeClipBoardWorker = async () => {
12384
+ const rpc = await create$4({
12385
+ commandMap: {},
12386
+ send: sendMessagePortToClipBoardWorker
12387
+ });
12388
+ set$3(rpc);
12389
+ };
12390
+
12333
12391
  const sendMessagePortToOpenerWorker = async port => {
12334
12392
  await sendMessagePortToOpenerWorker$1(port, 0);
12335
12393
  };
@@ -12347,7 +12405,7 @@ const listen = async () => {
12347
12405
  commandMap: commandMap
12348
12406
  });
12349
12407
  set$2(rpc);
12350
- await Promise.all([initializeChatNetworkWorker(), initializeChatMathWorker(), initializeChatCoordinatorWorker(), initializeChatToolWorker(), initializeOpenerWorker(), initializeChatStorageWorker()]);
12408
+ await Promise.all([initializeChatCoordinatorWorker(), initializeChatMathWorker(), initializeChatNetworkWorker(), initializeChatStorageWorker(), initializeChatToolWorker(), initializeClipBoardWorker(), initializeOpenerWorker()]);
12351
12409
  };
12352
12410
 
12353
12411
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/chat-view",
3
- "version": "6.19.0",
3
+ "version": "6.21.0",
4
4
  "description": "Chat View Worker",
5
5
  "repository": {
6
6
  "type": "git",