@lvce-editor/main-area-worker 9.44.2 → 9.45.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/mainAreaWorkerMain.js +114 -75
- package/package.json +1 -1
|
@@ -1269,7 +1269,7 @@ const createMockRpc = ({
|
|
|
1269
1269
|
};
|
|
1270
1270
|
|
|
1271
1271
|
const rpcs = Object.create(null);
|
|
1272
|
-
const set$
|
|
1272
|
+
const set$8 = (id, rpc) => {
|
|
1273
1273
|
rpcs[id] = rpc;
|
|
1274
1274
|
};
|
|
1275
1275
|
const get$1 = id => {
|
|
@@ -1302,7 +1302,7 @@ const create$4 = rpcId => {
|
|
|
1302
1302
|
const mockRpc = createMockRpc({
|
|
1303
1303
|
commandMap
|
|
1304
1304
|
});
|
|
1305
|
-
set$
|
|
1305
|
+
set$8(rpcId, mockRpc);
|
|
1306
1306
|
// @ts-ignore
|
|
1307
1307
|
mockRpc[Symbol.dispose] = () => {
|
|
1308
1308
|
remove(rpcId);
|
|
@@ -1311,7 +1311,7 @@ const create$4 = rpcId => {
|
|
|
1311
1311
|
return mockRpc;
|
|
1312
1312
|
},
|
|
1313
1313
|
set(rpc) {
|
|
1314
|
-
set$
|
|
1314
|
+
set$8(rpcId, rpc);
|
|
1315
1315
|
}
|
|
1316
1316
|
};
|
|
1317
1317
|
};
|
|
@@ -1513,6 +1513,7 @@ const ClipBoardWorker = 3400;
|
|
|
1513
1513
|
const DialogWorker = 7014;
|
|
1514
1514
|
const DragAndDropWorker = 3404;
|
|
1515
1515
|
const IconThemeWorker = 7009;
|
|
1516
|
+
const RendererProcess = 1670;
|
|
1516
1517
|
const RendererWorker = 1;
|
|
1517
1518
|
|
|
1518
1519
|
const SetCss = 'Viewlet.setCss';
|
|
@@ -1522,49 +1523,54 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1522
1523
|
const FocusEditorText = 12;
|
|
1523
1524
|
|
|
1524
1525
|
const {
|
|
1525
|
-
invoke: invoke$
|
|
1526
|
-
set: set$
|
|
1526
|
+
invoke: invoke$6,
|
|
1527
|
+
set: set$7
|
|
1527
1528
|
} = create$4(ClipBoardWorker);
|
|
1528
1529
|
const writeText = async text => {
|
|
1529
|
-
return invoke$
|
|
1530
|
+
return invoke$6('ClipBoard.writeText', text);
|
|
1530
1531
|
};
|
|
1531
1532
|
|
|
1532
1533
|
const {
|
|
1533
|
-
invoke: invoke$
|
|
1534
|
-
set: set$
|
|
1534
|
+
invoke: invoke$5,
|
|
1535
|
+
set: set$6
|
|
1535
1536
|
} = create$4(DialogWorker);
|
|
1536
1537
|
|
|
1537
1538
|
const {
|
|
1538
|
-
invoke: invoke$
|
|
1539
|
-
set: set$
|
|
1539
|
+
invoke: invoke$4,
|
|
1540
|
+
set: set$5
|
|
1540
1541
|
} = create$4(DragAndDropWorker);
|
|
1541
1542
|
const getDroppedItems = async (itemIds, isElectron) => {
|
|
1542
|
-
return invoke$
|
|
1543
|
+
return invoke$4('DragAndDrop.getDroppedItems', itemIds, isElectron);
|
|
1543
1544
|
};
|
|
1544
1545
|
|
|
1545
1546
|
const {
|
|
1546
|
-
invoke: invoke$
|
|
1547
|
-
set: set$
|
|
1547
|
+
invoke: invoke$3,
|
|
1548
|
+
set: set$4
|
|
1548
1549
|
} = create$4(IconThemeWorker);
|
|
1549
1550
|
const getIcons = async iconRequests => {
|
|
1550
1551
|
// @ts-ignore
|
|
1551
|
-
return invoke$
|
|
1552
|
+
return invoke$3('IconTheme.getIcons', iconRequests);
|
|
1552
1553
|
};
|
|
1553
1554
|
|
|
1554
1555
|
const {
|
|
1555
|
-
invoke,
|
|
1556
|
+
invoke: invoke$2,
|
|
1557
|
+
set: set$3
|
|
1558
|
+
} = create$4(RendererProcess);
|
|
1559
|
+
|
|
1560
|
+
const {
|
|
1561
|
+
invoke: invoke$1,
|
|
1556
1562
|
invokeAndTransfer,
|
|
1557
|
-
set: set$
|
|
1563
|
+
set: set$2
|
|
1558
1564
|
} = create$4(RendererWorker);
|
|
1559
1565
|
const handleModifiedStatusChange$1 = async (uri, modified) => {
|
|
1560
|
-
return invoke('Main.handleModifiedStatusChange', uri, modified);
|
|
1566
|
+
return invoke$1('Main.handleModifiedStatusChange', uri, modified);
|
|
1561
1567
|
};
|
|
1562
1568
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1563
1569
|
number(uid);
|
|
1564
1570
|
number(menuId);
|
|
1565
1571
|
number(x);
|
|
1566
1572
|
number(y);
|
|
1567
|
-
await invoke('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1573
|
+
await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1568
1574
|
};
|
|
1569
1575
|
const sendMessagePortToClipBoardWorker$1 = async (port, rpcId) => {
|
|
1570
1576
|
const command = 'ClipBoard.handleMessagePort';
|
|
@@ -1583,10 +1589,10 @@ const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
|
1583
1589
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1584
1590
|
};
|
|
1585
1591
|
const readFile = async uri => {
|
|
1586
|
-
return invoke('FileSystem.readFile', uri);
|
|
1592
|
+
return invoke$1('FileSystem.readFile', uri);
|
|
1587
1593
|
};
|
|
1588
1594
|
const confirm$1 = async (message, options) => {
|
|
1589
|
-
const result = await invoke('ConfirmPrompt.prompt', message, options);
|
|
1595
|
+
const result = await invoke$1('ConfirmPrompt.prompt', message, options);
|
|
1590
1596
|
return result;
|
|
1591
1597
|
};
|
|
1592
1598
|
|
|
@@ -1966,12 +1972,12 @@ const closeTab = (state, groupId, tabId) => {
|
|
|
1966
1972
|
const handleAttach = async command => {
|
|
1967
1973
|
// TODO find a better way to append editors
|
|
1968
1974
|
const parentNodeSelector = '.editor-groups-container, .EditorGroup';
|
|
1969
|
-
await invoke('Layout.attachViewlet', parentNodeSelector, command.instanceId);
|
|
1975
|
+
await invoke$1('Layout.attachViewlet', parentNodeSelector, command.instanceId);
|
|
1970
1976
|
};
|
|
1971
1977
|
|
|
1972
1978
|
const getViewletTitle = async editorUid => {
|
|
1973
1979
|
try {
|
|
1974
|
-
const title = await invoke('Viewlet.getTitle', editorUid);
|
|
1980
|
+
const title = await invoke$1('Viewlet.getTitle', editorUid);
|
|
1975
1981
|
return typeof title === 'string' && title ? title : undefined;
|
|
1976
1982
|
} catch {
|
|
1977
1983
|
return undefined;
|
|
@@ -1979,9 +1985,9 @@ const getViewletTitle = async editorUid => {
|
|
|
1979
1985
|
};
|
|
1980
1986
|
const createViewletContent = async (viewletModuleId, editorUid, tabId, bounds, uri, args) => {
|
|
1981
1987
|
if (args === undefined) {
|
|
1982
|
-
await invoke('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
|
|
1988
|
+
await invoke$1('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
|
|
1983
1989
|
} else {
|
|
1984
|
-
await invoke('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri, args);
|
|
1990
|
+
await invoke$1('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri, args);
|
|
1985
1991
|
}
|
|
1986
1992
|
};
|
|
1987
1993
|
const createViewlet = async (viewletModuleId, editorUid, tabId, bounds, uri, args) => {
|
|
@@ -2018,7 +2024,7 @@ const notifyActiveEditorChange = async (oldState, newState) => {
|
|
|
2018
2024
|
return;
|
|
2019
2025
|
}
|
|
2020
2026
|
try {
|
|
2021
|
-
await invoke('Layout.handleActiveEditorChange', newUri);
|
|
2027
|
+
await invoke$1('Layout.handleActiveEditorChange', newUri);
|
|
2022
2028
|
} catch (error) {
|
|
2023
2029
|
console.warn('Failed to notify viewlets about active editor change', error);
|
|
2024
2030
|
}
|
|
@@ -2045,7 +2051,7 @@ const notifyMountedViewlets = async (oldState, newState) => {
|
|
|
2045
2051
|
return;
|
|
2046
2052
|
}
|
|
2047
2053
|
try {
|
|
2048
|
-
await invoke('Layout.setMountedViewlets', newState.uid, newViewletUids);
|
|
2054
|
+
await invoke$1('Layout.setMountedViewlets', newState.uid, newViewletUids);
|
|
2049
2055
|
} catch (error) {
|
|
2050
2056
|
console.warn('Failed to publish mounted viewlets', error);
|
|
2051
2057
|
}
|
|
@@ -2075,7 +2081,7 @@ const {
|
|
|
2075
2081
|
getCommandIds,
|
|
2076
2082
|
getKeys: getKeys$1,
|
|
2077
2083
|
registerCommands,
|
|
2078
|
-
set,
|
|
2084
|
+
set: set$1,
|
|
2079
2085
|
wrapGetter
|
|
2080
2086
|
} = registry;
|
|
2081
2087
|
const wrapAsyncCommand = fn => {
|
|
@@ -2319,24 +2325,24 @@ const handleCreate = async command => {
|
|
|
2319
2325
|
oldState
|
|
2320
2326
|
} = get(command.uid);
|
|
2321
2327
|
const readyState = handleViewletReady(state, command.editorUid, title);
|
|
2322
|
-
set(command.uid, oldState, readyState);
|
|
2328
|
+
set$1(command.uid, oldState, readyState);
|
|
2323
2329
|
return readyState;
|
|
2324
2330
|
};
|
|
2325
2331
|
|
|
2326
2332
|
const handleDetach = async command => {
|
|
2327
2333
|
// Hides viewlet but keeps it alive
|
|
2328
2334
|
|
|
2329
|
-
await invoke('Viewlet.detach', command.instanceId);
|
|
2335
|
+
await invoke$1('Viewlet.detach', command.instanceId);
|
|
2330
2336
|
};
|
|
2331
2337
|
|
|
2332
2338
|
const handleDispose = async command => {
|
|
2333
2339
|
// Fully destroys viewlet
|
|
2334
2340
|
|
|
2335
|
-
await invoke('Viewlet.dispose', command.instanceId);
|
|
2341
|
+
await invoke$1('Viewlet.dispose', command.instanceId);
|
|
2336
2342
|
};
|
|
2337
2343
|
|
|
2338
2344
|
const handleSetBounds = async command => {
|
|
2339
|
-
await invoke('Viewlet.setBounds', command.instanceId, command.bounds);
|
|
2345
|
+
await invoke$1('Viewlet.setBounds', command.instanceId, command.bounds);
|
|
2340
2346
|
};
|
|
2341
2347
|
|
|
2342
2348
|
const executeViewletCommand = async command => {
|
|
@@ -2420,13 +2426,13 @@ const closeTabWithViewlet = async (state, groupId, tabId) => {
|
|
|
2420
2426
|
};
|
|
2421
2427
|
|
|
2422
2428
|
const saveEditor = async editorUid => {
|
|
2423
|
-
return invoke('Editor.save', editorUid);
|
|
2429
|
+
return invoke$1('Editor.save', editorUid);
|
|
2424
2430
|
};
|
|
2425
2431
|
|
|
2426
2432
|
const missingDialogWorkerRelay = 'Command "SendMessagePortToExtensionHostWorker.sendMessagePortToDialogWorker" not found';
|
|
2427
2433
|
const confirm = async (message, options) => {
|
|
2428
2434
|
try {
|
|
2429
|
-
return await invoke$
|
|
2435
|
+
return await invoke$5('ConfirmPrompt.prompt', message, options);
|
|
2430
2436
|
} catch (error) {
|
|
2431
2437
|
if (!String(error).includes(missingDialogWorkerRelay)) {
|
|
2432
2438
|
throw error;
|
|
@@ -2506,7 +2512,7 @@ const disposeEditors = async editorUids => {
|
|
|
2506
2512
|
// Dispose all child viewlets in the renderer worker
|
|
2507
2513
|
for (const editorUid of editorUids) {
|
|
2508
2514
|
try {
|
|
2509
|
-
await invoke('Viewlet.dispose', editorUid);
|
|
2515
|
+
await invoke$1('Viewlet.dispose', editorUid);
|
|
2510
2516
|
} catch {
|
|
2511
2517
|
// Silently ignore errors during disposal
|
|
2512
2518
|
// Viewlet may already be disposed or renderer worker may not be available
|
|
@@ -2807,7 +2813,7 @@ const copyIntoNewWindow$1 = async state => {
|
|
|
2807
2813
|
if (!tab?.uri) {
|
|
2808
2814
|
return state;
|
|
2809
2815
|
}
|
|
2810
|
-
await invoke('ElectronWindow.openNewWithUri', tab.uri);
|
|
2816
|
+
await invoke$1('ElectronWindow.openNewWithUri', tab.uri);
|
|
2811
2817
|
return state;
|
|
2812
2818
|
};
|
|
2813
2819
|
|
|
@@ -2819,7 +2825,7 @@ const copyPath$1 = async (state, path) => {
|
|
|
2819
2825
|
|
|
2820
2826
|
const copyRelativePath$1 = async (state, path) => {
|
|
2821
2827
|
string(path);
|
|
2822
|
-
const relativePath = await invoke('Workspace.pathBaseName', path);
|
|
2828
|
+
const relativePath = await invoke$1('Workspace.pathBaseName', path);
|
|
2823
2829
|
await writeText(relativePath);
|
|
2824
2830
|
return state;
|
|
2825
2831
|
};
|
|
@@ -2871,7 +2877,7 @@ const create$1 = (uid, uri, x, y, width, height, platform, assetDir, tabHeight =
|
|
|
2871
2877
|
x,
|
|
2872
2878
|
y
|
|
2873
2879
|
};
|
|
2874
|
-
set(uid, state, state);
|
|
2880
|
+
set$1(uid, state, state);
|
|
2875
2881
|
};
|
|
2876
2882
|
|
|
2877
2883
|
const isEqual$3 = (oldState, newState) => {
|
|
@@ -2945,7 +2951,7 @@ const focus = async state => {
|
|
|
2945
2951
|
if (typeof editorUid !== 'number' || editorUid < 0) {
|
|
2946
2952
|
return state;
|
|
2947
2953
|
}
|
|
2948
|
-
await invoke('Viewlet.focusSelector', editorUid, '[name="editor"]');
|
|
2954
|
+
await invoke$1('Viewlet.focusSelector', editorUid, '[name="editor"]');
|
|
2949
2955
|
return state;
|
|
2950
2956
|
};
|
|
2951
2957
|
|
|
@@ -3251,7 +3257,7 @@ const getViewletModuleId$1 = async (uri, opener) => {
|
|
|
3251
3257
|
// Query RendererWorker for viewlet module ID (optional, may fail in tests)
|
|
3252
3258
|
let viewletModuleId;
|
|
3253
3259
|
try {
|
|
3254
|
-
viewletModuleId = opener === undefined ? await invoke('Layout.getModuleId', uri) : await invoke('Layout.getModuleId', uri, opener);
|
|
3260
|
+
viewletModuleId = opener === undefined ? await invoke$1('Layout.getModuleId', uri) : await invoke$1('Layout.getModuleId', uri, opener);
|
|
3255
3261
|
} catch {
|
|
3256
3262
|
// Viewlet creation is optional - silently ignore if RendererWorker isn't available
|
|
3257
3263
|
}
|
|
@@ -3289,7 +3295,7 @@ const getViewletModuleIdForEditorInput = async editorInput => {
|
|
|
3289
3295
|
|
|
3290
3296
|
const getViewletModuleId = async tab => {
|
|
3291
3297
|
const normalizedTab = normalizeTabEditorInput(tab);
|
|
3292
|
-
return normalizedTab.editorInput ? getViewletModuleIdForEditorInput(normalizedTab.editorInput) : invoke('Layout.getModuleId', normalizedTab.uri);
|
|
3298
|
+
return normalizedTab.editorInput ? getViewletModuleIdForEditorInput(normalizedTab.editorInput) : invoke$1('Layout.getModuleId', normalizedTab.uri);
|
|
3293
3299
|
};
|
|
3294
3300
|
|
|
3295
3301
|
const startContentLoading = async (oldState, state, tabId, path, requestId) => {
|
|
@@ -3300,7 +3306,7 @@ const startContentLoading = async (oldState, state, tabId, path, requestId) => {
|
|
|
3300
3306
|
const getLatestState = () => {
|
|
3301
3307
|
return get(uid).newState;
|
|
3302
3308
|
};
|
|
3303
|
-
set(uid, oldState, state);
|
|
3309
|
+
set$1(uid, oldState, state);
|
|
3304
3310
|
const newState = await loadTabContentAsync(tabId, path, requestId, getLatestState);
|
|
3305
3311
|
return newState;
|
|
3306
3312
|
} catch {
|
|
@@ -3331,7 +3337,7 @@ const maybeCreateViewletForSelectedTab = async (state, newState, groupIndex, ind
|
|
|
3331
3337
|
}
|
|
3332
3338
|
const bounds = getSelectedTabBounds(newState);
|
|
3333
3339
|
let stateWithViewlet = createViewletForTab(newState, tabId);
|
|
3334
|
-
set(uid, state, stateWithViewlet);
|
|
3340
|
+
set$1(uid, state, stateWithViewlet);
|
|
3335
3341
|
if (switchCommands.length > 0) {
|
|
3336
3342
|
await executeViewletCommands(switchCommands);
|
|
3337
3343
|
}
|
|
@@ -3343,7 +3349,7 @@ const maybeCreateViewletForSelectedTab = async (state, newState, groupIndex, ind
|
|
|
3343
3349
|
if (editorUid !== -1 && selectedTab.uri) {
|
|
3344
3350
|
const title = await createViewlet(viewletModuleId, editorUid, tabId, bounds, selectedTab.uri);
|
|
3345
3351
|
stateWithViewlet = handleViewletReady(stateWithViewlet, editorUid, title);
|
|
3346
|
-
set(uid, state, stateWithViewlet);
|
|
3352
|
+
set$1(uid, state, stateWithViewlet);
|
|
3347
3353
|
}
|
|
3348
3354
|
}
|
|
3349
3355
|
return maybeStartLoading(state, stateWithViewlet, tabId, tab, needsLoading, requestId);
|
|
@@ -3397,7 +3403,7 @@ const selectTab = async (state, groupIndex, index) => {
|
|
|
3397
3403
|
if (maybeCreatedState) {
|
|
3398
3404
|
return maybeCreatedState;
|
|
3399
3405
|
}
|
|
3400
|
-
set(uid, state, newState);
|
|
3406
|
+
set$1(uid, state, newState);
|
|
3401
3407
|
if (switchCommands.length > 0) {
|
|
3402
3408
|
await executeViewletCommands(switchCommands);
|
|
3403
3409
|
}
|
|
@@ -3491,7 +3497,7 @@ const handleClickTogglePreview = async state => {
|
|
|
3491
3497
|
if (!activeTabInfo || !activeTabInfo.tab.uri) {
|
|
3492
3498
|
return state;
|
|
3493
3499
|
}
|
|
3494
|
-
await invoke('Layout.showPreview', activeTabInfo.tab.uri);
|
|
3500
|
+
await invoke$1('Layout.showPreview', activeTabInfo.tab.uri);
|
|
3495
3501
|
return state;
|
|
3496
3502
|
};
|
|
3497
3503
|
|
|
@@ -3570,14 +3576,14 @@ const getCurrentState = state => {
|
|
|
3570
3576
|
} = state;
|
|
3571
3577
|
const stateFromStore = get(uid);
|
|
3572
3578
|
if (!stateFromStore) {
|
|
3573
|
-
set(uid, state, state);
|
|
3579
|
+
set$1(uid, state, state);
|
|
3574
3580
|
return state;
|
|
3575
3581
|
}
|
|
3576
3582
|
const storedState = stateFromStore.newState;
|
|
3577
3583
|
if (getTabCount(storedState) > getTabCount(state)) {
|
|
3578
3584
|
return storedState;
|
|
3579
3585
|
}
|
|
3580
|
-
set(uid, state, state);
|
|
3586
|
+
set$1(uid, state, state);
|
|
3581
3587
|
return state;
|
|
3582
3588
|
};
|
|
3583
3589
|
|
|
@@ -3912,7 +3918,7 @@ const isDirectoryEditorInput = async editorInput => {
|
|
|
3912
3918
|
return false;
|
|
3913
3919
|
}
|
|
3914
3920
|
try {
|
|
3915
|
-
const type = await invoke('FileSystem.stat', editorInput.uri);
|
|
3921
|
+
const type = await invoke$1('FileSystem.stat', editorInput.uri);
|
|
3916
3922
|
return type === Directory;
|
|
3917
3923
|
} catch {
|
|
3918
3924
|
return false;
|
|
@@ -4069,7 +4075,7 @@ const updateTabIcon = async (context, readyState, tabId) => {
|
|
|
4069
4075
|
|
|
4070
4076
|
const renderMainAreaPending = async uid => {
|
|
4071
4077
|
try {
|
|
4072
|
-
await invoke('Layout.renderMainAreaPending', uid);
|
|
4078
|
+
await invoke$1('Layout.renderMainAreaPending', uid);
|
|
4073
4079
|
} catch {
|
|
4074
4080
|
// Older renderer workers render the final state when openInput completes.
|
|
4075
4081
|
}
|
|
@@ -4215,7 +4221,7 @@ const openInput = async (state, options) => {
|
|
|
4215
4221
|
const storedState = get(uid);
|
|
4216
4222
|
const latestState = storedState?.newState ?? currentState;
|
|
4217
4223
|
currentState = updater(latestState);
|
|
4218
|
-
set(uid, storedState?.oldState ?? state, currentState);
|
|
4224
|
+
set$1(uid, storedState?.oldState ?? state, currentState);
|
|
4219
4225
|
return Promise.resolve(currentState);
|
|
4220
4226
|
}
|
|
4221
4227
|
};
|
|
@@ -4433,7 +4439,7 @@ const restoreClosedTab = async state => {
|
|
|
4433
4439
|
return state;
|
|
4434
4440
|
}
|
|
4435
4441
|
const newState = await selectTab(restored.newState, restored.groupIndex, restored.tabIndex);
|
|
4436
|
-
set(state.uid, state, newState);
|
|
4442
|
+
set$1(state.uid, state, newState);
|
|
4437
4443
|
return newState;
|
|
4438
4444
|
};
|
|
4439
4445
|
|
|
@@ -5146,10 +5152,10 @@ const applyDropAction = async (context, action, splitDirection) => {
|
|
|
5146
5152
|
break;
|
|
5147
5153
|
}
|
|
5148
5154
|
case 'setPath':
|
|
5149
|
-
void invoke('Workspace.setPath', action.value).catch(() => {});
|
|
5155
|
+
void invoke$1('Workspace.setPath', action.value).catch(() => {});
|
|
5150
5156
|
break;
|
|
5151
5157
|
case 'setUri':
|
|
5152
|
-
void invoke('Workspace.setUri', action.value).catch(() => {});
|
|
5158
|
+
void invoke$1('Workspace.setUri', action.value).catch(() => {});
|
|
5153
5159
|
break;
|
|
5154
5160
|
}
|
|
5155
5161
|
};
|
|
@@ -5316,7 +5322,7 @@ const newFile = async state => {
|
|
|
5316
5322
|
newState: switchedState
|
|
5317
5323
|
} = switchViewlet(intermediateState);
|
|
5318
5324
|
intermediateState = switchedState;
|
|
5319
|
-
set(uid, state, intermediateState);
|
|
5325
|
+
set$1(uid, state, intermediateState);
|
|
5320
5326
|
|
|
5321
5327
|
// Get the tab to extract editorUid
|
|
5322
5328
|
const tabWithViewlet = findTabById(intermediateState, tabId);
|
|
@@ -5411,6 +5417,31 @@ const handleIconThemeChange = async state => {
|
|
|
5411
5417
|
};
|
|
5412
5418
|
};
|
|
5413
5419
|
|
|
5420
|
+
const state = {
|
|
5421
|
+
connected: false
|
|
5422
|
+
};
|
|
5423
|
+
const isConnected = () => {
|
|
5424
|
+
const {
|
|
5425
|
+
connected
|
|
5426
|
+
} = state;
|
|
5427
|
+
return connected;
|
|
5428
|
+
};
|
|
5429
|
+
const invoke = (method, ...params) => {
|
|
5430
|
+
return invoke$2(method, ...params);
|
|
5431
|
+
};
|
|
5432
|
+
const set = rpc => {
|
|
5433
|
+
set$3(rpc);
|
|
5434
|
+
state.connected = true;
|
|
5435
|
+
};
|
|
5436
|
+
|
|
5437
|
+
const handleMessagePort = async port => {
|
|
5438
|
+
const rpc = await create$8({
|
|
5439
|
+
commandMap: {},
|
|
5440
|
+
messagePort: port
|
|
5441
|
+
});
|
|
5442
|
+
set(rpc);
|
|
5443
|
+
};
|
|
5444
|
+
|
|
5414
5445
|
const handleModifiedStatusChange = (state, uri, newStatus) => {
|
|
5415
5446
|
const {
|
|
5416
5447
|
layout
|
|
@@ -5447,7 +5478,7 @@ const handleModifiedStatusChangeWithContext = async (context, uri, newStatus) =>
|
|
|
5447
5478
|
|
|
5448
5479
|
const resizeChild = async (editorUid, dimensions) => {
|
|
5449
5480
|
try {
|
|
5450
|
-
return await invoke('Viewlet.resize', editorUid, dimensions);
|
|
5481
|
+
return await invoke$1('Viewlet.resize', editorUid, dimensions);
|
|
5451
5482
|
} catch {
|
|
5452
5483
|
return [];
|
|
5453
5484
|
}
|
|
@@ -5825,7 +5856,7 @@ const handleUriChange = async (state, oldUri, newUri) => {
|
|
|
5825
5856
|
}
|
|
5826
5857
|
if (renamedUri) {
|
|
5827
5858
|
if (tab.editorType === 'text' && tab.editorUid !== -1) {
|
|
5828
|
-
editorUriUpdates.push(invoke('Editor.handleUriChange', tab.editorUid, renamedUri));
|
|
5859
|
+
editorUriUpdates.push(invoke$1('Editor.handleUriChange', tab.editorUid, renamedUri));
|
|
5829
5860
|
}
|
|
5830
5861
|
const editorInput = tab.editorInput && 'uri' in tab.editorInput ? {
|
|
5831
5862
|
...tab.editorInput,
|
|
@@ -5875,7 +5906,7 @@ const toFileUri = path => {
|
|
|
5875
5906
|
};
|
|
5876
5907
|
const loadHomeDirUri = async () => {
|
|
5877
5908
|
try {
|
|
5878
|
-
const homeDir = await invoke('Workspace.getHomeDir');
|
|
5909
|
+
const homeDir = await invoke$1('Workspace.getHomeDir');
|
|
5879
5910
|
return typeof homeDir === 'string' ? toFileUri(homeDir) : '';
|
|
5880
5911
|
} catch {
|
|
5881
5912
|
return '';
|
|
@@ -6179,7 +6210,7 @@ const reloadChangedEditors = async (state, changed) => {
|
|
|
6179
6210
|
}
|
|
6180
6211
|
}
|
|
6181
6212
|
}
|
|
6182
|
-
await Promise.allSettled(Array.from(editorUids, editorUid => invoke('Viewlet.reload', editorUid)));
|
|
6213
|
+
await Promise.allSettled(Array.from(editorUids, editorUid => invoke$1('Viewlet.reload', editorUid)));
|
|
6183
6214
|
};
|
|
6184
6215
|
const handleWorkspaceRefresh = async (state, refresh = {}) => {
|
|
6185
6216
|
const changes = Array.isArray(refresh) ? {
|
|
@@ -6598,12 +6629,12 @@ const moveIntoNewWindow = async state => {
|
|
|
6598
6629
|
if (!tab?.uri) {
|
|
6599
6630
|
return state;
|
|
6600
6631
|
}
|
|
6601
|
-
await invoke('ElectronWindow.openNewWithUri', tab.uri);
|
|
6632
|
+
await invoke$1('ElectronWindow.openNewWithUri', tab.uri);
|
|
6602
6633
|
return closeTabAndSave(state, group.id, activeTabId);
|
|
6603
6634
|
};
|
|
6604
6635
|
|
|
6605
6636
|
const newWindow = async state => {
|
|
6606
|
-
await invoke('ElectronWindow.openNew');
|
|
6637
|
+
await invoke$1('ElectronWindow.openNew');
|
|
6607
6638
|
return state;
|
|
6608
6639
|
};
|
|
6609
6640
|
|
|
@@ -7679,7 +7710,7 @@ const renderPendingViewletUpdate = (oldState, newState) => {
|
|
|
7679
7710
|
const update = newState.pendingViewletUpdate;
|
|
7680
7711
|
newState.pendingViewletUpdate = undefined;
|
|
7681
7712
|
setTimeout(() => {
|
|
7682
|
-
void invoke('Viewlet.dispose', update.disposal).catch(() => {});
|
|
7713
|
+
void invoke$1('Viewlet.dispose', update.disposal).catch(() => {});
|
|
7683
7714
|
}, 50);
|
|
7684
7715
|
return update.focus === undefined ? [] : ['Viewlet.setFocusContext', update.focus, FocusEditorText, 0, update.focus, 'Editor'];
|
|
7685
7716
|
};
|
|
@@ -7718,9 +7749,16 @@ const render2 = (uid, diffResult) => {
|
|
|
7718
7749
|
newState,
|
|
7719
7750
|
oldState
|
|
7720
7751
|
} = get(uid);
|
|
7721
|
-
set(uid, newState, newState);
|
|
7752
|
+
set$1(uid, newState, newState);
|
|
7722
7753
|
const commands = applyRender(oldState, newState, diffResult);
|
|
7723
|
-
|
|
7754
|
+
if (!isConnected()) {
|
|
7755
|
+
return commands;
|
|
7756
|
+
}
|
|
7757
|
+
return renderDirect(uid, commands);
|
|
7758
|
+
};
|
|
7759
|
+
const renderDirect = async (uid, commands) => {
|
|
7760
|
+
const transactionId = await invoke('Viewlet.queueCommands', uid, commands);
|
|
7761
|
+
return [['Viewlet.commitPending', uid, transactionId]];
|
|
7724
7762
|
};
|
|
7725
7763
|
|
|
7726
7764
|
const renderEventListeners = () => {
|
|
@@ -7803,7 +7841,7 @@ const textEditorEntry = {
|
|
|
7803
7841
|
};
|
|
7804
7842
|
const getViewProviderEntries = async uri => {
|
|
7805
7843
|
try {
|
|
7806
|
-
const providers = await invoke('WebView.getEditorProviders');
|
|
7844
|
+
const providers = await invoke$1('WebView.getEditorProviders');
|
|
7807
7845
|
const matchingProviders = providers.filter(provider => provider?.id && provider.selector?.some(selector => uri.endsWith(selector)));
|
|
7808
7846
|
return [textEditorEntry, ...matchingProviders.map(provider => {
|
|
7809
7847
|
const titleElement = provider.elements?.find(element => element.type === 'title');
|
|
@@ -7838,7 +7876,7 @@ const reopenEditorWith = async (context, preferredEditorId) => {
|
|
|
7838
7876
|
label: entry.label,
|
|
7839
7877
|
value: entry
|
|
7840
7878
|
}));
|
|
7841
|
-
selected = await invoke('ExtensionHostQuickPick.showQuickPick', {
|
|
7879
|
+
selected = await invoke$1('ExtensionHostQuickPick.showQuickPick', {
|
|
7842
7880
|
items,
|
|
7843
7881
|
placeholder: 'Select Editor'
|
|
7844
7882
|
});
|
|
@@ -7889,7 +7927,7 @@ const reopenEditorWith = async (context, preferredEditorId) => {
|
|
|
7889
7927
|
await context.updateState(() => readyState);
|
|
7890
7928
|
if (oldEditorUid !== -1) {
|
|
7891
7929
|
try {
|
|
7892
|
-
await invoke('Viewlet.dispose', oldEditorUid);
|
|
7930
|
+
await invoke$1('Viewlet.dispose', oldEditorUid);
|
|
7893
7931
|
} catch {
|
|
7894
7932
|
// Reopening should still proceed if the previous viewlet was already disposed.
|
|
7895
7933
|
}
|
|
@@ -7918,7 +7956,7 @@ const settingsUri = 'app://settings.json';
|
|
|
7918
7956
|
const saveEditorAndHandleSettingsChange = async tab => {
|
|
7919
7957
|
const editorState = await saveEditor(tab.editorUid);
|
|
7920
7958
|
if (!editorState?.modified && tab.uri === settingsUri) {
|
|
7921
|
-
await invoke('Layout.handleSettingsChanged');
|
|
7959
|
+
await invoke$1('Layout.handleSettingsChanged');
|
|
7922
7960
|
}
|
|
7923
7961
|
return editorState;
|
|
7924
7962
|
};
|
|
@@ -8258,7 +8296,7 @@ const resize = async (uid, dimensions) => {
|
|
|
8258
8296
|
return [];
|
|
8259
8297
|
}
|
|
8260
8298
|
const resizedState = resize$1(instance.newState, dimensions);
|
|
8261
|
-
set(uid, instance.oldState, resizedState);
|
|
8299
|
+
set$1(uid, instance.oldState, resizedState);
|
|
8262
8300
|
return handleResize(resizedState, dimensions);
|
|
8263
8301
|
};
|
|
8264
8302
|
const commandMap = {
|
|
@@ -8324,6 +8362,7 @@ const commandMap = {
|
|
|
8324
8362
|
'MainArea.handleDrop': wrapSerialAsyncCommand(handleDrop),
|
|
8325
8363
|
'MainArea.handleHeaderDoubleClick': wrapSerialCommand(handleHeaderDoubleClick),
|
|
8326
8364
|
'MainArea.handleIconThemeChange': wrapSerialCommand(handleIconThemeChange),
|
|
8365
|
+
'MainArea.handleMessagePort': handleMessagePort,
|
|
8327
8366
|
'MainArea.handleModifiedStatusChange': wrapAsyncCommand(handleModifiedStatusChangeWithContext),
|
|
8328
8367
|
'MainArea.handleResize': resize,
|
|
8329
8368
|
'MainArea.handleSashCornerPointerDown': wrapSerialCommand(handleSashCornerPointerDown),
|
|
@@ -8380,7 +8419,7 @@ const initializeClipBoardWorker = async () => {
|
|
|
8380
8419
|
commandMap: {},
|
|
8381
8420
|
send: sendMessagePortToClipBoardWorker
|
|
8382
8421
|
});
|
|
8383
|
-
set$
|
|
8422
|
+
set$7(rpc);
|
|
8384
8423
|
};
|
|
8385
8424
|
|
|
8386
8425
|
const send$1 = async port => {
|
|
@@ -8394,7 +8433,7 @@ const createDragAndDropWorkerRpc = async () => {
|
|
|
8394
8433
|
};
|
|
8395
8434
|
|
|
8396
8435
|
const initializeDragAndDropWorker = async () => {
|
|
8397
|
-
set$
|
|
8436
|
+
set$5(await createDragAndDropWorkerRpc());
|
|
8398
8437
|
};
|
|
8399
8438
|
|
|
8400
8439
|
const send = port => {
|
|
@@ -8420,13 +8459,13 @@ const refreshFileIcons = async () => {
|
|
|
8420
8459
|
oldState
|
|
8421
8460
|
} = get(uid);
|
|
8422
8461
|
const updatedState = await handleIconThemeChange(newState);
|
|
8423
|
-
set(uid, oldState, updatedState);
|
|
8462
|
+
set$1(uid, oldState, updatedState);
|
|
8424
8463
|
}
|
|
8425
8464
|
};
|
|
8426
8465
|
|
|
8427
8466
|
const initializeIconThemeWorker = async () => {
|
|
8428
8467
|
const rpc = await createIconThemeWorkerRpc();
|
|
8429
|
-
set$
|
|
8468
|
+
set$4(rpc);
|
|
8430
8469
|
await refreshFileIcons();
|
|
8431
8470
|
};
|
|
8432
8471
|
|
|
@@ -8434,7 +8473,7 @@ const initializeRendererWorker = async () => {
|
|
|
8434
8473
|
const rpc = await create$5({
|
|
8435
8474
|
commandMap: commandMap
|
|
8436
8475
|
});
|
|
8437
|
-
set$
|
|
8476
|
+
set$2(rpc);
|
|
8438
8477
|
};
|
|
8439
8478
|
|
|
8440
8479
|
const listen = async () => {
|
|
@@ -8444,7 +8483,7 @@ const listen = async () => {
|
|
|
8444
8483
|
commandMap: {},
|
|
8445
8484
|
send: sendMessagePortToDialogWorker
|
|
8446
8485
|
});
|
|
8447
|
-
set$
|
|
8486
|
+
set$6(dialogRpc);
|
|
8448
8487
|
};
|
|
8449
8488
|
|
|
8450
8489
|
const main$1 = async () => {
|
|
@@ -8456,7 +8495,7 @@ const main = async () => {
|
|
|
8456
8495
|
const rpc = await create$5({
|
|
8457
8496
|
commandMap: commandMap
|
|
8458
8497
|
});
|
|
8459
|
-
set$
|
|
8498
|
+
set$2(rpc);
|
|
8460
8499
|
};
|
|
8461
8500
|
|
|
8462
8501
|
await main$1();
|