@lvce-editor/activity-bar-worker 1.9.0 → 1.10.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.
@@ -742,7 +742,7 @@ const send = (transport, method, ...params) => {
742
742
  const message = create$4(method, params);
743
743
  transport.send(message);
744
744
  };
745
- const invoke$2 = (ipc, method, ...params) => {
745
+ const invoke$1 = (ipc, method, ...params) => {
746
746
  return invokeHelper(ipc, method, params, false);
747
747
  };
748
748
  const invokeAndTransfer$1 = (ipc, method, ...params) => {
@@ -781,7 +781,7 @@ const createRpc = ipc => {
781
781
  send(ipc, method, ...params);
782
782
  },
783
783
  invoke(method, ...params) {
784
- return invoke$2(ipc, method, ...params);
784
+ return invoke$1(ipc, method, ...params);
785
785
  },
786
786
  invokeAndTransfer(method, ...params) {
787
787
  return invokeAndTransfer$1(ipc, method, ...params);
@@ -1173,51 +1173,51 @@ const create = rpcId => {
1173
1173
  };
1174
1174
 
1175
1175
  const {
1176
- invoke: invoke$1,
1176
+ invoke,
1177
1177
  invokeAndTransfer,
1178
1178
  set: set$1,
1179
1179
  dispose
1180
1180
  } = create(RendererWorker$1);
1181
1181
  const searchFileHtml = async uri => {
1182
- return invoke$1('ExtensionHost.searchFileWithHtml', uri);
1182
+ return invoke('ExtensionHost.searchFileWithHtml', uri);
1183
1183
  };
1184
1184
  const getFilePathElectron = async file => {
1185
- return invoke$1('FileSystemHandle.getFilePathElectron', file);
1185
+ return invoke('FileSystemHandle.getFilePathElectron', file);
1186
1186
  };
1187
1187
  const showContextMenu = async (x, y, id, ...args) => {
1188
- return invoke$1('ContextMenu.show', x, y, id, ...args);
1188
+ return invoke('ContextMenu.show', x, y, id, ...args);
1189
1189
  };
1190
1190
  const getElectronVersion = async () => {
1191
- return invoke$1('Process.getElectronVersion');
1191
+ return invoke('Process.getElectronVersion');
1192
1192
  };
1193
1193
  const applyBulkReplacement = async bulkEdits => {
1194
- await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
1194
+ await invoke('BulkReplacement.applyBulkReplacement', bulkEdits);
1195
1195
  };
1196
1196
  const setColorTheme = async id => {
1197
1197
  // @ts-ignore
1198
- return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1198
+ return invoke(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1199
1199
  };
1200
1200
  const getNodeVersion = async () => {
1201
- return invoke$1('Process.getNodeVersion');
1201
+ return invoke('Process.getNodeVersion');
1202
1202
  };
1203
1203
  const getChromeVersion = async () => {
1204
- return invoke$1('Process.getChromeVersion');
1204
+ return invoke('Process.getChromeVersion');
1205
1205
  };
1206
1206
  const getV8Version = async () => {
1207
- return invoke$1('Process.getV8Version');
1207
+ return invoke('Process.getV8Version');
1208
1208
  };
1209
1209
  const getFileHandles = async fileIds => {
1210
- const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
1210
+ const files = await invoke('FileSystemHandle.getFileHandles', fileIds);
1211
1211
  return files;
1212
1212
  };
1213
1213
  const setWorkspacePath = async path => {
1214
- await invoke$1('Workspace.setPath', path);
1214
+ await invoke('Workspace.setPath', path);
1215
1215
  };
1216
1216
  const registerWebViewInterceptor = async (id, port) => {
1217
1217
  await invokeAndTransfer('WebView.registerInterceptor', id, port);
1218
1218
  };
1219
1219
  const unregisterWebViewInterceptor = async id => {
1220
- await invoke$1('WebView.unregisterInterceptor', id);
1220
+ await invoke('WebView.unregisterInterceptor', id);
1221
1221
  };
1222
1222
  const sendMessagePortToEditorWorker = async (port, rpcId) => {
1223
1223
  const command = 'HandleMessagePort.handleMessagePort';
@@ -1245,41 +1245,41 @@ const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
1245
1245
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1246
1246
  };
1247
1247
  const readFile = async uri => {
1248
- return invoke$1('FileSystem.readFile', uri);
1248
+ return invoke('FileSystem.readFile', uri);
1249
1249
  };
1250
1250
  const getWebViewSecret = async key => {
1251
1251
  // @ts-ignore
1252
- return invoke$1('WebView.getSecret', key);
1252
+ return invoke('WebView.getSecret', key);
1253
1253
  };
1254
1254
  const setWebViewPort = async (uid, port, origin, portType) => {
1255
1255
  return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
1256
1256
  };
1257
1257
  const setFocus = key => {
1258
- return invoke$1('Focus.setFocus', key);
1258
+ return invoke('Focus.setFocus', key);
1259
1259
  };
1260
1260
  const getFileIcon = async options => {
1261
- return invoke$1('IconTheme.getFileIcon', options);
1261
+ return invoke('IconTheme.getFileIcon', options);
1262
1262
  };
1263
1263
  const getColorThemeNames = async () => {
1264
- return invoke$1('ColorTheme.getColorThemeNames');
1264
+ return invoke('ColorTheme.getColorThemeNames');
1265
1265
  };
1266
1266
  const disableExtension = async id => {
1267
1267
  // @ts-ignore
1268
- return invoke$1('ExtensionManagement.disable', id);
1268
+ return invoke('ExtensionManagement.disable', id);
1269
1269
  };
1270
1270
  const enableExtension = async id => {
1271
1271
  // @ts-ignore
1272
- return invoke$1('ExtensionManagement.enable', id);
1272
+ return invoke('ExtensionManagement.enable', id);
1273
1273
  };
1274
1274
  const handleDebugChange = async params => {
1275
1275
  // @ts-ignore
1276
- return invoke$1('Run And Debug.handleChange', params);
1276
+ return invoke('Run And Debug.handleChange', params);
1277
1277
  };
1278
1278
  const getFolderIcon = async options => {
1279
- return invoke$1('IconTheme.getFolderIcon', options);
1279
+ return invoke('IconTheme.getFolderIcon', options);
1280
1280
  };
1281
1281
  const closeWidget = async widgetId => {
1282
- return invoke$1('Viewlet.closeWidget', widgetId);
1282
+ return invoke('Viewlet.closeWidget', widgetId);
1283
1283
  };
1284
1284
  const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1285
1285
  const command = 'HandleMessagePort.handleMessagePort2';
@@ -1290,55 +1290,55 @@ const sendMessagePortToSearchProcess = async port => {
1290
1290
  };
1291
1291
  const confirm = async (message, options) => {
1292
1292
  // @ts-ignore
1293
- const result = await invoke$1('ConfirmPrompt.prompt', message, options);
1293
+ const result = await invoke('ConfirmPrompt.prompt', message, options);
1294
1294
  return result;
1295
1295
  };
1296
1296
  const getRecentlyOpened = async () => {
1297
- return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
1297
+ return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
1298
1298
  };
1299
1299
  const getKeyBindings = async () => {
1300
- return invoke$1('KeyBindingsInitial.getKeyBindings');
1300
+ return invoke('KeyBindingsInitial.getKeyBindings');
1301
1301
  };
1302
1302
  const writeClipBoardText = async text => {
1303
- await invoke$1('ClipBoard.writeText', /* text */text);
1303
+ await invoke('ClipBoard.writeText', /* text */text);
1304
1304
  };
1305
1305
  const writeClipBoardImage = async blob => {
1306
1306
  // @ts-ignore
1307
- await invoke$1('ClipBoard.writeImage', /* text */blob);
1307
+ await invoke('ClipBoard.writeImage', /* text */blob);
1308
1308
  };
1309
1309
  const searchFileMemory = async uri => {
1310
1310
  // @ts-ignore
1311
- return invoke$1('ExtensionHost.searchFileWithMemory', uri);
1311
+ return invoke('ExtensionHost.searchFileWithMemory', uri);
1312
1312
  };
1313
1313
  const searchFileFetch = async uri => {
1314
- return invoke$1('ExtensionHost.searchFileWithFetch', uri);
1314
+ return invoke('ExtensionHost.searchFileWithFetch', uri);
1315
1315
  };
1316
1316
  const showMessageBox = async options => {
1317
- return invoke$1('ElectronDialog.showMessageBox', options);
1317
+ return invoke('ElectronDialog.showMessageBox', options);
1318
1318
  };
1319
1319
  const handleDebugResumed = async params => {
1320
- await invoke$1('Run And Debug.handleResumed', params);
1320
+ await invoke('Run And Debug.handleResumed', params);
1321
1321
  };
1322
1322
  const openWidget = async name => {
1323
- await invoke$1('Viewlet.openWidget', name);
1323
+ await invoke('Viewlet.openWidget', name);
1324
1324
  };
1325
1325
  const getIcons = async requests => {
1326
- const icons = await invoke$1('IconTheme.getIcons', requests);
1326
+ const icons = await invoke('IconTheme.getIcons', requests);
1327
1327
  return icons;
1328
1328
  };
1329
1329
  const activateByEvent = event => {
1330
- return invoke$1('ExtensionHostManagement.activateByEvent', event);
1330
+ return invoke('ExtensionHostManagement.activateByEvent', event);
1331
1331
  };
1332
1332
  const setAdditionalFocus = focusKey => {
1333
1333
  // @ts-ignore
1334
- return invoke$1('Focus.setAdditionalFocus', focusKey);
1334
+ return invoke('Focus.setAdditionalFocus', focusKey);
1335
1335
  };
1336
1336
  const getActiveEditorId = () => {
1337
1337
  // @ts-ignore
1338
- return invoke$1('GetActiveEditor.getActiveEditorId');
1338
+ return invoke('GetActiveEditor.getActiveEditorId');
1339
1339
  };
1340
1340
  const getWorkspacePath = () => {
1341
- return invoke$1('Workspace.getPath');
1341
+ return invoke('Workspace.getPath');
1342
1342
  };
1343
1343
  const sendMessagePortToRendererProcess = async port => {
1344
1344
  const command = 'HandleMessagePort.handleMessagePort';
@@ -1346,20 +1346,20 @@ const sendMessagePortToRendererProcess = async port => {
1346
1346
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
1347
1347
  };
1348
1348
  const getPreference = async key => {
1349
- return await invoke$1('Preferences.get', key);
1349
+ return await invoke('Preferences.get', key);
1350
1350
  };
1351
1351
  const getAllExtensions = async () => {
1352
- return invoke$1('ExtensionManagement.getAllExtensions');
1352
+ return invoke('ExtensionManagement.getAllExtensions');
1353
1353
  };
1354
1354
  const rerenderEditor = async key => {
1355
1355
  // @ts-ignore
1356
- return invoke$1('Editor.rerender', key);
1356
+ return invoke('Editor.rerender', key);
1357
1357
  };
1358
1358
  const handleDebugPaused = async params => {
1359
- await invoke$1('Run And Debug.handlePaused', params);
1359
+ await invoke('Run And Debug.handlePaused', params);
1360
1360
  };
1361
1361
  const openUri = async (uri, focus, options) => {
1362
- await invoke$1('Main.openUri', uri, focus, options);
1362
+ await invoke('Main.openUri', uri, focus, options);
1363
1363
  };
1364
1364
  const sendMessagePortToSyntaxHighlightingWorker = async port => {
1365
1365
  await invokeAndTransfer(
@@ -1367,76 +1367,76 @@ const sendMessagePortToSyntaxHighlightingWorker = async port => {
1367
1367
  'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
1368
1368
  };
1369
1369
  const handleDebugScriptParsed = async script => {
1370
- await invoke$1('Run And Debug.handleScriptParsed', script);
1370
+ await invoke('Run And Debug.handleScriptParsed', script);
1371
1371
  };
1372
1372
  const getWindowId = async () => {
1373
- return invoke$1('GetWindowId.getWindowId');
1373
+ return invoke('GetWindowId.getWindowId');
1374
1374
  };
1375
1375
  const getBlob = async uri => {
1376
1376
  // @ts-ignore
1377
- return invoke$1('FileSystem.getBlob', uri);
1377
+ return invoke('FileSystem.getBlob', uri);
1378
1378
  };
1379
1379
  const getExtensionCommands = async () => {
1380
- return invoke$1('ExtensionHost.getCommands');
1380
+ return invoke('ExtensionHost.getCommands');
1381
1381
  };
1382
1382
  const showErrorDialog = async errorInfo => {
1383
1383
  // @ts-ignore
1384
- await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
1384
+ await invoke('ErrorHandling.showErrorDialog', errorInfo);
1385
1385
  };
1386
1386
  const getFolderSize = async uri => {
1387
1387
  // @ts-ignore
1388
- return await invoke$1('FileSystem.getFolderSize', uri);
1388
+ return await invoke('FileSystem.getFolderSize', uri);
1389
1389
  };
1390
1390
  const getExtension = async id => {
1391
1391
  // @ts-ignore
1392
- return invoke$1('ExtensionManagement.getExtension', id);
1392
+ return invoke('ExtensionManagement.getExtension', id);
1393
1393
  };
1394
1394
  const getMarkdownDom = async html => {
1395
1395
  // @ts-ignore
1396
- return invoke$1('Markdown.getVirtualDom', html);
1396
+ return invoke('Markdown.getVirtualDom', html);
1397
1397
  };
1398
1398
  const renderMarkdown = async (markdown, options) => {
1399
1399
  // @ts-ignore
1400
- return invoke$1('Markdown.renderMarkdown', markdown, options);
1400
+ return invoke('Markdown.renderMarkdown', markdown, options);
1401
1401
  };
1402
1402
  const openNativeFolder = async uri => {
1403
1403
  // @ts-ignore
1404
- await invoke$1('OpenNativeFolder.openNativeFolder', uri);
1404
+ await invoke('OpenNativeFolder.openNativeFolder', uri);
1405
1405
  };
1406
1406
  const uninstallExtension = async id => {
1407
- return invoke$1('ExtensionManagement.uninstall', id);
1407
+ return invoke('ExtensionManagement.uninstall', id);
1408
1408
  };
1409
1409
  const installExtension = async id => {
1410
1410
  // @ts-ignore
1411
- return invoke$1('ExtensionManagement.install', id);
1411
+ return invoke('ExtensionManagement.install', id);
1412
1412
  };
1413
1413
  const openExtensionSearch = async () => {
1414
1414
  // @ts-ignore
1415
- return invoke$1('SideBar.openViewlet', 'Extensions');
1415
+ return invoke('SideBar.openViewlet', 'Extensions');
1416
1416
  };
1417
1417
  const setExtensionsSearchValue = async searchValue => {
1418
1418
  // @ts-ignore
1419
- return invoke$1('Extensions.handleInput', searchValue);
1419
+ return invoke('Extensions.handleInput', searchValue);
1420
1420
  };
1421
1421
  const openExternal = async uri => {
1422
1422
  // @ts-ignore
1423
- await invoke$1('Open.openExternal', uri);
1423
+ await invoke('Open.openExternal', uri);
1424
1424
  };
1425
1425
  const openUrl = async uri => {
1426
1426
  // @ts-ignore
1427
- await invoke$1('Open.openUrl', uri);
1427
+ await invoke('Open.openUrl', uri);
1428
1428
  };
1429
1429
  const getAllPreferences = async () => {
1430
1430
  // @ts-ignore
1431
- return invoke$1('Preferences.getAll');
1431
+ return invoke('Preferences.getAll');
1432
1432
  };
1433
1433
  const showSaveFilePicker = async () => {
1434
1434
  // @ts-ignore
1435
- return invoke$1('FilePicker.showSaveFilePicker');
1435
+ return invoke('FilePicker.showSaveFilePicker');
1436
1436
  };
1437
1437
  const getLogsDir = async () => {
1438
1438
  // @ts-ignore
1439
- return invoke$1('PlatformPaths.getLogsDir');
1439
+ return invoke('PlatformPaths.getLogsDir');
1440
1440
  };
1441
1441
  const registerMockRpc = commandMap => {
1442
1442
  const mockRpc = createMockRpc({
@@ -1485,7 +1485,7 @@ const RendererWorker = {
1485
1485
  handleDebugResumed,
1486
1486
  handleDebugScriptParsed,
1487
1487
  installExtension,
1488
- invoke: invoke$1,
1488
+ invoke,
1489
1489
  invokeAndTransfer,
1490
1490
  openExtensionSearch,
1491
1491
  openExternal,
@@ -1527,43 +1527,42 @@ const RendererWorker = {
1527
1527
  writeClipBoardText
1528
1528
  };
1529
1529
 
1530
- const show = async (x, y, id, ...args) => {
1530
+ const show$1 = async (x, y, id, ...args) => {
1531
1531
  await showContextMenu(x, y, id, args);
1532
1532
  };
1533
1533
 
1534
1534
  const handleClickAdditionalViews = async (state, x, y, viewletId) => {
1535
- await show(x, y, ActivityBarAdditionalViews);
1535
+ await show$1(x, y, ActivityBarAdditionalViews);
1536
1536
  return state;
1537
1537
  };
1538
1538
 
1539
- const {
1540
- set,
1541
- invoke
1542
- } = RendererWorker;
1539
+ const show = async id => {
1540
+ // @ts-ignore
1541
+ await invoke('Layout.showSideBar', /* id */id);
1542
+ };
1543
+ const hide = async () => {
1544
+ await invoke('Layout.hideSideBar');
1545
+ };
1543
1546
 
1544
1547
  const handleClickOther = async (state, x, y, viewletId) => {
1545
- // TODO ask renderer worker asynchronously if sidebar is visible
1546
-
1547
1548
  const {
1548
1549
  sideBarVisible,
1549
1550
  currentViewletId
1550
1551
  } = state;
1551
1552
  if (sideBarVisible) {
1552
1553
  if (currentViewletId === viewletId) {
1553
- await invoke('Layout.hideSideBar');
1554
+ await hide();
1554
1555
  } else {
1555
- await invoke(/* SideBar.show */'SideBar.show', /* id */viewletId);
1556
+ await show(viewletId);
1556
1557
  }
1557
1558
  } else {
1558
- // TODO should show side bar with viewletId
1559
- // @ts-ignore
1560
- await invoke('Layout.showSideBar');
1559
+ await show(currentViewletId);
1561
1560
  }
1562
1561
  return state;
1563
1562
  };
1564
1563
 
1565
1564
  const handleClickSettings = async (state, x, y, viewletId) => {
1566
- await show(x, y, Settings$1);
1565
+ await show$1(x, y, Settings$1);
1567
1566
  return state;
1568
1567
  };
1569
1568
 
@@ -1600,7 +1599,7 @@ const handleClick = async (state, button, eventX, eventY) => {
1600
1599
  };
1601
1600
 
1602
1601
  const handleContextMenu = async (state, button, x, y) => {
1603
- await show(x, y, ActivityBar$3);
1602
+ await show$1(x, y, ActivityBar$3);
1604
1603
  return state;
1605
1604
  };
1606
1605
 
@@ -1624,7 +1623,8 @@ const handleSideBarViewletChange = (state, id, ...args) => {
1624
1623
  const index = findIndex(activityBarItems, id);
1625
1624
  return {
1626
1625
  ...state,
1627
- selectedIndex: index
1626
+ selectedIndex: index,
1627
+ currentViewletId: id
1628
1628
  };
1629
1629
  };
1630
1630
 
@@ -1991,6 +1991,9 @@ const commandMap = {
1991
1991
  'ActivityBar.terminate': terminate
1992
1992
  };
1993
1993
 
1994
+ const {
1995
+ set} = RendererWorker;
1996
+
1994
1997
  const listen = async () => {
1995
1998
  registerCommands(commandMap);
1996
1999
  const rpc = await WebWorkerRpcClient.create({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",