@lvce-editor/extension-management-worker 4.88.1 → 4.88.3
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.
|
@@ -2542,8 +2542,11 @@ const handleRpcInfos = (extension, platform) => {
|
|
|
2542
2542
|
if (rpc.type === 'node' || rpc.type === 'node-process') {
|
|
2543
2543
|
continue;
|
|
2544
2544
|
}
|
|
2545
|
-
|
|
2546
|
-
|
|
2545
|
+
const resolvedRpc = {
|
|
2546
|
+
...rpc,
|
|
2547
|
+
url: `${urlPrefix}/${rpc.url}`
|
|
2548
|
+
};
|
|
2549
|
+
add$1(resolvedRpc.id, resolvedRpc);
|
|
2547
2550
|
}
|
|
2548
2551
|
} catch (error) {
|
|
2549
2552
|
console.warn(`Failed to handle extension rpcs: ${error}`);
|
|
@@ -3427,7 +3430,7 @@ const deferInvalidateExtensionsCache = (extensionId, disabled) => {
|
|
|
3427
3430
|
}, 0);
|
|
3428
3431
|
};
|
|
3429
3432
|
|
|
3430
|
-
const handleChange = async _id => {
|
|
3433
|
+
const handleChange$1 = async _id => {
|
|
3431
3434
|
const statusBarVisible = await invoke$4('Layout.getStatusBarVisible');
|
|
3432
3435
|
if (!statusBarVisible) {
|
|
3433
3436
|
return;
|
|
@@ -3443,7 +3446,7 @@ const addExtension = async extension => {
|
|
|
3443
3446
|
clearCachedExtensions();
|
|
3444
3447
|
await invalidateExtensionsCache();
|
|
3445
3448
|
if (hasStatusBarItems(extension)) {
|
|
3446
|
-
await handleChange();
|
|
3449
|
+
await handleChange$1();
|
|
3447
3450
|
}
|
|
3448
3451
|
return extension;
|
|
3449
3452
|
};
|
|
@@ -5924,6 +5927,31 @@ const getViews = async (assetDir, platform) => {
|
|
|
5924
5927
|
return getViewsFromExtensions(extensions, resolvedAssetDir, resolvedPlatform);
|
|
5925
5928
|
};
|
|
5926
5929
|
|
|
5930
|
+
const isWorkspaceProgressData = value => {
|
|
5931
|
+
if (!value || typeof value !== 'object') return false;
|
|
5932
|
+
const data = value;
|
|
5933
|
+
return typeof data.message === 'string' && ['idle', 'in-progress', 'finished', 'error'].includes(String(data.status));
|
|
5934
|
+
};
|
|
5935
|
+
const getWorkspaceProgressData = async applicationId => {
|
|
5936
|
+
const extensionIds = getIds(applicationId);
|
|
5937
|
+
for (const extensionId of extensionIds) {
|
|
5938
|
+
const rpc = get$2(extensionId, applicationId);
|
|
5939
|
+
if (!rpc) continue;
|
|
5940
|
+
try {
|
|
5941
|
+
const values = await rpc.invoke('ExtensionApi.getWorkspaceProgressData');
|
|
5942
|
+
if (!Array.isArray(values)) continue;
|
|
5943
|
+
const value = values.find(item => isWorkspaceProgressData(item) && item.status !== 'idle');
|
|
5944
|
+
if (value && isWorkspaceProgressData(value)) return value;
|
|
5945
|
+
} catch {
|
|
5946
|
+
// Extensions without a workspace progress provider are expected.
|
|
5947
|
+
}
|
|
5948
|
+
}
|
|
5949
|
+
return {
|
|
5950
|
+
message: '',
|
|
5951
|
+
status: 'idle'
|
|
5952
|
+
};
|
|
5953
|
+
};
|
|
5954
|
+
|
|
5927
5955
|
const handleData = () => {};
|
|
5928
5956
|
|
|
5929
5957
|
const invokeHandler = async (extensionId, changes, applicationId) => {
|
|
@@ -6375,6 +6403,16 @@ const readMicLevels = async options => {
|
|
|
6375
6403
|
return await invoke$4('WebView.compatRendererProcessInvoke', 'WebRtc.readMicLevels', options);
|
|
6376
6404
|
};
|
|
6377
6405
|
|
|
6406
|
+
const handleChange = async operationId => {
|
|
6407
|
+
if (!Number.isSafeInteger(operationId)) return;
|
|
6408
|
+
try {
|
|
6409
|
+
const data = await getWorkspaceProgressData();
|
|
6410
|
+
await invoke$4('Workspace.handleExtensionProgressChange', operationId, data);
|
|
6411
|
+
} catch {
|
|
6412
|
+
// Workspace progress is optional and the renderer may be closing.
|
|
6413
|
+
}
|
|
6414
|
+
};
|
|
6415
|
+
|
|
6378
6416
|
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
6379
6417
|
|
|
6380
6418
|
const wrapCommand = command => {
|
|
@@ -6533,6 +6571,7 @@ const commandMap = {
|
|
|
6533
6571
|
'Extensions.getViewInstanceState': getViewInstanceState,
|
|
6534
6572
|
'Extensions.getViewMenuEntries': getViewMenuEntries,
|
|
6535
6573
|
'Extensions.getViews': getViews,
|
|
6574
|
+
'Extensions.getWorkspaceProgressData': wrapCommand(extensionsState => getWorkspaceProgressData(extensionsState.applicationId)),
|
|
6536
6575
|
'Extensions.getWorkspaceTransportUri': getWorkspaceTransportUri,
|
|
6537
6576
|
'Extensions.handleData': handleData,
|
|
6538
6577
|
'Extensions.handleFileChanges': handleFileChanges,
|
|
@@ -6559,11 +6598,12 @@ const commandMap = {
|
|
|
6559
6598
|
'Extensions.showViewContextMenu': showViewContextMenu,
|
|
6560
6599
|
'Extensions.streamDiagnosticProvider': wrapCommand(streamDiagnosticProvider),
|
|
6561
6600
|
'Extensions.uninstall': uninstallExtension,
|
|
6562
|
-
'StatusBar.handleChange': handleChange,
|
|
6601
|
+
'StatusBar.handleChange': handleChange$1,
|
|
6563
6602
|
'WebRtc.readMicLevels': readMicLevels,
|
|
6564
6603
|
'WebRtc.setRemoteDescription': setRemoteDescription,
|
|
6565
6604
|
'WebRtc.startWebRtcAudioStream': startWebRtcAudioStream,
|
|
6566
|
-
'WebRtc.stopWebRtcAudioStream': stopWebRtcAudioStream
|
|
6605
|
+
'WebRtc.stopWebRtcAudioStream': stopWebRtcAudioStream,
|
|
6606
|
+
'WorkspaceProgress.handleChange': handleChange
|
|
6567
6607
|
};
|
|
6568
6608
|
|
|
6569
6609
|
const initializeAuthWorker = async () => {
|