@lvce-editor/source-control-worker 2.6.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];
|
|
@@ -2395,6 +2420,13 @@ const handleInput = async (state, value, inputSource = User) => {
|
|
|
2395
2420
|
};
|
|
2396
2421
|
};
|
|
2397
2422
|
|
|
2423
|
+
const handleMessagePort = async port => {
|
|
2424
|
+
await PlainMessagePortRpc.create({
|
|
2425
|
+
commandMap: {},
|
|
2426
|
+
messagePort: port
|
|
2427
|
+
});
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2398
2430
|
const handleMouseOut = (state, index) => {
|
|
2399
2431
|
const {
|
|
2400
2432
|
items
|
|
@@ -2984,6 +3016,7 @@ const viewAsTree = state => {
|
|
|
2984
3016
|
const commandMap = {
|
|
2985
3017
|
'Initialize.initialize': initialize,
|
|
2986
3018
|
'SourceControl.create2': create2,
|
|
3019
|
+
'SourceControl.handleMessagePort': handleMessagePort,
|
|
2987
3020
|
'SourceControl.diff2': diff2,
|
|
2988
3021
|
'SourceControl.getCommandIds': getCommandIds,
|
|
2989
3022
|
'SourceControl.getFileDecorations': getFileDecorations,
|