@lvce-editor/source-control-worker 2.5.0 → 2.7.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.
|
@@ -981,6 +981,10 @@ const create$5 = async ({
|
|
|
981
981
|
messagePort.start();
|
|
982
982
|
return rpc;
|
|
983
983
|
};
|
|
984
|
+
const PlainMessagePortRpc = {
|
|
985
|
+
__proto__: null,
|
|
986
|
+
create: create$5
|
|
987
|
+
};
|
|
984
988
|
const create$3 = async ({
|
|
985
989
|
commandMap,
|
|
986
990
|
send
|
|
@@ -1054,6 +1058,7 @@ const TargetName = 'event.target.name';
|
|
|
1054
1058
|
const TargetValue = 'event.target.value';
|
|
1055
1059
|
|
|
1056
1060
|
const User = 1;
|
|
1061
|
+
const Script = 2;
|
|
1057
1062
|
|
|
1058
1063
|
const DebugWorker = 55;
|
|
1059
1064
|
const ExtensionHostWorker = 44;
|
|
@@ -1149,6 +1154,14 @@ const getFilePathElectron = async file => {
|
|
|
1149
1154
|
const showContextMenu = async (x, y, id, ...args) => {
|
|
1150
1155
|
return invoke$2('ContextMenu.show', x, y, id, ...args);
|
|
1151
1156
|
};
|
|
1157
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1158
|
+
number(uid);
|
|
1159
|
+
number(menuId);
|
|
1160
|
+
number(x);
|
|
1161
|
+
number(y);
|
|
1162
|
+
// @ts-ignore
|
|
1163
|
+
await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1164
|
+
};
|
|
1152
1165
|
const getElectronVersion = async () => {
|
|
1153
1166
|
return invoke$2('Process.getElectronVersion');
|
|
1154
1167
|
};
|
|
@@ -1264,6 +1277,9 @@ const getKeyBindings = async () => {
|
|
|
1264
1277
|
const writeClipBoardText = async text => {
|
|
1265
1278
|
await invoke$2('ClipBoard.writeText', /* text */text);
|
|
1266
1279
|
};
|
|
1280
|
+
const readClipBoardText = async () => {
|
|
1281
|
+
return invoke$2('ClipBoard.readText');
|
|
1282
|
+
};
|
|
1267
1283
|
const writeClipBoardImage = async blob => {
|
|
1268
1284
|
// @ts-ignore
|
|
1269
1285
|
await invoke$2('ClipBoard.writeImage', /* text */blob);
|
|
@@ -1307,6 +1323,11 @@ const sendMessagePortToRendererProcess = async port => {
|
|
|
1307
1323
|
// @ts-ignore
|
|
1308
1324
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1309
1325
|
};
|
|
1326
|
+
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1327
|
+
const command = 'TextMeasurement.handleMessagePort';
|
|
1328
|
+
// @ts-ignore
|
|
1329
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1330
|
+
};
|
|
1310
1331
|
const getPreference = async key => {
|
|
1311
1332
|
return await invoke$2('Preferences.get', key);
|
|
1312
1333
|
};
|
|
@@ -1378,7 +1399,7 @@ const openExtensionSearch = async () => {
|
|
|
1378
1399
|
};
|
|
1379
1400
|
const setExtensionsSearchValue = async searchValue => {
|
|
1380
1401
|
// @ts-ignore
|
|
1381
|
-
return invoke$2('Extensions.handleInput', searchValue);
|
|
1402
|
+
return invoke$2('Extensions.handleInput', searchValue, Script);
|
|
1382
1403
|
};
|
|
1383
1404
|
const openExternal = async uri => {
|
|
1384
1405
|
// @ts-ignore
|
|
@@ -1455,6 +1476,7 @@ const RendererWorker = {
|
|
|
1455
1476
|
openUri: openUri$1,
|
|
1456
1477
|
openUrl,
|
|
1457
1478
|
openWidget,
|
|
1479
|
+
readClipBoardText,
|
|
1458
1480
|
readFile: readFile$1,
|
|
1459
1481
|
registerMockRpc,
|
|
1460
1482
|
registerWebViewInterceptor,
|
|
@@ -1472,6 +1494,7 @@ const RendererWorker = {
|
|
|
1472
1494
|
sendMessagePortToRendererProcess,
|
|
1473
1495
|
sendMessagePortToSearchProcess,
|
|
1474
1496
|
sendMessagePortToSyntaxHighlightingWorker,
|
|
1497
|
+
sendMessagePortToTextMeasurementWorker,
|
|
1475
1498
|
set: set$2,
|
|
1476
1499
|
setAdditionalFocus,
|
|
1477
1500
|
setColorTheme,
|
|
@@ -1480,6 +1503,7 @@ const RendererWorker = {
|
|
|
1480
1503
|
setWebViewPort,
|
|
1481
1504
|
setWorkspacePath,
|
|
1482
1505
|
showContextMenu,
|
|
1506
|
+
showContextMenu2,
|
|
1483
1507
|
showErrorDialog,
|
|
1484
1508
|
showMessageBox,
|
|
1485
1509
|
showSaveFilePicker,
|
|
@@ -1522,10 +1546,11 @@ const create = () => {
|
|
|
1522
1546
|
wrapCommand(fn) {
|
|
1523
1547
|
const wrapped = async (uid, ...args) => {
|
|
1524
1548
|
const {
|
|
1549
|
+
oldState,
|
|
1525
1550
|
newState
|
|
1526
1551
|
} = states[uid];
|
|
1527
1552
|
const newerState = await fn(newState, ...args);
|
|
1528
|
-
if (newState === newerState) {
|
|
1553
|
+
if (oldState === newerState || newState === newerState) {
|
|
1529
1554
|
return;
|
|
1530
1555
|
}
|
|
1531
1556
|
const latest = states[uid];
|
|
@@ -1701,6 +1726,7 @@ const executeProvider = async ({
|
|
|
1701
1726
|
};
|
|
1702
1727
|
|
|
1703
1728
|
const CommandExecute = 'ExtensionHostCommand.executeCommand';
|
|
1729
|
+
const SourceControlGetFileDecorations = 'ExtensionHost.sourceControlFileDecorations';
|
|
1704
1730
|
const SourceControlGetEnabledProviderIds = 'ExtensionHostSourceControl.getEnabledProviderIds';
|
|
1705
1731
|
const SourceControlGetFileBefore = 'ExtensionHostSourceControl.getFileBefore';
|
|
1706
1732
|
const SourceControlGetGroups = 'ExtensionHostSourceControl.getGroups';
|
|
@@ -1869,6 +1895,13 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
|
|
|
1869
1895
|
return finalDeltaY;
|
|
1870
1896
|
};
|
|
1871
1897
|
|
|
1898
|
+
const getFileDecorations$1 = (providerId, uris) => {
|
|
1899
|
+
return executeProvider({
|
|
1900
|
+
event: 'none',
|
|
1901
|
+
method: SourceControlGetFileDecorations,
|
|
1902
|
+
params: [providerId, uris]
|
|
1903
|
+
});
|
|
1904
|
+
};
|
|
1872
1905
|
const getFileBefore$1 = (providerId, path) => {
|
|
1873
1906
|
return executeProvider({
|
|
1874
1907
|
event: 'none',
|
|
@@ -1899,6 +1932,9 @@ const getIconDefinitions$1 = async providerId => {
|
|
|
1899
1932
|
return result;
|
|
1900
1933
|
};
|
|
1901
1934
|
|
|
1935
|
+
const getFileDecorations = (providerId, uris) => {
|
|
1936
|
+
return getFileDecorations$1(providerId, uris);
|
|
1937
|
+
};
|
|
1902
1938
|
const getFileBefore = (providerId, file) => {
|
|
1903
1939
|
return getFileBefore$1(providerId, file);
|
|
1904
1940
|
};
|
|
@@ -2384,6 +2420,13 @@ const handleInput = async (state, value, inputSource = User) => {
|
|
|
2384
2420
|
};
|
|
2385
2421
|
};
|
|
2386
2422
|
|
|
2423
|
+
const handleMessagePort = async port => {
|
|
2424
|
+
await PlainMessagePortRpc.create({
|
|
2425
|
+
commandMap: {},
|
|
2426
|
+
messagePort: port
|
|
2427
|
+
});
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2387
2430
|
const handleMouseOut = (state, index) => {
|
|
2388
2431
|
const {
|
|
2389
2432
|
items
|
|
@@ -2973,8 +3016,10 @@ const viewAsTree = state => {
|
|
|
2973
3016
|
const commandMap = {
|
|
2974
3017
|
'Initialize.initialize': initialize,
|
|
2975
3018
|
'SourceControl.create2': create2,
|
|
3019
|
+
'SourceControl.handleMessagePort': handleMessagePort,
|
|
2976
3020
|
'SourceControl.diff2': diff2,
|
|
2977
3021
|
'SourceControl.getCommandIds': getCommandIds,
|
|
3022
|
+
'SourceControl.getFileDecorations': getFileDecorations,
|
|
2978
3023
|
'SourceControl.getInfo': getInfo,
|
|
2979
3024
|
'SourceControl.handleButtonClick': wrapCommand(handleButtonClick),
|
|
2980
3025
|
'SourceControl.handleClickAt': wrapCommand(handleClickAt),
|