@lvce-editor/chat-view 6.4.0 → 6.6.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.
@@ -54,6 +54,49 @@ class VError extends Error {
54
54
  }
55
55
  }
56
56
 
57
+ class AssertionError extends Error {
58
+ constructor(message) {
59
+ super(message);
60
+ this.name = 'AssertionError';
61
+ }
62
+ }
63
+ const Object$1 = 1;
64
+ const Number$1 = 2;
65
+ const Array$1 = 3;
66
+ const String$1 = 4;
67
+ const Boolean$1 = 5;
68
+ const Function = 6;
69
+ const Null = 7;
70
+ const Unknown = 8;
71
+ const getType = value => {
72
+ switch (typeof value) {
73
+ case 'number':
74
+ return Number$1;
75
+ case 'function':
76
+ return Function;
77
+ case 'string':
78
+ return String$1;
79
+ case 'object':
80
+ if (value === null) {
81
+ return Null;
82
+ }
83
+ if (Array.isArray(value)) {
84
+ return Array$1;
85
+ }
86
+ return Object$1;
87
+ case 'boolean':
88
+ return Boolean$1;
89
+ default:
90
+ return Unknown;
91
+ }
92
+ };
93
+ const number = value => {
94
+ const type = getType(value);
95
+ if (type !== Number$1) {
96
+ throw new AssertionError('expected value to be of type number');
97
+ }
98
+ };
99
+
57
100
  const isMessagePort = value => {
58
101
  return value && value instanceof MessagePort;
59
102
  };
@@ -1152,6 +1195,8 @@ const Enter = 3;
1152
1195
 
1153
1196
  const Shift = 1 << 10 >>> 0;
1154
1197
 
1198
+ const Chat$1 = 97;
1199
+
1155
1200
  const Separator = 1;
1156
1201
  const None = 0;
1157
1202
  const RestoreFocus = 6;
@@ -1196,6 +1241,13 @@ const {
1196
1241
  invokeAndTransfer,
1197
1242
  set: set$2
1198
1243
  } = create$2(RendererWorker);
1244
+ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1245
+ number(uid);
1246
+ number(menuId);
1247
+ number(x);
1248
+ number(y);
1249
+ await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
1250
+ };
1199
1251
  const sendMessagePortToOpenerWorker$1 = async (port, rpcId) => {
1200
1252
  const command = 'HandleMessagePort.handleMessagePort';
1201
1253
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
@@ -2908,6 +2960,12 @@ const menuEntryCopyPath = {
2908
2960
  id: 'copyPath',
2909
2961
  label: copyPath()
2910
2962
  };
2963
+ const menuEntryCopyAsE2eTest = {
2964
+ command: 'Chat.copyAsE2eTest',
2965
+ flags: None,
2966
+ id: 'copyAsE2eTest',
2967
+ label: copyPath()
2968
+ };
2911
2969
  const menuEntryCopyRelativePath = {
2912
2970
  command: 'Explorer.copyRelativePath',
2913
2971
  flags: RestoreFocus,
@@ -2927,14 +2985,14 @@ const menuEntryDelete = {
2927
2985
  label: deleteItem()
2928
2986
  };
2929
2987
  const getMenuEntriesFile = () => {
2930
- return [menuEntryOpenContainingFolder, menuEntryOpenInIntegratedTerminal, menuEntrySeparator, menuEntryCut, menuEntryCopy, menuEntryPaste, menuEntrySeparator, menuEntryCopyPath, menuEntryCopyRelativePath, menuEntrySeparator, menuEntryRename, menuEntryDelete];
2988
+ return [menuEntryCopyAsE2eTest, menuEntryOpenContainingFolder, menuEntryOpenInIntegratedTerminal, menuEntrySeparator, menuEntryCut, menuEntryCopy, menuEntryPaste, menuEntrySeparator, menuEntryCopyPath, menuEntryCopyRelativePath, menuEntrySeparator, menuEntryRename, menuEntryDelete];
2931
2989
  };
2932
2990
  const getMenuEntries = () => {
2933
2991
  return getMenuEntriesFile();
2934
2992
  };
2935
2993
 
2936
2994
  const getMenuEntryIds = () => {
2937
- return [];
2995
+ return [Chat$1];
2938
2996
  };
2939
2997
 
2940
2998
  const getQuickPickMenuEntries = () => {
@@ -7591,7 +7649,8 @@ const handleClickDictationButton = async state => {
7591
7649
 
7592
7650
  const handleClickNew = async state => {
7593
7651
  const newState = await createSession(state);
7594
- return focusInput(newState);
7652
+ const clearedState = await clearInput(newState);
7653
+ return focusInput(clearedState);
7595
7654
  };
7596
7655
 
7597
7656
  const handleClickReadFile = async uri => {
@@ -7819,8 +7878,13 @@ const handleKeyDown = async (state, key, shiftKey) => {
7819
7878
  return handleSubmit(submitState);
7820
7879
  };
7821
7880
 
7822
- const handleMessagesContextMenu = async state => {
7823
- await invoke$1('ContextMenu.show', 1234);
7881
+ const handleMessagesContextMenu = async (state, button, x, y) => {
7882
+ const {
7883
+ uid
7884
+ } = state;
7885
+ await showContextMenu2(uid, Chat$1, x, y, {
7886
+ menuId: Chat$1
7887
+ });
7824
7888
  return state;
7825
7889
  };
7826
7890
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/chat-view",
3
- "version": "6.4.0",
3
+ "version": "6.6.0",
4
4
  "description": "Chat View Worker",
5
5
  "repository": {
6
6
  "type": "git",