@lvce-editor/problems-view 1.12.0 → 1.13.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.
@@ -527,7 +527,7 @@ const create$4$1 = (method, params) => {
527
527
  };
528
528
  };
529
529
  const callbacks = Object.create(null);
530
- const set$4 = (id, fn) => {
530
+ const set$6 = (id, fn) => {
531
531
  callbacks[id] = fn;
532
532
  };
533
533
  const get$2 = id => {
@@ -546,7 +546,7 @@ const registerPromise = () => {
546
546
  resolve,
547
547
  promise
548
548
  } = Promise.withResolvers();
549
- set$4(id, resolve);
549
+ set$6(id, resolve);
550
550
  return {
551
551
  id,
552
552
  promise
@@ -626,7 +626,8 @@ const splitLines = lines => {
626
626
  return lines.split(NewLine);
627
627
  };
628
628
  const getCurrentStack = () => {
629
- const currentStack = joinLines(splitLines(new Error().stack || '').slice(2));
629
+ const stackLinesToSkip = 3;
630
+ const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
630
631
  return currentStack;
631
632
  };
632
633
  const getNewLineIndex = (string, startIndex = undefined) => {
@@ -890,13 +891,19 @@ const send$1 = (transport, method, ...params) => {
890
891
  const message = create$4$1(method, params);
891
892
  transport.send(message);
892
893
  };
893
- const invoke = (ipc, method, ...params) => {
894
+ const invoke$2 = (ipc, method, ...params) => {
894
895
  return invokeHelper(ipc, method, params, false);
895
896
  };
896
- const invokeAndTransfer = (ipc, method, ...params) => {
897
+ const invokeAndTransfer$2 = (ipc, method, ...params) => {
897
898
  return invokeHelper(ipc, method, params, true);
898
899
  };
899
900
 
901
+ class CommandNotFoundError extends Error {
902
+ constructor(command) {
903
+ super(`Command not found ${command}`);
904
+ this.name = 'CommandNotFoundError';
905
+ }
906
+ }
900
907
  const commands = Object.create(null);
901
908
  const register = commandMap => {
902
909
  Object.assign(commands, commandMap);
@@ -907,7 +914,7 @@ const getCommand = key => {
907
914
  const execute = (command, ...args) => {
908
915
  const fn = getCommand(command);
909
916
  if (!fn) {
910
- throw new Error(`command not found ${command}`);
917
+ throw new CommandNotFoundError(command);
911
918
  }
912
919
  return fn(...args);
913
920
  };
@@ -923,10 +930,10 @@ const createRpc = ipc => {
923
930
  send$1(ipc, method, ...params);
924
931
  },
925
932
  invoke(method, ...params) {
926
- return invoke(ipc, method, ...params);
933
+ return invoke$2(ipc, method, ...params);
927
934
  },
928
935
  invokeAndTransfer(method, ...params) {
929
- return invokeAndTransfer(ipc, method, ...params);
936
+ return invokeAndTransfer$2(ipc, method, ...params);
930
937
  },
931
938
  async dispose() {
932
939
  await ipc?.dispose();
@@ -1012,9 +1019,33 @@ const WebWorkerRpcClient = {
1012
1019
  __proto__: null,
1013
1020
  create: create$4
1014
1021
  };
1022
+ const createMockRpc = ({
1023
+ commandMap
1024
+ }) => {
1025
+ const invocations = [];
1026
+ const invoke = (method, ...params) => {
1027
+ invocations.push([method, ...params]);
1028
+ const command = commandMap[method];
1029
+ if (!command) {
1030
+ throw new Error(`command ${method} not found`);
1031
+ }
1032
+ return command(...params);
1033
+ };
1034
+ const mockRpc = {
1035
+ invoke,
1036
+ invokeAndTransfer: invoke,
1037
+ invocations
1038
+ };
1039
+ return mockRpc;
1040
+ };
1015
1041
 
1042
+ const toCommandId$1 = key => {
1043
+ const dotIndex = key.indexOf('.');
1044
+ return key.slice(dotIndex + 1);
1045
+ };
1016
1046
  const create$2 = () => {
1017
1047
  const states = Object.create(null);
1048
+ const commandMapRef = {};
1018
1049
  return {
1019
1050
  get(uid) {
1020
1051
  return states[uid];
@@ -1055,6 +1086,15 @@ const create$2 = () => {
1055
1086
  };
1056
1087
  return wrapped;
1057
1088
  },
1089
+ wrapGetter(fn) {
1090
+ const wrapped = (uid, ...args) => {
1091
+ const {
1092
+ newState
1093
+ } = states[uid];
1094
+ return fn(newState, ...args);
1095
+ };
1096
+ return wrapped;
1097
+ },
1058
1098
  diff(uid, modules, numbers) {
1059
1099
  const {
1060
1100
  oldState,
@@ -1068,6 +1108,14 @@ const create$2 = () => {
1068
1108
  }
1069
1109
  }
1070
1110
  return diffResult;
1111
+ },
1112
+ getCommandIds() {
1113
+ const keys = Object.keys(commandMapRef);
1114
+ const ids = keys.map(toCommandId$1);
1115
+ return ids;
1116
+ },
1117
+ registerCommands(commandMap) {
1118
+ Object.assign(commandMapRef, commandMap);
1071
1119
  }
1072
1120
  };
1073
1121
  };
@@ -1075,16 +1123,41 @@ const terminate = () => {
1075
1123
  globalThis.close();
1076
1124
  };
1077
1125
 
1126
+ const None$1 = 'none';
1127
+ const ToolBar = 'toolbar';
1128
+ const Tree = 'tree';
1129
+ const TreeItem = 'treeitem';
1130
+
1131
+ const Button$1 = 1;
1132
+ const Div = 4;
1133
+ const Input = 6;
1134
+ const Span = 8;
1135
+ const Text = 12;
1136
+ const Img = 17;
1137
+ const A = 53;
1138
+
1139
+ const Space = 9;
1140
+ const PageUp = 10;
1141
+ const PageDown = 11;
1142
+ const End = 255;
1143
+ const Home = 12;
1144
+ const LeftArrow = 13;
1145
+ const UpArrow = 14;
1146
+ const RightArrow = 15;
1147
+ const DownArrow = 16;
1148
+
1149
+ const DebugWorker = 55;
1150
+ const EditorWorker$1 = 99;
1151
+ const RendererWorker$1 = 1;
1152
+
1078
1153
  const rpcs = Object.create(null);
1079
- const set$g = (id, rpc) => {
1154
+ const set$5 = (id, rpc) => {
1080
1155
  rpcs[id] = rpc;
1081
1156
  };
1082
1157
  const get$1 = id => {
1083
1158
  return rpcs[id];
1084
1159
  };
1085
1160
 
1086
- /* eslint-disable @typescript-eslint/explicit-function-return-type */
1087
-
1088
1161
  const create$1 = rpcId => {
1089
1162
  return {
1090
1163
  // @ts-ignore
@@ -1100,7 +1173,7 @@ const create$1 = rpcId => {
1100
1173
  return rpc.invokeAndTransfer(method, ...params);
1101
1174
  },
1102
1175
  set(rpc) {
1103
- set$g(rpcId, rpc);
1176
+ set$5(rpcId, rpc);
1104
1177
  },
1105
1178
  async dispose() {
1106
1179
  const rpc = get$1(rpcId);
@@ -1108,35 +1181,457 @@ const create$1 = rpcId => {
1108
1181
  }
1109
1182
  };
1110
1183
  };
1111
- const EditorWorker$1 = 99;
1112
- const RendererWorker$1 = 1;
1184
+
1113
1185
  const {
1114
- invoke: invoke$c,
1115
- set: set$c} = create$1(EditorWorker$1);
1186
+ invoke: invoke$1,
1187
+ invokeAndTransfer: invokeAndTransfer$1,
1188
+ set: set$4,
1189
+ dispose: dispose$1
1190
+ } = create$1(EditorWorker$1);
1191
+ const sendMessagePortToExtensionHostWorker$1 = async port => {
1192
+ const command = 'HandleMessagePort.handleMessagePort2';
1193
+ await invokeAndTransfer$1(
1194
+ // @ts-ignore
1195
+ 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, 0);
1196
+ };
1197
+ // TODO add tests for this
1198
+ const activateByEvent$1 = async event => {
1199
+ // @ts-ignore
1200
+ await invoke$1('ActivateByEvent.activateByEvent', event);
1201
+ };
1202
+ const applyEdit = async (editorUid, changes) => {
1203
+ // @ts-ignore
1204
+ await invoke$1('Editor.applyEdit2', editorUid, changes);
1205
+ };
1206
+ const applyWorkspaceEdit = async (editorUid, changes) => {
1207
+ // @ts-ignore
1208
+ await invoke$1('Editor.applyWorkspaceEdit', editorUid, changes);
1209
+ };
1210
+ const closeWidget$1 = async (editorUid, widgetId, widgetName, focusId) => {
1211
+ // @ts-ignore
1212
+ await invoke$1('Editor.closeWidget2', editorUid, widgetId, widgetName, focusId);
1213
+ };
1214
+ const getWordAt = async (uid, rowIndex, columnIndex) => {
1215
+ // @ts-ignore
1216
+ const word = await invoke$1('Editor.getWordAt2', uid, rowIndex, columnIndex);
1217
+ return word;
1218
+ };
1219
+ const getLines = async editorUid => {
1220
+ const lines = await invoke$1('Editor.getLines2', editorUid);
1221
+ return lines;
1222
+ };
1223
+ const getPositionAtCursor = async parentUid => {
1224
+ const position = await invoke$1('Editor.getPositionAtCursor', parentUid);
1225
+ return position;
1226
+ };
1227
+ const getOffsetAtCursor = async editorId => {
1228
+ // @ts-ignore
1229
+ return await invoke$1('Editor.getOffsetAtCursor', editorId);
1230
+ };
1231
+ const getSelections = async editorUid => {
1232
+ const selections = await invoke$1('Editor.getSelections2', editorUid);
1233
+ return selections;
1234
+ };
1235
+ const getWordAtOffset2 = async editorUid => {
1236
+ return invoke$1('Editor.getWordAtOffset2', editorUid);
1237
+ };
1238
+ const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
1239
+ return invoke$1('Editor.getWordBefore2', editorUid, rowIndex, columnIndex);
1240
+ };
1241
+ const updateDebugInfo = async info => {
1242
+ await invoke$1('Editor.updateDebugInfo', info);
1243
+ };
1244
+ const getUri = async editorUid => {
1245
+ // @ts-ignore
1246
+ return invoke$1('Editor.getUri', editorUid);
1247
+ };
1248
+ const getLanguageId = async editorUid => {
1249
+ // @ts-ignore
1250
+ return invoke$1('Editor.getLanguageId', editorUid);
1251
+ };
1116
1252
  const getProblems$2 = async () => {
1117
1253
  // @ts-ignore
1118
- return invoke$c('Editor.getProblems');
1254
+ return invoke$1('Editor.getProblems');
1119
1255
  };
1256
+ const registerMockRpc$1 = commandMap => {
1257
+ const mockRpc = createMockRpc({
1258
+ commandMap
1259
+ });
1260
+ set$4(mockRpc);
1261
+ return mockRpc;
1262
+ };
1263
+
1120
1264
  const EditorWorker = {
1121
1265
  __proto__: null,
1266
+ activateByEvent: activateByEvent$1,
1267
+ applyEdit,
1268
+ applyWorkspaceEdit,
1269
+ closeWidget: closeWidget$1,
1270
+ dispose: dispose$1,
1271
+ getLanguageId,
1272
+ getLines,
1273
+ getOffsetAtCursor,
1274
+ getPositionAtCursor,
1122
1275
  getProblems: getProblems$2,
1123
- set: set$c};
1276
+ getSelections,
1277
+ getUri,
1278
+ getWordAt,
1279
+ getWordAtOffset2,
1280
+ getWordBefore,
1281
+ invoke: invoke$1,
1282
+ invokeAndTransfer: invokeAndTransfer$1,
1283
+ registerMockRpc: registerMockRpc$1,
1284
+ sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
1285
+ set: set$4,
1286
+ updateDebugInfo
1287
+ };
1288
+
1124
1289
  const {
1125
- invoke: invoke$3,
1126
- invokeAndTransfer: invokeAndTransfer$3,
1127
- set: set$3} = create$1(RendererWorker$1);
1290
+ invoke,
1291
+ invokeAndTransfer,
1292
+ set: set$3,
1293
+ dispose
1294
+ } = create$1(RendererWorker$1);
1295
+ const searchFileHtml = async uri => {
1296
+ return invoke('ExtensionHost.searchFileWithHtml', uri);
1297
+ };
1298
+ const getFilePathElectron = async file => {
1299
+ return invoke('FileSystemHandle.getFilePathElectron', file);
1300
+ };
1301
+ const showContextMenu = async (x, y, id, ...args) => {
1302
+ return invoke('ContextMenu.show', x, y, id, ...args);
1303
+ };
1304
+ const getElectronVersion = async () => {
1305
+ return invoke('Process.getElectronVersion');
1306
+ };
1307
+ const applyBulkReplacement = async bulkEdits => {
1308
+ await invoke('BulkReplacement.applyBulkReplacement', bulkEdits);
1309
+ };
1310
+ const setColorTheme = async id => {
1311
+ // @ts-ignore
1312
+ return invoke(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1313
+ };
1314
+ const getNodeVersion = async () => {
1315
+ return invoke('Process.getNodeVersion');
1316
+ };
1317
+ const getChromeVersion = async () => {
1318
+ return invoke('Process.getChromeVersion');
1319
+ };
1320
+ const getV8Version = async () => {
1321
+ return invoke('Process.getV8Version');
1322
+ };
1323
+ const getFileHandles = async fileIds => {
1324
+ const files = await invoke('FileSystemHandle.getFileHandles', fileIds);
1325
+ return files;
1326
+ };
1327
+ const setWorkspacePath = async path => {
1328
+ await invoke('Workspace.setPath', path);
1329
+ };
1330
+ const registerWebViewInterceptor = async (id, port) => {
1331
+ await invokeAndTransfer('WebView.registerInterceptor', id, port);
1332
+ };
1333
+ const unregisterWebViewInterceptor = async id => {
1334
+ await invoke('WebView.unregisterInterceptor', id);
1335
+ };
1128
1336
  const sendMessagePortToEditorWorker$1 = async (port, rpcId) => {
1129
1337
  const command = 'HandleMessagePort.handleMessagePort';
1130
1338
  // @ts-ignore
1131
- await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1339
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1340
+ };
1341
+ const sendMessagePortToErrorWorker = async (port, rpcId) => {
1342
+ const command = 'Errors.handleMessagePort';
1343
+ // @ts-ignore
1344
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
1345
+ };
1346
+ const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
1347
+ const command = 'Markdown.handleMessagePort';
1348
+ // @ts-ignore
1349
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
1350
+ };
1351
+ const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
1352
+ const command = 'FileSystem.handleMessagePort';
1353
+ // @ts-ignore
1354
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1355
+ };
1356
+ const readFile = async uri => {
1357
+ return invoke('FileSystem.readFile', uri);
1358
+ };
1359
+ const getWebViewSecret = async key => {
1360
+ // @ts-ignore
1361
+ return invoke('WebView.getSecret', key);
1362
+ };
1363
+ const setWebViewPort = async (uid, port, origin, portType) => {
1364
+ return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
1365
+ };
1366
+ const setFocus = key => {
1367
+ return invoke('Focus.setFocus', key);
1368
+ };
1369
+ const getFileIcon = async options => {
1370
+ return invoke('IconTheme.getFileIcon', options);
1371
+ };
1372
+ const getColorThemeNames = async () => {
1373
+ return invoke('ColorTheme.getColorThemeNames');
1374
+ };
1375
+ const disableExtension = async id => {
1376
+ // @ts-ignore
1377
+ return invoke('ExtensionManagement.disable', id);
1378
+ };
1379
+ const enableExtension = async id => {
1380
+ // @ts-ignore
1381
+ return invoke('ExtensionManagement.enable', id);
1382
+ };
1383
+ const handleDebugChange = async params => {
1384
+ // @ts-ignore
1385
+ return invoke('Run And Debug.handleChange', params);
1386
+ };
1387
+ const getFolderIcon = async options => {
1388
+ return invoke('IconTheme.getFolderIcon', options);
1389
+ };
1390
+ const closeWidget = async widgetId => {
1391
+ return invoke('Viewlet.closeWidget', widgetId);
1392
+ };
1393
+ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1394
+ const command = 'HandleMessagePort.handleMessagePort2';
1395
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1396
+ };
1397
+ const sendMessagePortToSearchProcess = async port => {
1398
+ await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
1399
+ };
1400
+ const confirm = async (message, options) => {
1401
+ // @ts-ignore
1402
+ const result = await invoke('ConfirmPrompt.prompt', message, options);
1403
+ return result;
1404
+ };
1405
+ const getRecentlyOpened = async () => {
1406
+ return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
1407
+ };
1408
+ const getKeyBindings$1 = async () => {
1409
+ return invoke('KeyBindingsInitial.getKeyBindings');
1132
1410
  };
1133
1411
  const writeClipBoardText$1 = async text => {
1134
- await invoke$3('ClipBoard.writeText', /* text */text);
1412
+ await invoke('ClipBoard.writeText', /* text */text);
1413
+ };
1414
+ const writeClipBoardImage = async blob => {
1415
+ // @ts-ignore
1416
+ await invoke('ClipBoard.writeImage', /* text */blob);
1417
+ };
1418
+ const searchFileMemory = async uri => {
1419
+ // @ts-ignore
1420
+ return invoke('ExtensionHost.searchFileWithMemory', uri);
1421
+ };
1422
+ const searchFileFetch = async uri => {
1423
+ return invoke('ExtensionHost.searchFileWithFetch', uri);
1135
1424
  };
1425
+ const showMessageBox = async options => {
1426
+ return invoke('ElectronDialog.showMessageBox', options);
1427
+ };
1428
+ const handleDebugResumed = async params => {
1429
+ await invoke('Run And Debug.handleResumed', params);
1430
+ };
1431
+ const openWidget = async name => {
1432
+ await invoke('Viewlet.openWidget', name);
1433
+ };
1434
+ const getIcons = async requests => {
1435
+ const icons = await invoke('IconTheme.getIcons', requests);
1436
+ return icons;
1437
+ };
1438
+ const activateByEvent = event => {
1439
+ return invoke('ExtensionHostManagement.activateByEvent', event);
1440
+ };
1441
+ const setAdditionalFocus = focusKey => {
1442
+ // @ts-ignore
1443
+ return invoke('Focus.setAdditionalFocus', focusKey);
1444
+ };
1445
+ const getActiveEditorId = () => {
1446
+ // @ts-ignore
1447
+ return invoke('GetActiveEditor.getActiveEditorId');
1448
+ };
1449
+ const getWorkspacePath = () => {
1450
+ return invoke('Workspace.getPath');
1451
+ };
1452
+ const sendMessagePortToRendererProcess = async port => {
1453
+ const command = 'HandleMessagePort.handleMessagePort';
1454
+ // @ts-ignore
1455
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
1456
+ };
1457
+ const getPreference = async key => {
1458
+ return await invoke('Preferences.get', key);
1459
+ };
1460
+ const getAllExtensions = async () => {
1461
+ return invoke('ExtensionManagement.getAllExtensions');
1462
+ };
1463
+ const rerenderEditor = async key => {
1464
+ // @ts-ignore
1465
+ return invoke('Editor.rerender', key);
1466
+ };
1467
+ const handleDebugPaused = async params => {
1468
+ await invoke('Run And Debug.handlePaused', params);
1469
+ };
1470
+ const openUri = async (uri, focus, options) => {
1471
+ await invoke('Main.openUri', uri, focus, options);
1472
+ };
1473
+ const sendMessagePortToSyntaxHighlightingWorker = async port => {
1474
+ await invokeAndTransfer(
1475
+ // @ts-ignore
1476
+ 'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
1477
+ };
1478
+ const handleDebugScriptParsed = async script => {
1479
+ await invoke('Run And Debug.handleScriptParsed', script);
1480
+ };
1481
+ const getWindowId = async () => {
1482
+ return invoke('GetWindowId.getWindowId');
1483
+ };
1484
+ const getBlob = async uri => {
1485
+ // @ts-ignore
1486
+ return invoke('FileSystem.getBlob', uri);
1487
+ };
1488
+ const getExtensionCommands = async () => {
1489
+ return invoke('ExtensionHost.getCommands');
1490
+ };
1491
+ const showErrorDialog = async errorInfo => {
1492
+ // @ts-ignore
1493
+ await invoke('ErrorHandling.showErrorDialog', errorInfo);
1494
+ };
1495
+ const getFolderSize = async uri => {
1496
+ // @ts-ignore
1497
+ return await invoke('FileSystem.getFolderSize', uri);
1498
+ };
1499
+ const getExtension = async id => {
1500
+ // @ts-ignore
1501
+ return invoke('ExtensionManagement.getExtension', id);
1502
+ };
1503
+ const getMarkdownDom = async html => {
1504
+ // @ts-ignore
1505
+ return invoke('Markdown.getVirtualDom', html);
1506
+ };
1507
+ const renderMarkdown = async (markdown, options) => {
1508
+ // @ts-ignore
1509
+ return invoke('Markdown.renderMarkdown', markdown, options);
1510
+ };
1511
+ const openNativeFolder = async uri => {
1512
+ // @ts-ignore
1513
+ await invoke('OpenNativeFolder.openNativeFolder', uri);
1514
+ };
1515
+ const uninstallExtension = async id => {
1516
+ return invoke('ExtensionManagement.uninstall', id);
1517
+ };
1518
+ const installExtension = async id => {
1519
+ // @ts-ignore
1520
+ return invoke('ExtensionManagement.install', id);
1521
+ };
1522
+ const openExtensionSearch = async () => {
1523
+ // @ts-ignore
1524
+ return invoke('SideBar.openViewlet', 'Extensions');
1525
+ };
1526
+ const setExtensionsSearchValue = async searchValue => {
1527
+ // @ts-ignore
1528
+ return invoke('Extensions.handleInput', searchValue);
1529
+ };
1530
+ const openExternal = async uri => {
1531
+ // @ts-ignore
1532
+ await invoke('Open.openExternal', uri);
1533
+ };
1534
+ const openUrl = async uri => {
1535
+ // @ts-ignore
1536
+ await invoke('Open.openUrl', uri);
1537
+ };
1538
+ const getAllPreferences = async () => {
1539
+ // @ts-ignore
1540
+ return invoke('Preferences.getAll');
1541
+ };
1542
+ const showSaveFilePicker = async () => {
1543
+ // @ts-ignore
1544
+ return invoke('FilePicker.showSaveFilePicker');
1545
+ };
1546
+ const getLogsDir = async () => {
1547
+ // @ts-ignore
1548
+ return invoke('PlatformPaths.getLogsDir');
1549
+ };
1550
+ const registerMockRpc = commandMap => {
1551
+ const mockRpc = createMockRpc({
1552
+ commandMap
1553
+ });
1554
+ set$3(mockRpc);
1555
+ return mockRpc;
1556
+ };
1557
+
1136
1558
  const RendererWorker = {
1137
1559
  __proto__: null,
1560
+ activateByEvent,
1561
+ applyBulkReplacement,
1562
+ closeWidget,
1563
+ confirm,
1564
+ disableExtension,
1565
+ dispose,
1566
+ enableExtension,
1567
+ getActiveEditorId,
1568
+ getAllExtensions,
1569
+ getAllPreferences,
1570
+ getBlob,
1571
+ getChromeVersion,
1572
+ getColorThemeNames,
1573
+ getElectronVersion,
1574
+ getExtension,
1575
+ getExtensionCommands,
1576
+ getFileHandles,
1577
+ getFileIcon,
1578
+ getFilePathElectron,
1579
+ getFolderIcon,
1580
+ getFolderSize,
1581
+ getIcons,
1582
+ getKeyBindings: getKeyBindings$1,
1583
+ getLogsDir,
1584
+ getMarkdownDom,
1585
+ getNodeVersion,
1586
+ getPreference,
1587
+ getRecentlyOpened,
1588
+ getV8Version,
1589
+ getWebViewSecret,
1590
+ getWindowId,
1591
+ getWorkspacePath,
1592
+ handleDebugChange,
1593
+ handleDebugPaused,
1594
+ handleDebugResumed,
1595
+ handleDebugScriptParsed,
1596
+ installExtension,
1597
+ invoke,
1598
+ invokeAndTransfer,
1599
+ openExtensionSearch,
1600
+ openExternal,
1601
+ openNativeFolder,
1602
+ openUri,
1603
+ openUrl,
1604
+ openWidget,
1605
+ readFile,
1606
+ registerMockRpc,
1607
+ registerWebViewInterceptor,
1608
+ renderMarkdown,
1609
+ rerenderEditor,
1610
+ searchFileFetch,
1611
+ searchFileHtml,
1612
+ searchFileMemory,
1138
1613
  sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
1614
+ sendMessagePortToErrorWorker,
1615
+ sendMessagePortToExtensionHostWorker,
1616
+ sendMessagePortToFileSystemWorker,
1617
+ sendMessagePortToMarkdownWorker,
1618
+ sendMessagePortToRendererProcess,
1619
+ sendMessagePortToSearchProcess,
1620
+ sendMessagePortToSyntaxHighlightingWorker,
1139
1621
  set: set$3,
1622
+ setAdditionalFocus,
1623
+ setColorTheme,
1624
+ setExtensionsSearchValue,
1625
+ setFocus,
1626
+ setWebViewPort,
1627
+ setWorkspacePath,
1628
+ showContextMenu,
1629
+ showErrorDialog,
1630
+ showMessageBox,
1631
+ showSaveFilePicker,
1632
+ uninstallExtension,
1633
+ unregisterWebViewInterceptor,
1634
+ writeClipBoardImage,
1140
1635
  writeClipBoardText: writeClipBoardText$1
1141
1636
  };
1142
1637
 
@@ -1169,7 +1664,7 @@ const {
1169
1664
  wrapCommand
1170
1665
  } = create$2();
1171
1666
 
1172
- const None$1 = 0;
1667
+ const None = 0;
1173
1668
  const Table = 1;
1174
1669
  const List = 2;
1175
1670
 
@@ -1185,7 +1680,7 @@ const create = (id, uri, x, y, width, height, workspaceUri) => {
1185
1680
  width,
1186
1681
  height,
1187
1682
  filterValue: '',
1188
- viewMode: None$1,
1683
+ viewMode: None,
1189
1684
  inputSource: User,
1190
1685
  minLineY: 0,
1191
1686
  maxLineY: 0,
@@ -1251,56 +1746,10 @@ const getCommandIds = () => {
1251
1746
  return ids;
1252
1747
  };
1253
1748
 
1254
- const None = 'none';
1255
- const ToolBar = 'toolbar';
1256
- const Tree$1 = 'tree';
1257
- const TreeItem$1 = 'treeitem';
1258
- const AriaRoles = {
1259
- __proto__: null,
1260
- None,
1261
- ToolBar,
1262
- Tree: Tree$1,
1263
- TreeItem: TreeItem$1
1264
- };
1265
- const Space = 9;
1266
- const PageUp = 10;
1267
- const PageDown = 11;
1268
- const End = 255;
1269
- const Home = 12;
1270
- const LeftArrow = 13;
1271
- const UpArrow = 14;
1272
- const RightArrow = 15;
1273
- const DownArrow = 16;
1274
- const KeyCode = {
1275
- __proto__: null,
1276
- DownArrow,
1277
- End,
1278
- Home,
1279
- LeftArrow,
1280
- PageDown,
1281
- PageUp,
1282
- RightArrow,
1283
- Space,
1284
- UpArrow
1285
- };
1286
1749
  const mergeClassNames = (...classNames) => {
1287
1750
  return classNames.filter(Boolean).join(' ');
1288
1751
  };
1289
- const Button$1 = 1;
1290
- const Div = 4;
1291
- const Input = 6;
1292
- const Span = 8;
1293
- const Text = 12;
1294
- const Img = 17;
1295
- const A = 53;
1296
- const VirtualDomElements = {
1297
- __proto__: null,
1298
- A,
1299
- Button: Button$1,
1300
- Div,
1301
- Img,
1302
- Input,
1303
- Span};
1752
+
1304
1753
  const text = data => {
1305
1754
  return {
1306
1755
  type: Text,
@@ -1313,47 +1762,47 @@ const FocusProblems = 19;
1313
1762
 
1314
1763
  const getKeyBindings = () => {
1315
1764
  return [{
1316
- key: KeyCode.DownArrow,
1765
+ key: DownArrow,
1317
1766
  command: 'Problems.focusNext',
1318
1767
  when: FocusProblems
1319
1768
  }, {
1320
- key: KeyCode.UpArrow,
1769
+ key: UpArrow,
1321
1770
  command: 'Problems.focusPrevious',
1322
1771
  when: FocusProblems
1323
1772
  }, {
1324
- key: KeyCode.Home,
1773
+ key: Home,
1325
1774
  command: 'Problems.focusFirst',
1326
1775
  when: FocusProblems
1327
1776
  }, {
1328
- key: KeyCode.PageUp,
1777
+ key: PageUp,
1329
1778
  command: 'Problems.focusFirst',
1330
1779
  when: FocusProblems
1331
1780
  }, {
1332
- key: KeyCode.PageDown,
1781
+ key: PageDown,
1333
1782
  command: 'Problems.focusLast',
1334
1783
  when: FocusProblems
1335
1784
  }, {
1336
- key: KeyCode.End,
1785
+ key: End,
1337
1786
  command: 'Problems.focusLast',
1338
1787
  when: FocusProblems
1339
1788
  }, {
1340
- key: KeyCode.Space,
1789
+ key: Space,
1341
1790
  command: 'Problems.selectCurrent',
1342
1791
  when: FocusProblems
1343
1792
  }, {
1344
- key: KeyCode.Home,
1793
+ key: Home,
1345
1794
  command: 'Problems.focusFirst',
1346
1795
  when: FocusProblems
1347
1796
  }, {
1348
- key: KeyCode.End,
1797
+ key: End,
1349
1798
  command: 'Problems.focusLast',
1350
1799
  when: FocusProblems
1351
1800
  }, {
1352
- key: KeyCode.LeftArrow,
1801
+ key: LeftArrow,
1353
1802
  command: 'Problems.handleArrowLeft',
1354
1803
  when: FocusProblems
1355
1804
  }, {
1356
- key: KeyCode.RightArrow,
1805
+ key: RightArrow,
1357
1806
  command: 'Problems.handleArrowRight',
1358
1807
  when: FocusProblems
1359
1808
  }];
@@ -1789,11 +2238,11 @@ const HandleContextMenu = 'handleContextMenu';
1789
2238
  const HandleFilterInput = 'handleFilterInput';
1790
2239
  const HandlePointerDown = 'handlePointerDown';
1791
2240
 
1792
- const getIconVirtualDom = (icon, type = VirtualDomElements.Div) => {
2241
+ const getIconVirtualDom = (icon, type = Div) => {
1793
2242
  return {
1794
2243
  type,
1795
2244
  className: mergeClassNames('MaskIcon', `MaskIcon${icon}`),
1796
- role: AriaRoles.None,
2245
+ role: None$1,
1797
2246
  childCount: 0
1798
2247
  };
1799
2248
  };
@@ -1805,7 +2254,7 @@ const getActionButtonVirtualDom = action => {
1805
2254
  command
1806
2255
  } = action;
1807
2256
  return [{
1808
- type: VirtualDomElements.Button,
2257
+ type: Button$1,
1809
2258
  className: IconButton,
1810
2259
  title: id,
1811
2260
  'data-command': command,
@@ -1815,7 +2264,7 @@ const getActionButtonVirtualDom = action => {
1815
2264
 
1816
2265
  const getInputBoxVirtualDom = (name, onInput, placeholder) => {
1817
2266
  return {
1818
- type: VirtualDomElements.Input,
2267
+ type: Input,
1819
2268
  className: InputBox,
1820
2269
  autocapitalize: 'off',
1821
2270
  autocorrect: 'off',
@@ -1845,14 +2294,14 @@ const getBadgeDom = badgeText => {
1845
2294
  return [];
1846
2295
  }
1847
2296
  return [{
1848
- type: VirtualDomElements.Div,
2297
+ type: Div,
1849
2298
  className: FilterBadge,
1850
2299
  childCount: 1
1851
2300
  }, text(badgeText)];
1852
2301
  };
1853
2302
  const getProblemsFilterVirtualDom = action => {
1854
2303
  return [{
1855
- type: VirtualDomElements.Div,
2304
+ type: Div,
1856
2305
  className: Filter$1,
1857
2306
  childCount: getChildCount(action.badgeText)
1858
2307
  }, getInputBoxVirtualDom(Filter$2, action.command, action.placeholder || ''), ...getBadgeDom(action.badgeText), ...getActionButtonVirtualDom({
@@ -1865,14 +2314,14 @@ const getProblemsFilterVirtualDom = action => {
1865
2314
 
1866
2315
  const getNoResultsWithFilterVirtualDom = () => {
1867
2316
  return [{
1868
- type: VirtualDomElements.Div,
2317
+ type: Div,
1869
2318
  className: Message,
1870
2319
  childCount: 3
1871
2320
  }, {
1872
- type: VirtualDomElements.Span,
2321
+ type: Span,
1873
2322
  childCount: 1
1874
2323
  }, text(noResultsFoundWithProvidedFilterCriteria()), {
1875
- type: VirtualDomElements.A,
2324
+ type: A,
1876
2325
  className: MessageAction,
1877
2326
  childCount: 1,
1878
2327
  onClick: HandleClearFilterClick
@@ -1881,7 +2330,7 @@ const getNoResultsWithFilterVirtualDom = () => {
1881
2330
 
1882
2331
  const getBadgeVirtualDom = (className, count) => {
1883
2332
  return [{
1884
- type: VirtualDomElements.Div,
2333
+ type: Div,
1885
2334
  className: mergeClassNames('Badge', className) + (''),
1886
2335
  childCount: 1
1887
2336
  }, text(`${count}`)];
@@ -1889,14 +2338,14 @@ const getBadgeVirtualDom = (className, count) => {
1889
2338
 
1890
2339
  const getChevronDownVirtualDom = (extraClassName = '') => {
1891
2340
  return {
1892
- type: VirtualDomElements.Div,
2341
+ type: Div,
1893
2342
  className: mergeClassNames(Chevron, 'MaskIconChevronDown', extraClassName) + (extraClassName === '' ? ' ' : ''),
1894
2343
  childCount: 0
1895
2344
  };
1896
2345
  };
1897
2346
  const getChevronRightVirtualDom = (extraClassName = '') => {
1898
2347
  return {
1899
- type: VirtualDomElements.Div,
2348
+ type: Div,
1900
2349
  className: mergeClassNames(Chevron, 'MaskIconChevronRight', extraClassName) + (extraClassName === '' ? ' ' : ''),
1901
2350
  childCount: 0
1902
2351
  };
@@ -1904,10 +2353,10 @@ const getChevronRightVirtualDom = (extraClassName = '') => {
1904
2353
 
1905
2354
  const getFileIconVirtualDom = icon => {
1906
2355
  return {
1907
- type: VirtualDomElements.Img,
2356
+ type: Img,
1908
2357
  className: FileIcon,
1909
2358
  src: icon,
1910
- role: AriaRoles.None,
2359
+ role: None$1,
1911
2360
  childCount: 0
1912
2361
  };
1913
2362
  };
@@ -1917,13 +2366,13 @@ const Warning = 'warning';
1917
2366
  const getProblemsIconVirtualDom = type => {
1918
2367
  if (type === Warning) {
1919
2368
  return {
1920
- type: VirtualDomElements.Div,
2369
+ type: Div,
1921
2370
  className: mergeClassNames(ProblemsIcon, ProblemsWarningIcon),
1922
2371
  childCount: 0
1923
2372
  };
1924
2373
  }
1925
2374
  return {
1926
- type: VirtualDomElements.Div,
2375
+ type: Div,
1927
2376
  className: mergeClassNames(ProblemsIcon, ProblemsErrorIcon),
1928
2377
  childCount: 0
1929
2378
  };
@@ -1973,7 +2422,7 @@ const getProblemVirtualDom = problem => {
1973
2422
  }
1974
2423
  if (listItemType === Expanded || listItemType === Collapsed) {
1975
2424
  return [{
1976
- type: VirtualDomElements.Div,
2425
+ type: Div,
1977
2426
  className,
1978
2427
  childCount: 5,
1979
2428
  paddingLeft: getTreeItemIndent(1),
@@ -1982,16 +2431,16 @@ const getProblemVirtualDom = problem => {
1982
2431
  ariaLevel: level,
1983
2432
  ariaExpanded: !isCollapsed,
1984
2433
  ariaSelected: isActive,
1985
- role: AriaRoles.TreeItem
2434
+ role: TreeItem
1986
2435
  }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), text(fileName), {
1987
- type: VirtualDomElements.Div,
2436
+ type: Div,
1988
2437
  className: LabelDetail,
1989
2438
  childCount: 1
1990
2439
  }, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
1991
2440
  }
1992
2441
  const lineColumn = atLineColumn(rowIndex, columnIndex);
1993
2442
  const label = {
1994
- type: VirtualDomElements.Div,
2443
+ type: Div,
1995
2444
  className: Label,
1996
2445
  childCount: 1
1997
2446
  };
@@ -1999,7 +2448,7 @@ const getProblemVirtualDom = problem => {
1999
2448
  * @type {any}
2000
2449
  */
2001
2450
  const dom = [{
2002
- type: VirtualDomElements.Div,
2451
+ type: Div,
2003
2452
  className,
2004
2453
  childCount: 3,
2005
2454
  paddingLeft: getTreeItemIndent(2),
@@ -2007,7 +2456,7 @@ const getProblemVirtualDom = problem => {
2007
2456
  ariaSetSize: setSize,
2008
2457
  ariaLevel: level,
2009
2458
  ariaSelected: isActive,
2010
- role: AriaRoles.TreeItem
2459
+ role: TreeItem
2011
2460
  }, getProblemsIconVirtualDom(type), label];
2012
2461
  if (filterValueLength) {
2013
2462
  const before = message.slice(0, messageMatchIndex);
@@ -2015,7 +2464,7 @@ const getProblemVirtualDom = problem => {
2015
2464
  const after = message.slice(messageMatchIndex + filterValueLength);
2016
2465
  label.childCount += 2;
2017
2466
  dom.push(text(before), {
2018
- type: VirtualDomElements.Div,
2467
+ type: Div,
2019
2468
  className: Highlight,
2020
2469
  childCount: 1
2021
2470
  }, text(middle), text(after));
@@ -2023,7 +2472,7 @@ const getProblemVirtualDom = problem => {
2023
2472
  dom.push(text(message));
2024
2473
  }
2025
2474
  dom.push({
2026
- type: VirtualDomElements.Span,
2475
+ type: Span,
2027
2476
  className: ProblemAt,
2028
2477
  childCount: 2
2029
2478
  }, text(getProblemSourceDetail(source, code)), text(lineColumn));
@@ -2032,10 +2481,10 @@ const getProblemVirtualDom = problem => {
2032
2481
 
2033
2482
  const getProblemsListVirtualDom = problems => {
2034
2483
  const dom = [{
2035
- type: VirtualDomElements.Div,
2484
+ type: Div,
2036
2485
  className: ProblemsList,
2037
2486
  childCount: problems.length,
2038
- role: AriaRoles.Tree,
2487
+ role: Tree,
2039
2488
  ariaLabel: 'Problems Tree' // TODO use i18n string
2040
2489
  }, ...problems.flatMap(getProblemVirtualDom)];
2041
2490
  return dom;
@@ -2043,7 +2492,7 @@ const getProblemsListVirtualDom = problems => {
2043
2492
 
2044
2493
  const getProblemsNoProblemsFoundVirtualDom = () => {
2045
2494
  return [{
2046
- type: VirtualDomElements.Div,
2495
+ type: Div,
2047
2496
  className: Message,
2048
2497
  childCount: 1
2049
2498
  }, text(noProblemsDetected())];
@@ -2070,27 +2519,27 @@ const getProblemsTableRowVirtualDom = problem => {
2070
2519
  return [];
2071
2520
  }
2072
2521
  const dom = [{
2073
- type: VirtualDomElements.Div,
2522
+ type: Div,
2074
2523
  className: getClassName(isEven),
2075
2524
  childCount: 5
2076
2525
  }, {
2077
- type: VirtualDomElements.Div,
2526
+ type: Div,
2078
2527
  className: ProblemsTableRowItem,
2079
2528
  childCount: 1
2080
2529
  }, getProblemsIconVirtualDom(type), {
2081
- type: VirtualDomElements.Div,
2530
+ type: Div,
2082
2531
  className: ProblemsTableRowItem,
2083
2532
  childCount: 1
2084
2533
  }, text(getProblemSourceDetail(source, code)), {
2085
- type: VirtualDomElements.Div,
2534
+ type: Div,
2086
2535
  className: ProblemsTableRowItem,
2087
2536
  childCount: 1
2088
2537
  }, text(message), {
2089
- type: VirtualDomElements.Div,
2538
+ type: Div,
2090
2539
  className: ProblemsTableRowItem,
2091
2540
  childCount: 1
2092
2541
  }, text(uri), {
2093
- type: VirtualDomElements.Div,
2542
+ type: Div,
2094
2543
  className: ProblemsTableRowItem,
2095
2544
  childCount: 1
2096
2545
  }, text(source)];
@@ -2099,7 +2548,7 @@ const getProblemsTableRowVirtualDom = problem => {
2099
2548
 
2100
2549
  const getProblemsTableBodyVirtualDom = problems => {
2101
2550
  const dom = [{
2102
- type: VirtualDomElements.Div,
2551
+ type: Div,
2103
2552
  className: ProblemsTableBody,
2104
2553
  childCount: problems.length
2105
2554
  }, ...problems.flatMap(getProblemsTableRowVirtualDom)];
@@ -2112,31 +2561,31 @@ const getProblemsTableHeaderVirtualDom = () => {
2112
2561
  const textMessage = message();
2113
2562
  const textFile = file();
2114
2563
  const dom = [{
2115
- type: VirtualDomElements.Div,
2564
+ type: Div,
2116
2565
  className: ProblemsTableHeader,
2117
2566
  childCount: 1
2118
2567
  }, {
2119
- type: VirtualDomElements.Div,
2568
+ type: Div,
2120
2569
  className: ProblemsTableRow,
2121
2570
  childCount: 5
2122
2571
  }, {
2123
- type: VirtualDomElements.Div,
2572
+ type: Div,
2124
2573
  className: ProblemsTableRowItem,
2125
2574
  childCount: 0
2126
2575
  }, {
2127
- type: VirtualDomElements.Div,
2576
+ type: Div,
2128
2577
  className: ProblemsTableRowItem,
2129
2578
  childCount: 1
2130
2579
  }, text(textCode), {
2131
- type: VirtualDomElements.Div,
2580
+ type: Div,
2132
2581
  className: ProblemsTableRowItem,
2133
2582
  childCount: 1
2134
2583
  }, text(textMessage), {
2135
- type: VirtualDomElements.Div,
2584
+ type: Div,
2136
2585
  className: ProblemsTableRowItem,
2137
2586
  childCount: 1
2138
2587
  }, text(textFile), {
2139
- type: VirtualDomElements.Div,
2588
+ type: Div,
2140
2589
  className: ProblemsTableRowItem,
2141
2590
  childCount: 1
2142
2591
  }, text(textSource)];
@@ -2145,7 +2594,7 @@ const getProblemsTableHeaderVirtualDom = () => {
2145
2594
 
2146
2595
  const getProblemsTableVirtualDom = problems => {
2147
2596
  const dom = [{
2148
- type: VirtualDomElements.Div,
2597
+ type: Div,
2149
2598
  className: ProblemsTable,
2150
2599
  childCount: 2
2151
2600
  }, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
@@ -2155,7 +2604,7 @@ const getProblemsTableVirtualDom = problems => {
2155
2604
  const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
2156
2605
  if (problems.length === 0 && message) {
2157
2606
  return [{
2158
- type: VirtualDomElements.Div,
2607
+ type: Div,
2159
2608
  className: Message,
2160
2609
  childCount: 1
2161
2610
  }, text(message)];
@@ -2176,7 +2625,7 @@ const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message
2176
2625
  // TODO avoid mutation
2177
2626
  const dom = [];
2178
2627
  dom.push({
2179
- type: VirtualDomElements.Div,
2628
+ type: Div,
2180
2629
  className: mergeClassNames(Viewlet, Problems),
2181
2630
  tabIndex: 0,
2182
2631
  onPointerDown: HandlePointerDown,
@@ -2327,9 +2776,9 @@ const getActionVirtualDom = action => {
2327
2776
 
2328
2777
  const getActionsVirtualDom = actions => {
2329
2778
  return [{
2330
- type: VirtualDomElements.Div,
2779
+ type: Div,
2331
2780
  className: Actions,
2332
- role: AriaRoles.ToolBar,
2781
+ role: ToolBar,
2333
2782
  childCount: actions.length
2334
2783
  }, ...actions.flatMap(getActionVirtualDom)];
2335
2784
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",