@lvce-editor/file-search-worker 6.9.0 → 6.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.
@@ -533,7 +533,7 @@ const create$4$1 = (method, params) => {
533
533
  };
534
534
  };
535
535
  const callbacks = Object.create(null);
536
- const set$5 = (id, fn) => {
536
+ const set$4 = (id, fn) => {
537
537
  callbacks[id] = fn;
538
538
  };
539
539
  const get$2 = id => {
@@ -552,7 +552,7 @@ const registerPromise = () => {
552
552
  resolve,
553
553
  promise
554
554
  } = Promise.withResolvers();
555
- set$5(id, resolve);
555
+ set$4(id, resolve);
556
556
  return {
557
557
  id,
558
558
  promise
@@ -897,7 +897,7 @@ const send = (transport, method, ...params) => {
897
897
  const message = create$4$1(method, params);
898
898
  transport.send(message);
899
899
  };
900
- const invoke$4 = (ipc, method, ...params) => {
900
+ const invoke$3 = (ipc, method, ...params) => {
901
901
  return invokeHelper(ipc, method, params, false);
902
902
  };
903
903
  const invokeAndTransfer$1 = (ipc, method, ...params) => {
@@ -936,7 +936,7 @@ const createRpc = ipc => {
936
936
  send(ipc, method, ...params);
937
937
  },
938
938
  invoke(method, ...params) {
939
- return invoke$4(ipc, method, ...params);
939
+ return invoke$3(ipc, method, ...params);
940
940
  },
941
941
  invokeAndTransfer(method, ...params) {
942
942
  return invokeAndTransfer$1(ipc, method, ...params);
@@ -1025,25 +1025,6 @@ const WebWorkerRpcClient = {
1025
1025
  __proto__: null,
1026
1026
  create: create$4
1027
1027
  };
1028
- const createMockRpc = ({
1029
- commandMap
1030
- }) => {
1031
- const invocations = [];
1032
- const invoke = (method, ...params) => {
1033
- invocations.push([method, ...params]);
1034
- const command = commandMap[method];
1035
- if (!command) {
1036
- throw new Error(`command ${method} not found`);
1037
- }
1038
- return command(...params);
1039
- };
1040
- const mockRpc = {
1041
- invoke,
1042
- invokeAndTransfer: invoke,
1043
- invocations
1044
- };
1045
- return mockRpc;
1046
- };
1047
1028
 
1048
1029
  const Div = 4;
1049
1030
  const Input = 6;
@@ -1051,14 +1032,13 @@ const Span = 8;
1051
1032
  const Text = 12;
1052
1033
  const Img = 17;
1053
1034
 
1054
- const Script$1 = 2;
1055
-
1056
- const DebugWorker = 55;
1057
1035
  const EditorWorker = 99;
1058
- const RendererWorker$1 = 1;
1036
+ const RendererWorker = 1;
1037
+
1038
+ const FocusQuickPickInput = 20;
1059
1039
 
1060
1040
  const rpcs = Object.create(null);
1061
- const set$4 = (id, rpc) => {
1041
+ const set$3 = (id, rpc) => {
1062
1042
  rpcs[id] = rpc;
1063
1043
  };
1064
1044
  const get$1 = id => {
@@ -1080,7 +1060,7 @@ const create$3 = rpcId => {
1080
1060
  return rpc.invokeAndTransfer(method, ...params);
1081
1061
  },
1082
1062
  set(rpc) {
1083
- set$4(rpcId, rpc);
1063
+ set$3(rpcId, rpc);
1084
1064
  },
1085
1065
  async dispose() {
1086
1066
  const rpc = get$1(rpcId);
@@ -1090,420 +1070,46 @@ const create$3 = rpcId => {
1090
1070
  };
1091
1071
 
1092
1072
  const {
1093
- invoke: invoke$3,
1094
- set: set$3} = create$3(EditorWorker);
1073
+ invoke: invoke$2,
1074
+ set: set$2} = create$3(EditorWorker);
1095
1075
  const getLines = async editorUid => {
1096
- const lines = await invoke$3('Editor.getLines2', editorUid);
1076
+ const lines = await invoke$2('Editor.getLines2', editorUid);
1097
1077
  return lines;
1098
1078
  };
1099
1079
 
1100
1080
  const {
1101
- invoke: invoke$2,
1081
+ invoke: invoke$1,
1102
1082
  invokeAndTransfer,
1103
- set: set$2,
1104
- dispose: dispose$2
1105
- } = create$3(RendererWorker$1);
1106
- const searchFileHtml = async uri => {
1107
- return invoke$2('ExtensionHost.searchFileWithHtml', uri);
1108
- };
1109
- const getFilePathElectron = async file => {
1110
- return invoke$2('FileSystemHandle.getFilePathElectron', file);
1111
- };
1112
- /**
1113
- * @deprecated
1114
- */
1115
- const showContextMenu = async (x, y, id, ...args) => {
1116
- return invoke$2('ContextMenu.show', x, y, id, ...args);
1117
- };
1118
- const showContextMenu2 = async (uid, menuId, x, y, args) => {
1119
- number(uid);
1120
- number(menuId);
1121
- number(x);
1122
- number(y);
1123
- // @ts-ignore
1124
- await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
1125
- };
1126
- const getElectronVersion = async () => {
1127
- return invoke$2('Process.getElectronVersion');
1128
- };
1129
- const applyBulkReplacement = async bulkEdits => {
1130
- await invoke$2('BulkReplacement.applyBulkReplacement', bulkEdits);
1131
- };
1132
- const setColorTheme$1 = async id => {
1133
- // @ts-ignore
1134
- return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1135
- };
1136
- const getNodeVersion = async () => {
1137
- return invoke$2('Process.getNodeVersion');
1138
- };
1139
- const getChromeVersion = async () => {
1140
- return invoke$2('Process.getChromeVersion');
1141
- };
1142
- const getV8Version = async () => {
1143
- return invoke$2('Process.getV8Version');
1144
- };
1145
- const getFileHandles = async fileIds => {
1146
- const files = await invoke$2('FileSystemHandle.getFileHandles', fileIds);
1147
- return files;
1148
- };
1149
- const setWorkspacePath = async path => {
1150
- await invoke$2('Workspace.setPath', path);
1151
- };
1152
- const registerWebViewInterceptor = async (id, port) => {
1153
- await invokeAndTransfer('WebView.registerInterceptor', id, port);
1154
- };
1155
- const unregisterWebViewInterceptor = async id => {
1156
- await invoke$2('WebView.unregisterInterceptor', id);
1157
- };
1083
+ set: set$1} = create$3(RendererWorker);
1158
1084
  const sendMessagePortToEditorWorker = async (port, rpcId) => {
1159
1085
  const command = 'HandleMessagePort.handleMessagePort';
1160
1086
  // @ts-ignore
1161
1087
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1162
1088
  };
1163
- const sendMessagePortToErrorWorker = async (port, rpcId) => {
1164
- const command = 'Errors.handleMessagePort';
1165
- // @ts-ignore
1166
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
1167
- };
1168
- const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
1169
- const command = 'Markdown.handleMessagePort';
1170
- // @ts-ignore
1171
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
1172
- };
1173
- const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
1174
- const command = 'IconTheme.handleMessagePort';
1175
- // @ts-ignore
1176
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
1177
- };
1178
- const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
1179
- const command = 'FileSystem.handleMessagePort';
1180
- // @ts-ignore
1181
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1182
- };
1183
- const readFile = async uri => {
1184
- return invoke$2('FileSystem.readFile', uri);
1185
- };
1186
- const getWebViewSecret = async key => {
1187
- // @ts-ignore
1188
- return invoke$2('WebView.getSecret', key);
1089
+ const setFocus$1 = key => {
1090
+ return invoke$1('Focus.setFocus', key);
1189
1091
  };
1190
- const setWebViewPort = async (uid, port, origin, portType) => {
1191
- return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
1092
+ const getFileIcon = async options => {
1093
+ return invoke$1('IconTheme.getFileIcon', options);
1192
1094
  };
1193
- const setFocus$2 = key => {
1194
- return invoke$2('Focus.setFocus', key);
1095
+ const getFolderIcon = async options => {
1096
+ return invoke$1('IconTheme.getFolderIcon', options);
1195
1097
  };
1196
- const getFileIcon$1 = async options => {
1197
- return invoke$2('IconTheme.getFileIcon', options);
1198
- };
1199
- const getColorThemeNames$1 = async () => {
1200
- return invoke$2('ColorTheme.getColorThemeNames');
1201
- };
1202
- const disableExtension = async id => {
1203
- // @ts-ignore
1204
- return invoke$2('ExtensionManagement.disable', id);
1205
- };
1206
- const enableExtension = async id => {
1207
- // @ts-ignore
1208
- return invoke$2('ExtensionManagement.enable', id);
1209
- };
1210
- const handleDebugChange = async params => {
1211
- // @ts-ignore
1212
- return invoke$2('Run And Debug.handleChange', params);
1213
- };
1214
- const getFolderIcon$1 = async options => {
1215
- return invoke$2('IconTheme.getFolderIcon', options);
1216
- };
1217
- const handleWorkspaceRefresh = async () => {
1218
- return invoke$2('Layout.handleWorkspaceRefresh');
1219
- };
1220
- const closeWidget$2 = async widgetId => {
1221
- return invoke$2('Viewlet.closeWidget', widgetId);
1222
- };
1223
- const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1224
- const command = 'HandleMessagePort.handleMessagePort2';
1225
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1226
- };
1227
- const sendMessagePortToSearchProcess = async port => {
1228
- await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
1229
- };
1230
- const confirm = async (message, options) => {
1231
- // @ts-ignore
1232
- const result = await invoke$2('ConfirmPrompt.prompt', message, options);
1233
- return result;
1234
- };
1235
- const getRecentlyOpened$1 = async () => {
1236
- return invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
1237
- };
1238
- const getKeyBindings$1 = async () => {
1239
- return invoke$2('KeyBindingsInitial.getKeyBindings');
1240
- };
1241
- const writeClipBoardText = async text => {
1242
- await invoke$2('ClipBoard.writeText', /* text */text);
1243
- };
1244
- const readClipBoardText = async () => {
1245
- return invoke$2('ClipBoard.readText');
1246
- };
1247
- const writeClipBoardImage = async blob => {
1248
- // @ts-ignore
1249
- await invoke$2('ClipBoard.writeImage', /* text */blob);
1250
- };
1251
- const searchFileMemory = async uri => {
1252
- // @ts-ignore
1253
- return invoke$2('ExtensionHost.searchFileWithMemory', uri);
1254
- };
1255
- const searchFileFetch = async uri => {
1256
- return invoke$2('ExtensionHost.searchFileWithFetch', uri);
1257
- };
1258
- const showMessageBox = async options => {
1259
- return invoke$2('ElectronDialog.showMessageBox', options);
1260
- };
1261
- const handleDebugResumed = async params => {
1262
- await invoke$2('Run And Debug.handleResumed', params);
1263
- };
1264
- const openWidget = async name => {
1265
- await invoke$2('Viewlet.openWidget', name);
1266
- };
1267
- const getIcons = async requests => {
1268
- const icons = await invoke$2('IconTheme.getIcons', requests);
1269
- return icons;
1270
- };
1271
- const activateByEvent = event => {
1272
- return invoke$2('ExtensionHostManagement.activateByEvent', event);
1273
- };
1274
- const setAdditionalFocus = focusKey => {
1275
- // @ts-ignore
1276
- return invoke$2('Focus.setAdditionalFocus', focusKey);
1098
+ const closeWidget$1 = async widgetId => {
1099
+ return invoke$1('Viewlet.closeWidget', widgetId);
1277
1100
  };
1278
1101
  const getActiveEditorId = () => {
1279
1102
  // @ts-ignore
1280
- return invoke$2('GetActiveEditor.getActiveEditorId');
1103
+ return invoke$1('GetActiveEditor.getActiveEditorId');
1281
1104
  };
1282
- const getWorkspacePath$1 = () => {
1283
- return invoke$2('Workspace.getPath');
1105
+ const openUri$1 = async (uri, focus, options) => {
1106
+ await invoke$1('Main.openUri', uri, focus, options);
1284
1107
  };
1285
- const sendMessagePortToRendererProcess = async port => {
1286
- const command = 'HandleMessagePort.handleMessagePort';
1287
- // @ts-ignore
1288
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
1289
- };
1290
- const sendMessagePortToTextMeasurementWorker = async port => {
1291
- const command = 'TextMeasurement.handleMessagePort';
1108
+ const showErrorDialog$1 = async errorInfo => {
1292
1109
  // @ts-ignore
1293
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
1294
- };
1295
- const sendMessagePortToSourceControlWorker = async port => {
1296
- const command = 'SourceControl.handleMessagePort';
1297
- // @ts-ignore
1298
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
1299
- };
1300
- const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
1301
- const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
1302
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
1303
- };
1304
- const getPreference = async key => {
1305
- return await invoke$2('Preferences.get', key);
1306
- };
1307
- const getAllExtensions = async () => {
1308
- return invoke$2('ExtensionManagement.getAllExtensions');
1309
- };
1310
- const rerenderEditor = async key => {
1311
- // @ts-ignore
1312
- return invoke$2('Editor.rerender', key);
1313
- };
1314
- const handleDebugPaused = async params => {
1315
- await invoke$2('Run And Debug.handlePaused', params);
1316
- };
1317
- const openUri$2 = async (uri, focus, options) => {
1318
- await invoke$2('Main.openUri', uri, focus, options);
1319
- };
1320
- const sendMessagePortToSyntaxHighlightingWorker = async port => {
1321
- await invokeAndTransfer(
1322
- // @ts-ignore
1323
- 'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
1324
- };
1325
- const handleDebugScriptParsed = async script => {
1326
- await invoke$2('Run And Debug.handleScriptParsed', script);
1327
- };
1328
- const getWindowId = async () => {
1329
- return invoke$2('GetWindowId.getWindowId');
1330
- };
1331
- const getBlob = async uri => {
1332
- // @ts-ignore
1333
- return invoke$2('FileSystem.getBlob', uri);
1334
- };
1335
- const getExtensionCommands = async () => {
1336
- return invoke$2('ExtensionHost.getCommands');
1337
- };
1338
- const showErrorDialog$2 = async errorInfo => {
1339
- // @ts-ignore
1340
- await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
1341
- };
1342
- const getFolderSize = async uri => {
1343
- // @ts-ignore
1344
- return await invoke$2('FileSystem.getFolderSize', uri);
1345
- };
1346
- const getExtension = async id => {
1347
- // @ts-ignore
1348
- return invoke$2('ExtensionManagement.getExtension', id);
1349
- };
1350
- const getMarkdownDom = async html => {
1351
- // @ts-ignore
1352
- return invoke$2('Markdown.getVirtualDom', html);
1353
- };
1354
- const renderMarkdown = async (markdown, options) => {
1355
- // @ts-ignore
1356
- return invoke$2('Markdown.renderMarkdown', markdown, options);
1357
- };
1358
- const openNativeFolder = async uri => {
1359
- // @ts-ignore
1360
- await invoke$2('OpenNativeFolder.openNativeFolder', uri);
1361
- };
1362
- const uninstallExtension = async id => {
1363
- return invoke$2('ExtensionManagement.uninstall', id);
1364
- };
1365
- const installExtension = async id => {
1366
- // @ts-ignore
1367
- return invoke$2('ExtensionManagement.install', id);
1368
- };
1369
- const openExtensionSearch = async () => {
1370
- // @ts-ignore
1371
- return invoke$2('SideBar.openViewlet', 'Extensions');
1372
- };
1373
- const setExtensionsSearchValue = async searchValue => {
1374
- // @ts-ignore
1375
- return invoke$2('Extensions.handleInput', searchValue, Script$1);
1376
- };
1377
- const openExternal = async uri => {
1378
- // @ts-ignore
1379
- await invoke$2('Open.openExternal', uri);
1380
- };
1381
- const openUrl = async uri => {
1382
- // @ts-ignore
1383
- await invoke$2('Open.openUrl', uri);
1384
- };
1385
- const getAllPreferences = async () => {
1386
- // @ts-ignore
1387
- return invoke$2('Preferences.getAll');
1388
- };
1389
- const showSaveFilePicker = async () => {
1390
- // @ts-ignore
1391
- return invoke$2('FilePicker.showSaveFilePicker');
1392
- };
1393
- const getLogsDir = async () => {
1394
- // @ts-ignore
1395
- return invoke$2('PlatformPaths.getLogsDir');
1396
- };
1397
- const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
1398
- return invoke$2(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
1399
- };
1400
- const registerMockRpc = commandMap => {
1401
- const mockRpc = createMockRpc({
1402
- commandMap
1403
- });
1404
- set$2(mockRpc);
1405
- return mockRpc;
1110
+ await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
1406
1111
  };
1407
1112
 
1408
- const RendererWorker = {
1409
- __proto__: null,
1410
- activateByEvent,
1411
- applyBulkReplacement,
1412
- closeWidget: closeWidget$2,
1413
- confirm,
1414
- disableExtension,
1415
- dispose: dispose$2,
1416
- enableExtension,
1417
- getActiveEditorId,
1418
- getAllExtensions,
1419
- getAllPreferences,
1420
- getBlob,
1421
- getChromeVersion,
1422
- getColorThemeNames: getColorThemeNames$1,
1423
- getElectronVersion,
1424
- getExtension,
1425
- getExtensionCommands,
1426
- getFileHandles,
1427
- getFileIcon: getFileIcon$1,
1428
- getFilePathElectron,
1429
- getFolderIcon: getFolderIcon$1,
1430
- getFolderSize,
1431
- getIcons,
1432
- getKeyBindings: getKeyBindings$1,
1433
- getLogsDir,
1434
- getMarkdownDom,
1435
- getNodeVersion,
1436
- getPreference,
1437
- getRecentlyOpened: getRecentlyOpened$1,
1438
- getV8Version,
1439
- getWebViewSecret,
1440
- getWindowId,
1441
- getWorkspacePath: getWorkspacePath$1,
1442
- handleDebugChange,
1443
- handleDebugPaused,
1444
- handleDebugResumed,
1445
- handleDebugScriptParsed,
1446
- handleWorkspaceRefresh,
1447
- installExtension,
1448
- invoke: invoke$2,
1449
- invokeAndTransfer,
1450
- measureTextBlockHeight,
1451
- openExtensionSearch,
1452
- openExternal,
1453
- openNativeFolder,
1454
- openUri: openUri$2,
1455
- openUrl,
1456
- openWidget,
1457
- readClipBoardText,
1458
- readFile,
1459
- registerMockRpc,
1460
- registerWebViewInterceptor,
1461
- renderMarkdown,
1462
- rerenderEditor,
1463
- searchFileFetch,
1464
- searchFileHtml,
1465
- searchFileMemory,
1466
- sendMessagePortToEditorWorker,
1467
- sendMessagePortToErrorWorker,
1468
- sendMessagePortToExtensionHostWorker,
1469
- sendMessagePortToFileSystemProcess,
1470
- sendMessagePortToFileSystemWorker,
1471
- sendMessagePortToIconThemeWorker,
1472
- sendMessagePortToMarkdownWorker,
1473
- sendMessagePortToRendererProcess,
1474
- sendMessagePortToSearchProcess,
1475
- sendMessagePortToSourceControlWorker,
1476
- sendMessagePortToSyntaxHighlightingWorker,
1477
- sendMessagePortToTextMeasurementWorker,
1478
- set: set$2,
1479
- setAdditionalFocus,
1480
- setColorTheme: setColorTheme$1,
1481
- setExtensionsSearchValue,
1482
- setFocus: setFocus$2,
1483
- setWebViewPort,
1484
- setWorkspacePath,
1485
- showContextMenu,
1486
- showContextMenu2,
1487
- showErrorDialog: showErrorDialog$2,
1488
- showMessageBox,
1489
- showSaveFilePicker,
1490
- uninstallExtension,
1491
- unregisterWebViewInterceptor,
1492
- writeClipBoardImage,
1493
- writeClipBoardText
1494
- };
1495
-
1496
- const {
1497
- closeWidget: closeWidget$1,
1498
- getFileIcon,
1499
- getFolderIcon,
1500
- invoke: invoke$1,
1501
- openUri: openUri$1,
1502
- set: set$1,
1503
- setFocus: setFocus$1,
1504
- showErrorDialog: showErrorDialog$1
1505
- } = RendererWorker;
1506
-
1507
1113
  const closeWidget = async id => {
1508
1114
  // @ts-ignore
1509
1115
  await closeWidget$1(id);
@@ -1607,6 +1213,8 @@ const create$2 = () => {
1607
1213
  const {
1608
1214
  dispose: dispose$1,
1609
1215
  get,
1216
+ getCommandIds,
1217
+ registerCommands,
1610
1218
  set,
1611
1219
  wrapCommand
1612
1220
  } = create$2();
@@ -1983,12 +1591,6 @@ const focusPrevious = state => {
1983
1591
  return focusIndex(state, previousIndex);
1984
1592
  };
1985
1593
 
1986
- const commandIds = ['close', 'dispose', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusPrevious', 'handleBeforeInput', 'handleBlur', 'handleClickAt', 'diff2', 'handleFocus', 'handleInput', 'handleWheel', 'renderEventListeners', 'selectCurrentIndex', 'selectIndex', 'selectItem', 'setValue'];
1987
-
1988
- const getCommandIds = () => {
1989
- return commandIds;
1990
- };
1991
-
1992
1594
  const Enter = 3;
1993
1595
  const Escape = 8;
1994
1596
  const PageUp = 10;
@@ -1996,8 +1598,6 @@ const PageDown = 11;
1996
1598
  const UpArrow = 14;
1997
1599
  const DownArrow = 16;
1998
1600
 
1999
- const FocusQuickPickInput = 20;
2000
-
2001
1601
  const getKeyBindings = () => {
2002
1602
  return [{
2003
1603
  args: ['QuickPick'],
@@ -2595,6 +2195,9 @@ const searchFile$5 = async (path, value, prepare, assetDir) => {
2595
2195
  const protocol = getProtocol(path);
2596
2196
  // TODO call different providers depending on protocol
2597
2197
  const fn = getFn(protocol);
2198
+ if (!fn) {
2199
+ throw new Error(`No search handler registered for protocol: ${protocol}`);
2200
+ }
2598
2201
  const result = await fn(path, value, prepare, assetDir);
2599
2202
  return result;
2600
2203
  };
@@ -2914,7 +2517,10 @@ const selectPick$9 = async pick => {
2914
2517
 
2915
2518
  const hideIds = ['AutoUpdater.checkForUpdates'];
2916
2519
  const shouldHide = item => {
2917
- if (hideIds.includes(item.id) || item.id === 'Viewlet.openWidget' && item.args[0] === 'QuickPick') {
2520
+ if (hideIds.includes(item.id)) {
2521
+ return false;
2522
+ }
2523
+ if (item.id === 'Viewlet.openWidget' && item.args?.[0] === 'QuickPick') {
2918
2524
  return false;
2919
2525
  }
2920
2526
  return true;
@@ -2985,13 +2591,14 @@ const selectPick$6 = async pick => {
2985
2591
  };
2986
2592
 
2987
2593
  const setCursor = async (rowIndex, columnIndex) => {
2988
- await invoke$2('Editor.cursorSet', rowIndex, columnIndex);
2594
+ await invoke$1('Editor.cursorSet', rowIndex, columnIndex);
2989
2595
  };
2990
2596
 
2991
2597
  const goToPositionAndFocus = async (rowIndex, columnIndex) => {
2992
2598
  await setCursor(rowIndex, columnIndex);
2993
- await invoke$2('Editor.handleFocus');
2599
+ await invoke$1('Editor.handleFocus');
2994
2600
  };
2601
+
2995
2602
  const selectPick$5 = async (item, value) => {
2996
2603
  if (value.startsWith('::')) {
2997
2604
  const columnString = value.slice(2);
@@ -3137,7 +2744,11 @@ const setValue = async (state, newValue) => {
3137
2744
  // TODO when user types letters -> no need to query provider again -> just filter existing results
3138
2745
  const handleInput = async (state, newValue, cursorOffset, inputSource = Script) => {
3139
2746
  if (state.value === newValue) {
3140
- return state;
2747
+ return {
2748
+ ...state,
2749
+ cursorOffset,
2750
+ inputSource
2751
+ };
3141
2752
  }
3142
2753
  const newState = await setValue(state, newValue);
3143
2754
  return {
@@ -3254,7 +2865,7 @@ const initialize = async () => {
3254
2865
  await sendMessagePortToEditorWorker(port, 0);
3255
2866
  }
3256
2867
  });
3257
- set$3(rpc);
2868
+ set$2(rpc);
3258
2869
  };
3259
2870
 
3260
2871
  const getDefaultValue = id => {
@@ -3621,7 +3232,6 @@ const getQuickPickItemVirtualDom = visibleItem => {
3621
3232
  }];
3622
3233
  const parent = dom[0];
3623
3234
  if (isActive) {
3624
- // @ts-ignore
3625
3235
  parent.id = QuickPickItemActive;
3626
3236
  parent.className += ' ' + QuickPickItemActive$1;
3627
3237
  }
@@ -3908,6 +3518,7 @@ const searchModules = {
3908
3518
  };
3909
3519
 
3910
3520
  const listen = async () => {
3521
+ registerCommands(commandMap);
3911
3522
  register(searchModules);
3912
3523
  const rpc = await WebWorkerRpcClient.create({
3913
3524
  commandMap: commandMap
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-search-worker",
3
- "version": "6.9.0",
3
+ "version": "6.10.0",
4
4
  "keywords": [
5
5
  "text-search"
6
6
  ],