@lvce-editor/chat-view 6.4.0 → 6.5.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 +67 -4
- package/package.json +1 -1
|
@@ -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 = () => {
|
|
@@ -7819,8 +7877,13 @@ const handleKeyDown = async (state, key, shiftKey) => {
|
|
|
7819
7877
|
return handleSubmit(submitState);
|
|
7820
7878
|
};
|
|
7821
7879
|
|
|
7822
|
-
const handleMessagesContextMenu = async state => {
|
|
7823
|
-
|
|
7880
|
+
const handleMessagesContextMenu = async (state, button, x, y) => {
|
|
7881
|
+
const {
|
|
7882
|
+
uid
|
|
7883
|
+
} = state;
|
|
7884
|
+
await showContextMenu2(uid, Chat$1, x, y, {
|
|
7885
|
+
menuId: Chat$1
|
|
7886
|
+
});
|
|
7824
7887
|
return state;
|
|
7825
7888
|
};
|
|
7826
7889
|
|